RabbitMQ DeliveryMode.NON_PERSISTENT on message doesn't work with JMS API's.

11 views
Skip to first unread message

chetan laddha

unread,
Dec 12, 2017, 9:07:02 AM12/12/17
to rabbitmq-users

I am trying to set DeliveryMode.NON_PERSISTENT on message but it gets ignored.
If I send delivery mode to producer then it gets considered.

MessageProducer producer = session.createProducer(null); 

TextMessage msg = session.createTextMessage(line); 

msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); 

producer.send(sendDestination, msg);


Above message get received as PERSISTENT where as below gets as NON_PERSISTENT

MessageProducer producer = session.createProducer(null); 

producer.setDeliveryMode(DeliveryMode.PERSISTENT); 

TextMessage msg = session.createTextMessage(line); 

producer.send(sendDestination, msg);


Is it bug ? Or am I missing anything?

Arnaud Cogoluègnes

unread,
Dec 12, 2017, 9:59:02 AM12/12/17
to rabbitm...@googlegroups.com
This is normal behavior according to the JMS specification. There's a flag to switch to a more "natural" mode, yet non spec-compliant. See [1] and [2].

[1] https://github.com/rabbitmq/rabbitmq-jms-client/issues/26
[2] https://github.com/rabbitmq/rabbitmq-jms-client/issues/26#issuecomment-308726847

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages