Open ron-liu opened 5 years ago
What version of artemis and rhea are you using? This works for me using latest rhea and artemis 2.9 (feature was only exposed through amqp since artemis 2.7 I believe):
context.sender.send({body:'Hello World!', message_annotations: {'x-opt-delivery-delay': 10000}});
Perhaps also check that the message being delivered immediately is not one that was already on the queue. E.g. make the body random or at least change it for a test run.
I'm using ActiveMQ 5.19.x (AmazonMQ), is it supposed to work there? We aren't on Artemis, yet. I've tried setting these in both delivery_annotations and message_annotations (when calling release
) with no apparent luck so far.
I don't know. Question for the ActiveMQ I think. Do they expose that functionality over AMQP, and if so how do they do it?
Good question. I'm currently digging through their code, will report back. https://activemq.apache.org/components/nms/providers/activemq/advanced-features/delay-and-schedule-message-feature https://activemq.apache.org/maven/apidocs/src-html/org/apache/activemq/
I have a question on stackoverflow, if anyone wants to follow it there. For all I know, it could be an Amazon limitation. I haven't tried a JMS client at all.
It appears that ActiveMQ does have a conversion from AMQP to JMS, copying the headers from one to the other. So maybe if there was a possibility to add custom headers to the message this could work.
Hi,
I want to implement sending delayed message, and I have been tried:
x-opt-delivery-delay
by following https://activemq.apache.org/components/artemis/documentation/latest/amqp.htmlAMQ_SCHEDULED_DELAY
by following https://activemq.apache.org/delay-and-schedule-message-deliveryThe following is the code I tried, but doesn't work, the message was sent straight away instead of delayed.