-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve reconnection #336
Labels
enhancement
New feature or request
Comments
This was referenced Dec 15, 2023
Closed
Gsantomaggio
added a commit
that referenced
this issue
Dec 19, 2023
The pr is part of #336 the aim is to standardise the behaviour. - Add AlreadyClosedException when a producer or super stream producer is closed In the same way like AMQP does with channels - Producer: Flush the pending messages when closed. - Producer: Add AlreadyClosedException when closed. So it is the same like: AMQP and RawProducer and RawSuperStreamProducer - Improve IsAKnownException function with the AggregateException that can contains known exceptions needed for reconnect the client - Add EntitiesStateTests to test all the status and verify that all the entities have the same behaviour Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Gsantomaggio
added a commit
that referenced
this issue
Dec 20, 2023
* Improve the rawProducer and rawSuperStreamProducer status * Part of #336 the aim is to standardise the behaviour. * Add AlreadyClosedException when a producer or super stream producer is closed In the same way as AMQP does with channels * Producer: Flush the pending messages when closed. * Producer: Add AlreadyClosedException when closed. So it is the same as: AMQP and RawProducer and RawSuperStreamProducer * Improve IsAKnownException function with the AggregateException that can contain known exceptions needed to reconnect the client * Add EntitiesStateTests to test all the status and verify that all the entities have the same behaviour * Assert the AlreadyClosedException Exception --------- Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Gsantomaggio
added a commit
that referenced
this issue
Jan 9, 2024
* Part of #336 * Improve the disconnection message. It is possible to understand if it is a normal disconnection or an unexpected. * Remove the Active Items from the connection pool and use the Publishers and Consumers client list directly to check the pool size * Refactor the Factory Classes. Remove code duplication in case of metadata update and connection closed. See ReliableBase.OnEntityClosed * Handle streamNotAvailable error. In this case the client will try to reconnect the entity * Fix the events attach to the RawConsumer and RawProducer. The events are attached only if the ResponseCode is OK * Detach the events once the entity receives the disconnection or metadata update. In that case, the entity is closed * Introduce ReliableEntityStatus like a state machine to understand the status of Producer and Consumer classes * Add ResourceAvailableReconnectStrategy interface to Handle the retry in case testing in a stream exists. See ReliableBase CheckIfStreamIsAvailable * Change the MetadataHandler to Func<MetaDataUpdate, Task> to be like the other methods * Producer and Consumer classes fail fast during the first initialization. The user is aware of what is happening. The reconnect part occurs only after the first boot. Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Merged
Gsantomaggio
added a commit
that referenced
this issue
Jan 11, 2024
* Improve Reconnection * Part of #336 * Improve the disconnection message. It is possible to understand if it is a normal disconnection or an unexpected. * Remove the Active Items from the connection pool and use the Publishers and Consumers client list directly to check the pool size * Refactor the Factory Classes. Remove code duplication in case of metadata update and connection closed. See ReliableBase.OnEntityClosed * Handle streamNotAvailable error. In this case the client will try to reconnect the entity * Fix the events attach to the RawConsumer and RawProducer. The events are attached only if the ResponseCode is OK * Detach the events once the entity receives the disconnection or metadata update. In that case, the entity is closed * Introduce ReliableEntityStatus like a state machine to understand the status of Producer and Consumer classes * Add ResourceAvailableReconnectStrategy interface to Handle the retry in case testing in a stream exists. See ReliableBase CheckIfStreamIsAvailable * Change the MetadataHandler to Func<MetaDataUpdate, Task> to be like the other methods * Producer and Consumer classes fail fast during the first initialization. The user is aware of what is happening. The reconnect part occurs only after the first boot. --------- Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
See also #394 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
The
Producer
andConsumer
classes provide a way to auto-reconnect, but there is some edge case not correctly handled like:The auto-reconnection is hidden from the user. It is hard to understand the status without logs.
Describe the solution you'd like
What to do:
via Add event status changed #349
StreamNotAvaiable
which is different fromStreamDoesNotExist
done via Improve Reconnection #343Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: