I have a CRUD like service which have REST HTTP API. This service have two instances - only one recieving request at time. If first instance starts throwing exceptions or slowing down we change load balancer rule to send requests to second instance. Now I wanted to add some AMPQ messaging type handler to this service. So there is any way to achieve this kind of solution which I mention above in this kind of type of communication ? I like to stop recieving messages from queue when I decide to do it.
-
Do you want to switch message consumers if one consumer gets slowed down or experiences problems? Is that what you are asking?– Greg BurghardtJul 25, 2018 at 0:45
1 Answer
If you mean that you want to change the routing of messages on the fly. That can be tricky.
You would need a custom routing step pulling messages from a single queue and then posting them to one or more other queues depending on your setting.
However, if you simply have two services pulling from the same queue, if one needs to be stopped you can just stop it and the second will continue to process all the messages.
-
-
you dont need a load balancer for messaging because the servers pull from the queue rather than having requests pushed to them– EwanJul 25, 2018 at 18:53
-
but I want to stop pulling it like Im stoping receving requests when I switch LB to another server Jul 25, 2018 at 19:21
-