0

I am trying to implement delayed messaging in rabbitmq using spring-boot without using a plugin.

I tried using the answers posted here - https://ivanyu.me/blog/2015/02/16/delayed-message-delivery-in-rabbitmq/

but no luck, can anyone throw some light on how to do it without using plugin ? I am able to do it using plugin.

Tried this in spring boot - https://ivanyu.me/blog/2015/02/16/delayed-message-delivery-in-rabbitmq/

Queue Bean config:

    Map<String, Object> args = new HashMap<String, Object>();
    args.put("x-dead-letter-exchange", "amq.direct");
    args.put("x-dead-letter-routing-key", "spring-boot-delayed-7");
    args.put("x-message-ttl", 5000);
    Queue messageQueueName = new Queue(queueName, false, false, false, args);
    return messageQueueName;

Message has to be delayed by 5 seconds.

J.K
  • 11
  • 3
  • Why the `Dead Letter Exchange` solution not works? Please give more detail. – menya Aug 08 '19 at 03:52
  • The delayed queue `spring-boot-delayed-7` has been created and bounded correctly? – menya Aug 08 '19 at 03:55
  • https://stackoverflow.com/a/43276108/1753177 – lambodar Aug 08 '19 at 06:12
  • Hi, Thanks for your reply. Yes, I did bound the queue correctly. I believe I am missing a logic here. Theory says I have push the message to QUEUE1 with TTL and once the TTL expires, message gets pushed to QUEUE2. But I am not able figure it out how to bind QUEUE2. – J.K Aug 08 '19 at 13:58
  • It is working in my local with this, but I used DirectExchange instead Fanout Exchange - https://stackoverflow.com/questions/4444208/delayed-message-in-rabbitmq/43276108#43276108 – J.K Aug 08 '19 at 21:11

0 Answers0