Manual acknowlegment in synchronous processing
Hi, Im new to AMQP and RabbitMQ. Im going through documentation, articles, posts and still cant find a way to implement functionality I need.
I have one rabbit server and one consuming java application. I need to control number of messages processed in particular period of time so I think synchronous processing (using RabbitTemplate.receive()) is better choice.
What I also need is to stop processing messages (without stopping application) when exception shows up. Of course I dont want the message to be lost - I want it to be delivered when app is started again. When I set rabbitTemplate.setChannelTransacted(true) message is returned to queue on exception. Then, as expected, message is consumed again and same exception.. over and over again.
I can set channelTransacted to false and when exception occurs, rabbit server is waiting for ack (which it obviously cannot get) and application is not processing other messages. But then, the problem is how application can send ack when message is processed properly (as far as I can see I cant do that from RabbitTemplate's interface).
Maybe there is a standard, common way of dealing with these kind of problems? I cant let the message for neverending circulation between server and consumer but I also cant stop the application on exception.