rabbitmq-stream-dotnet-client icon indicating copy to clipboard operation
rabbitmq-stream-dotnet-client copied to clipboard

Improve reconnection

Open Gsantomaggio opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

The Producer and Consumer classes provide a way to auto-reconnect, but there is some edge case not correctly handled like:

  • https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/issues/335
  • https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/discussions/333

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:

  • [x] Provide more feedback with events ( ref https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/issues/316) via https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/349
  • [x] Improve the reconnection when the stream is in a "limbo" status like StreamNotAvaiable which is different from StreamDoesNotExist done via https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/343
  • [x] Stop to deliver messages as soon the consumer requests the closing. It will avoid providing messages to the user that are not needed anymore (dove via https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/339)
  • [x] Uniform the way to reconnect: The super stream has its own way to reconnect the client. We should use the same way ( ref https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/discussions/333 ) dove via https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/pull/344
  • [ ] Handle errors like:
RabbitMQ.Stream.Client.Reliable.Producer[0] Error sending message. Most likely the message is not sent to the stream: BenchmarkDotNet2.Message wont' receive confirmation so you will receive a timeout error System.Threading.Tasks.TaskCanceledException: A task was canceled.    at RabbitMQ.Stream.Client.RawProducer.SemaphoreAwaitAsync() in rabbitmq/rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/RawProducer.cs:line 231    at RabbitMQ.Stream.Client.RawProducer.Send(UInt64 publishingId, Message message) in /Users/gas/git/rabbitmq/rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/RawProducer.cs:line 340    at RabbitMQ.Stream.Client.Reliable.Producer.SendInternal(UInt64 publishingId, Message message) in rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/Producer.cs:line 271
  • [ ] Handle super Stream error like:
RabbitMQ.Stream.Client.Reliable.Producer[0] Error sending message. Most likely the message is not sent to the stream: invoices.Message wont' receive confirmation so you will receive a timeout error System.DivideByZeroException: Attempted to divide by zero. 

Describe alternatives you've considered

No response

Additional context

No response

Gsantomaggio avatar Dec 15 '23 11:12 Gsantomaggio