-1

I need to check for messages inside a RabbitMQ queue using Java. I have gone through the standard Java API documentation of RabbitMQ but it seems that there is no standard way described there. I have also referred to this but failed to find any standard way.

What I am trying to achieve by this can be summarised as:

  1. My application will publish a message into a fanout exchange.

  2. Now here I want to get the contents of the message that has been published by my application or a confirmation whether the message is published or not into the correct exchange.

How can this be done using Java?

Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
mohor chatt
  • 356
  • 1
  • 8

1 Answers1

1

Use publisher confirms, add the message itself to the CorrelationData argument then, when you get a callback with the Ack, you can access the message.

See the documentation.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179