You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug occurs when a stream is deleted while the Consumer is trying to re-connect.
In most of case it works because the Metadata does the check.
but during the check and restart of the consumer, the stream could be deleted. [here the edge case]
Unhandled exception. RabbitMQ.Stream.Client.CreateConsumerException: consumer could not be created code: StreamDoesNotExist
at RabbitMQ.Stream.Client.StreamSystem.CreateRawConsumer(RawConsumerConfig rawConsumerConfig, ILogger logger) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/StreamSystem.cs:line 441
at RabbitMQ.Stream.Client.Reliable.ConsumerFactory.StandardConsumer(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ConsumerFactory.cs:line 80
at RabbitMQ.Stream.Client.Reliable.ConsumerFactory.CreateConsumer(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ConsumerFactory.cs:line 33
at RabbitMQ.Stream.Client.Reliable.Consumer.CreateNewEntity(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/Consumer.cs:line 186
at RabbitMQ.Stream.Client.Reliable.ReliableBase.Init(Boolean boot, IReconnectStrategy reconnectStrategy) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs:line 89
at RabbitMQ.Stream.Client.Reliable.ReliableBase.Init(IReconnectStrategy reconnectStrategy) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ReliableB
Reproduction steps
Run multi consumers
Delete the streams
Most of the time it works but it could happen that the stream is deleted just after the check streamExist
...
Expected behavior
Close the consumer.
Need to check the error code: ConsumerFactory::StandardConsumer When it is not the first boot. If there is an error just close the consumer.
Same for Producer
Additional context
No response
The text was updated successfully, but these errors were encountered:
Fixes: #333Fixes: #335
# Preface
The commit is focused on making the client more stable during the server restart and better handling the metadata update event.
Most of the changes are in the super stream producer and consumer.
See the issue #333
# 1- What's changed in the super stream part
The RawSuperStreamProducer and RawSuperStreamConsumer expose two callbacks:
- `ConnectionClosedHandler (reason, stream)`
- `MetadataHandler(update)`
- `ISuperStreamProducer` and `ISuperStreamConsumer` interfaces
ConnectionClosedHandler
--
The callback is raised each time a partition is closed for some reason. You can check the reason with:
```
1- public const string Normal = "TCP connection closed normal";
2- public const string Unexpected = "TCP connection closed unexpected";
```
1- The super stream partition is closed by the `Close()` method, so there are no problems. It can be helpful in terms of alerting or logs.
2- The super stream partition is closed in an unexpected way like kill the connection, network problems broker restart etc..
In that case, you can reconnect the partition with the `ReconnectPartition` method.
MetadataHandler
---
It happens when there is a change in the stream topology.
In this case, the server drops all the producers and consumers. So, you need to react to the Metadata Handler event. You can decide to reconnect the producer and consumer
using the `ReconnectPartition`
Producer and Consumer classes
--
The `Producer` and `Consumer` classes handle automatically the `ConnectionClosedHandler` and the `MetadataHandler` events for stream and super stream.
# 2- Fail fast
The Producer and Consumer classes can restore the connection automatically when they are up and running.
The classes will fail immediately if there are problems during the first connection.
This behaviour is now like the Java Client's.
---------
Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
Describe the bug
This bug occurs when a stream is deleted while the Consumer is trying to re-connect.
In most of case it works because the
Metadata
does the check.but during the check and restart of the consumer, the stream could be deleted. [here the edge case]
Reproduction steps
Most of the time it works but it could happen that the stream is deleted just after the check
streamExist
...
Expected behavior
Close the consumer.
Need to check the error code:
ConsumerFactory::StandardConsumer
When it is not the first boot. If there is an error just close the consumer.Same for Producer
Additional context
No response
The text was updated successfully, but these errors were encountered: