On 02/02/2015 05:24 PM, Kevin Burton wrote:
I’m unsure if this is a bug or another ActiveMQ idiosyncrasy…

If I send to a producer with:

         MessageProducer producer = session.createProducer( dest );
         producer.send( message );

That works and I receive the advisory.

However, if send like this:

         MessageProducer producer = session.createProducer( null );
         producer.send( dest, message );

The advisory isn’t raised.  I have a unit test to confirm that the message
was delivered to the queue and that it fails to raise the advisory.

This is by design as the second case creates an anonymous producer that can send to any destination that it has permission to write to. Sending that advisory every time an anonymous producer sent a message to a given destination would create a flood of advisories which would not really be of help.


The problem is that the second method is about 5x faster than the first.

I can certainly rewrite my code, but this could lead to bugs where code
expects to receive the advisory notice but now there’s a back door to send
messages without the advisory message meaning that you could break
production code.



--
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply via email to