-
-
Notifications
You must be signed in to change notification settings - Fork 654
Description
Is your feature request related to a problem? Please describe.
This is a re-opening of #373 (and a few others) to add RabbitMQ as an async consumer input now that several existing asynchronous consumers have been added in V5.2.0.
I created this as a new ticket specifically because I am looking into writing a PR for it, and want to have an open ticket to collect the questions I have in.
Describe the solution you'd like
Addition of RabbitMQ
Design Questions
I have been looking at the code for the existing consumers, and it appears that the consumer has to do 3 things.
- Be added as a consumer that can be set up in consuming.go
- Implement the Service Interface
- Be able to listen for data and call Dispatch
Everything else appears to be consumer specific. Am I missing anything?
Consumer Multiplexing
Is a new consumer created for each specified input? IE if I have 2 tables I am reading data in from in postgres, (or 2 queues in rabbitMQ) Would I be calling the setup function twice, or is the consumer client set up once, and expected to handle the multiple inputs itself?
Multiple instances of centrifugo
When centrifugo is scaled out horizontally, it appears that postgres divides the work into partitions to make sure each piece of data is only handled by one instance each. Does the dispatch call properly send data between the instances so that the clients are all properly informed?
If so, RabbitMQ would be able to have each client in the centrifugo instance connect to the same queue, and the data would be processed in a partitioned manner automatically. I just wish to make sure that is acceptable.
Updates Mid-Execution
Is the expectation that the user restarts centrifugo to apply updates to asnyc consumers? or must they be able to adjust on the fly to changes in config?
Testing expectations
I will be able to write some unit tests for the RabbitMQ consumer of course, but I also saw some things that makes me think there are integration tests. Is that the case, and if so, what are the expectations around integration tests (and where might I look for more information/examples on those)?