Apache.NMS.ActiveMQ publish behaviour

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Apache.NMS.ActiveMQ publish behaviour

phatcher
Can anyone comment on the behaviour I'm seeing...

If you have a publisher, non-transactional  and publish to a topic that you don't have permission on, a security exception is raised and it fails as expected.

However, if you do the same inside a transaction, the publish says that it has worked, but then you receive an error message on the connection with the security exception (if you knew you had to register a listener in the first place). The problem is, by the time this happens you are likely to have committed your transaction as your main thread doesn't know anything has gone wrong.

None of the samples show this, and it means that OOB transactional publishing doesn't work inituitively - this took me quite a while to work out.

I understand that asynchronous publishing is faster, but we have the slightly strange scenario that my nice transactional code silently fails whereas the non-transactional reports an error.

Comment?
Reply | Threaded
Open this post in threaded view
|

Re: Apache.NMS.ActiveMQ publish behaviour

ceposta
Set alwaysSyncSend == true




On Tue, May 27, 2014 at 8:14 AM, phatcher <[hidden email]> wrote:

> Can anyone comment on the behaviour I'm seeing...
>
> If you have a publisher, non-transactional  and publish to a topic that you
> don't have permission on, a security exception is raised and it fails as
> expected.
>
> However, if you do the same inside a transaction, the publish says that it
> has worked, but then you receive an error message on the connection with
> the
> security exception (if you knew you had to register a listener in the first
> place). The problem is, by the time this happens you are likely to have
> committed your transaction as your main thread doesn't know anything has
> gone wrong.
>
> None of the samples show this, and it means that OOB transactional
> publishing doesn't work inituitively - this took me quite a while to work
> out.
>
> I understand that asynchronous publishing is faster, but we have the
> slightly strange scenario that my nice transactional code silently fails
> whereas the non-transactional reports an error.
>
> Comment?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Apache-NMS-ActiveMQ-publish-behaviour-tp4681444.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta
Reply | Threaded
Open this post in threaded view
|

Re: Apache.NMS.ActiveMQ publish behaviour

phatcher
I figured that out, my point is that the behaviour out of the box is broken - the AlwaysSendSync has the feel of someone adding some code to get around bad behaviour
Reply | Threaded
Open this post in threaded view
|

Re: Apache.NMS.ActiveMQ publish behaviour

ceposta
Maybe we should have a default exception listener or something, especially
when using TX.



On Wed, May 28, 2014 at 2:58 AM, phatcher <[hidden email]> wrote:

> I figured that out, my point is that the behaviour out of the box is
> broken -
> the AlwaysSendSync has the feel of someone adding some code to get around
> bad behaviour
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Apache-NMS-ActiveMQ-publish-behaviour-tp4681444p4681468.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta