qweeze / rstream

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

implementing maxProducersByConnection and maxConsumerByConnection #188

Closed DanielePalaia closed 7 months ago

DanielePalaia commented 7 months ago

This closes #182

This PR is changing the client layer so a few more tests need to be done.

Now the Producer/SuperstreamProducer and Consumer/Superstreamconsumer classes take a new fields: max_publishers_by_connection and max_subscribers_by_connection

In this way you can setup the maximum publishers and subscribers by connections (Before was 256 without possibility to override this value).

Doing some tests with this mode I was also able to discover a bug in client.get_available_id

Also It improves the SuperstreamConsumer connections. Before the class was creating a new Consumer for every partition of the superstream, while now we are just using a single Consumer and creating different Subscribers.