-1

i have a scenario where in before i write any data to the RabbitMq queue i should check whether queue is alive or not.

If not i should save the data into the localDb but and my thread code should be keep on pooling into the connection status to know whether the connection is up or not.

Once the connection is up the data saved in localDb should be dumped into the queue for the consumption.

if(check_connection_existsOrNot())
true:--->dump into the queue
false:--->create a thread to pool onto the connection status.
Prash
  • 544
  • 8
  • 24
  • No. You have the wrong idea. You should simply attempt to write to the queue and handle the exception that arises if it is dead. Your way the queue can be up when you test and down when you write, or *vice versa.* You can't predict the future, whether with or without a computer. – user207421 Jun 04 '18 at 06:03

1 Answers1

0

Not sure what it means to check if a queue is alive, but for checking status of anything on RabbitMQ, you can use the management HTTP API.

Lucas Ross
  • 1,049
  • 8
  • 17