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.
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.