Temporary Reply Queue is not getting deleted
Quote:
Originally Posted by
Mark Fisher
Each temporary queue should live until a reply Message is received or as long as the timeout, whichever is longer. Then, it is deleted.
Are you actually witnessing something different?
Hi Mark,
Temporary Reply Queue is not getting deleted after it received the message. I'm using Spring amqp template to send and receive the message.
Below is the code snippet
context = new AnnotationConfigApplicationContext(RabbitConfigura tion.class);
Queue replyQueue = (Queue)context.getBean("springAmqpQ");
System.out.println("Reply Queue Name : " + replyQueue.getName());
RabbitTemplate template = (RabbitTemplate)context.getBean("amqpTemplate");
template.setReplyTimeout(120000);
template.setReplyQueue(replyQueue);
//template.convertAndSend(exchange, routingKey, createMessage(reportDbPing.getBytes()));
template.send(exchange, routingKey, createMessage(reportDbPing.getBytes()));
System.out.println("Message sent and went for a sleep.....");
Thread.sleep(120000);
System.out.println("Wake up from a sleep ready to consume Message");
Message message = template.receive(replyQueue.getName());
One more question, on how to set ack or Nack to the RabbitMq broker using AmqpTemplate? Or AmqpTemplate.receive() implicitly does autoAck??
Thanks in advance.