I've had a look at this and the client appears to be doing nothing
wrong, it looks like you are probably hitting a broker bug being
exposed by different behaviour of the newer clients vs the old 0.11.1.
l tried sending non persistent messages using 0.41.0 with ActiveMQ
5.15.8, and also without ActiveMQ using some more tests in the clients
test suite, no issues arose.

I believe you are likely hitting an older broker bug, where it
mishandles either the lack of a message header section, or the durable
field in it being null, both meaning its default value of false
applies. Having now investigated the client side and come to that
idea, I actually do vaguely recall such a bug being fixed in the
broker perhaps a few years ago. You dont say which broker version you
are using, but I'm guessing its older?

Robbie

On Thu, 25 Apr 2019 at 10:12, Hardik Jethava <[email protected]> wrote:
>
> Hi Team,
>
> We are using Qpid JMS 0.37.0 Library(Java) for publishing and consuming 
> messages to ActiveMQ. With that when we try to publish message to ActiveMQ 
> using producer.send(…) and set Delivery Mode to Non Persistent, in that case 
> when messages gets published to ActiveMQ, Persistence is set to “Persistent” 
> instead of “Non Persistent”. Same thing was working fine with Qpid JMS 0.11.1 
> Library.
>
> In our case we are creating Anonymous producers and we use them to publish 
> message to particular destination with Proper delivery mode, Priority and TTL 
> using 
> this<https://docs.oracle.com/javaee/7/api/javax/jms/MessageProducer.html#send-javax.jms.Destination-javax.jms.Message-int-int-long->
>  API.
>
> Additional observation:
>
>   *   If we set Priority(i.e. >=5) on producer in that case even if I set 
> delivery mode to “Non Persistent”, message is getting published as 
> “Persistent”.
>   *   If we keep default priority(i.e. 4) and set TTL on producer in that 
> case even if I set delivery mode to “Non Persistent”, message is being sent 
> as “Persistent”.
>
> Note: Both of the above mentioned cases works fine with Qpid JMS 0.11.1 
> library((i.e. Messages gets published as “Non Persistent”) but not with Qpid 
> JMS 0.20.0 onwards.
>
> Can you please let me know why message persistence doesn’t work properly for 
> Priority messages and any non-priority message having TTL with  Qpid JMS 
> 0.20.0 onwards?
>
> Regards,
> Hardik

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to