activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Sending directly to a queue doesn’t raise ActiveMQ.Advisory.Producer.Queue.>
Date Mon, 02 Feb 2015 22:37:03 GMT
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.bish@redhat.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Mime
View raw message