activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Concurrent message processing
Date Thu, 28 May 2009 06:13:05 GMT
Use more than one Session - or put the messages in a BlockingQueue and  
use a thread pool to process them concurrently

Rob Davies
Sent from my iPhone

On 28 May 2009, at 05:38, Deepak Agrawal <s.deepak.agrawal@gmail.com>  
wrote:

>
> I am using activeMQ 5.1 and I want my consumer to process my message
> asynchronously.
> Whenever any message comes to the consumer the processing of message  
> in
> onMessage method includes connectivity with database and processing  
> database
> query. So here if there is any block of code which requires more  
> time to
> process, it is delaying processing of other message. For example one  
> message
> in onMessage is taking 45 seconds to process the message and do  
> necessary
> database calls, the second message is consumed only after 45 seconds  
> are
> over.
>
> I want concurrent consuming of message to the consumer. So that the
> processing of one message should not delay the processing of another
> messages in the same queue.
>
> What will be the best way to achieve this ?
> Thanks for any help.
> -- 
> View this message in context: http://www.nabble.com/Concurrent-message-processing-tp23755107p23755107.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Mime
View raw message