rabbitmq-delayed-message-exchange
rabbitmq-delayed-message-exchange copied to clipboard
Handle rabbit_delayed_message restarts.
If the rabbit_delayed_message process is restarted, a timer is not being started automatically until go is called or a new message is scheduled for delay.
This can cause significant delays in message arrival to queue if all publishers stop and rabbit_delayed_message is restarted, which is likely to happen simultaneously when the restart leads to a channel error.
I am also facing similar issue. Getting channel shutdown error with x-delayed-message.
Here is my code. config: @Bean CustomExchange delayExchange() { Map<String, Object> args = new HashMap<String, Object>(); args.put("x-delayed-type", "topic"); return new CustomExchange(statusRetrievingProperties.getExchangeName(), "x-delayed-message", true, false, args); }
publisher: template.convertAndSend(statusRetrievingMessagingProperties.getExchangeName(), statusRetrievingMessagingProperties.getRoutingKey(), "test", new MessagePostProcessor() { @Override public Message postProcessMessage(Message message) throws AmqpException { message.getMessageProperties().setHeader("x-delay", 15000); return message; } });
please provide solution to resolve this issue and call consumer after specified delay.