activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sitsky <s...@nuix.com>
Subject Re: onMessage() synchronisation requirements for queue+topic consumer
Date Sun, 07 Dec 2008 22:28:47 GMT
For the record, Rob has fixed this issue described in AMQ-2025 and I
have confirmed it seems to have fixed things.

Cheers,
David

David Sitsky <sits@nuix.com> writes:
> Hi Rob,
>
> Thanks for your reply.  It turns out I already set this property to true
> for both the broker and the client, as I have a requirement that the
> same thread is used for processing messages..
>
> I can only guess the issue is relating to the TcpConnection class
> receiving both events from a topic and a queue, and how it is being
> dispatched to the session.  
>
> Cheers,
> David
>
> Rob Davies <rajdavies@gmail.com> writes:
>> Hi David,
>>
>> this is indeed strange - and I suspect the TaskRunnerFactory we use
>> maybe at fault.
>> Can you set the System Property
>> org.apache.activemq.UseDedicatedTaskRunner=true for your client
>> instead of the synchronized onMessage() - and let me know if it
>> behaves correctly ?
>>
>>
>> cheers,
>>
>> Rob
>>
>> Rob Davies
>> http://fusesource.com
>> http://rajdavies.blogspot.com/
>>
>>
>>
>> On 1 Dec 2008, at 09:42, David Sitsky wrote:
>>
>>> Hi,
>>>
>>> I think this might be an easy question, but I have an application
>>> where
>>> my onMessage() handler is a consumer for both topic and queue
>>> messages.
>>>
>>> The topic and queue consumer are derived from the same ActiveMQ
>>> session,
>>> so I was under the impression that my onMessage() handler would not be
>>> called concurrently.
>>>
>>> However, I have a list that I iterate over and add elements too, which
>>> is only called via my onMessage() handler, and I see concurrency
>>> issues
>>> occurring.
>>>
>>> When I add synchronized to the onMessage() method, all works well.
>>>
>>> Am I doing something wrong, or is this the expected behaviour?
>>>
>>> -- 
>>> Cheers,
>>> David
>>>
>>> Nuix Pty Ltd
>>> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280
>>> 0699
>>> Web: http://www.nuix.com                            Fax: +61 2 9212
>>> 6902
>>
>
> -- 
> Cheers,
> David
>
> Nuix Pty Ltd
> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
> Web: http://www.nuix.com                            Fax: +61 2 9212 6902

-- 
Cheers,
David

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com                            Fax: +61 2 9212 6902

Mime
View raw message