0

My application is spring boot micro service listening to a Rabbit MQ queue. The queue receives messages from different sources.

The requirement is that when the application server is going down (this could happen because of many reasons, may be because we brought the site down, or we are deploying an updated software on to our application server) we would like the queue to process the current message. As of now, we lose the message that the queue is currently processing. How can I achieve this?

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
GGKamal
  • 21
  • 6

1 Answers1

0

The default shutdownTimeout is 5000ms; you can increase it.

You should not, however, lose any messages, it should be requeued (unless you are using AcknowledgeMode.NONE (which is generally a bad idea).

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Gary, for more background about this topic: https://stackoverflow.com/questions/48328643/simplemessagelistenercontainer-shutdowntimeout – Artem Bilan Jan 23 '18 at 21:25
  • As @ArtemBilan says there in the last comment, we can only wait until the listener thread returns - if you hand off the message to another thread there is nothing we can do; that is bad practice since the message will be acknowledged immediately after the handoff; you really must process the work on the container thread. – Gary Russell Jan 23 '18 at 21:28