1 of 10

RabbitMQ steam clients

Survive a cluster restart

2 of 10

What happens when a node is restarted

3 of 10

Single node restart

Client

Stream 1

Connection reset

STOP

4 of 10

Single node - Delete Stream

Client

Stream 1

MetaData Update

5 of 10

Cluster restart a node

Client

Stream 1

MetaData Update

Stream 1

Stream 1

STOP

6 of 10

Metadata update

  • Contains only the stream name and code: StreamNotAvailable
  • When the stream topology changes
    • Node restart can change the leader
    • Add_replica
    • Remove_replica
    • Restart_stream
    • Delete the stream
  • MetaDataUpdate removes all the Consumer/Producer items and leave the connection open.
  • Can receive a MetaDataUpdate even the client is connected to a follower node

7 of 10

StreamNotAvailable

  • It is possible to receive StreamNotAvailable error code:
    • MetadaUpdate update
    • During the creation of producer and consumer when restarting a cluster the stream could be not available. Temp problem.

8 of 10

React to the events

9 of 10

MetaData Update and StreamNotAvailable

  • It is up to the client understand if the stream still exists
    • .NET client retry until gets a result ( or the number of the tentatives)
    • Close the producer/consumer If the stream does not exist

10 of 10

Producer/Consumer StreamNotAvailable error Code

  • During a cluster restart it can happen that
    • Client is trying to connect to a node but the stream in not ready yet
    • Client receive StreamNotAvailable error
    • Client needs to retry and consider it as special error