qweeze / rstream

A Python asyncio-based client for RabbitMQ Streams
MIT License
83 stars 13 forks source link

Review and redesign disconnection/reconnection and metadata Update scenarios #174

Closed DanielePalaia closed 9 months ago

DanielePalaia commented 10 months ago

Scope of this PR is to review and redesign the disconnection/reconnection and MetdataUpdate use case scenarios on Producer/Super-stream Producer side.

Before to manage a disconnection/metadata update was necessary to define a callback on_connection_close in order to catch the event and eventually reconnect if needed.

With this logic the user had to manage the all reconnection problem and eventual issues.

With this PR we introduce a sort of auto-reconnect on Producer side. The send() will detect that the stream is not connected anymore and will attempt a reconnection if necessary both during disconnection and metadata update use case scenarios.