activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Message acknowledgement synchronization problem
Date Fri, 25 May 2007 13:45:08 GMT
A JMS Session, Consumer & Producer is only meant to be used by one
thread at any point in time. Thats the reason we don't sync ourselves
(it just adds overhead when the spec is pretty clear about thread
usage).


On 5/25/07, fungrim <contact@larsan.net> wrote:
>
> Hello, I'm not entirely sure of what the JMS spec. says about this, so I'm
> posting this as a question rather than a bug. We have a system with
> asynchronous message "execution" taking messages of an ActiveMQ queue with
> message groups enabled. It turns out that the code for ack'ing separate
> messages uses a bit of unsafe code in their (shared) session. We're using
> ActiveMQ 4.1.0. This stack trace explains the problem:
>
> >>>
> Caused by: java.lang.NullPointerException
>    at org.apache.activemq.command.MessageAck.<init>(MessageAck.java:66)
>    at
> org.apache.activemq.ActiveMQMessageConsumer.acknowledge(ActiveMQMessageConsumer.java:747)
>    at
> org.apache.activemq.ActiveMQSession.acknowledge(ActiveMQSession.java:1381)
>    at
> org.apache.activemq.ActiveMQMessageConsumer$1.execute(ActiveMQMessageConsumer.java:444)
>    at
> org.apache.activemq.command.ActiveMQMessage.acknowledge(ActiveMQMessage.java:95)
> >>>
>
> (Ie. the ActiveMQMessageConsumer is not thread safe)
>
> So the question is, is this the correct behaviour? I can obviously force a
> synchronization on the session object on my end, but that seems like a
> somewhat ugly sollution.
>
> Regards
> /Lars J. Nilsson
> --
> View this message in context: http://www.nabble.com/Message-acknowledgement-synchronization-problem-tf3815389s2354.html#a10800690
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message