activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sarge <aga...@gmail.com>
Subject Concurrent message consumption in ActiveMQ
Date Wed, 06 May 2015 15:04:45 GMT
Hi, I use a ActiveMQServer as a broker.

Server.java <http://pastebin.com/RUZ5ZiZx>  

and I have a Client.java class, where I create a queue, message producer and
message consumer.

Client.java <http://pastebin.com/VpbysKca>  

In this main I create one queue, two producers and two consumers.

main <http://pastebin.com/crqpvtUB>  

and this is the output of main:

/Producer is going to send a message
client cl1 received message 05/06/2015 16:56:22 number of iteration 0
Producer is going to send a message
client cl2 received message 05/06/2015 16:56:24 number of iteration 1
Producer is going to send a message
client cl1 received message 05/06/2015 16:56:26 number of iteration 2
Producer is going to send a message
client cl2 received message 05/06/2015 16:56:28 number of iteration 3
Producer is going to send a message
client cl1 received message 05/06/2015 16:56:30 number of iteration 4
Producer is going to send a message
client cl2 received message 05/06/2015 16:56:32 number of iteration 5
Producer is going to send a message
client cl1 received message 05/06/2015 16:56:34 number of iteration 6
Producer is going to send a message
client cl2 received message 05/06/2015 16:56:36 number of iteration 7
Producer is going to send a message
client cl1 received message 05/06/2015 16:56:38 number of iteration 8
Producer is going to send a message
client cl2 received message 05/06/2015 16:56:40 number of iteration 9
client cl2 received message 05/06/2015 16:56:22 number of iteration 0
client cl2 received message 05/06/2015 16:56:26 number of iteration 2
client cl2 received message 05/06/2015 16:56:30 number of iteration 4
client cl2 received message 05/06/2015 16:56:34 number of iteration 6
client cl2 received message 05/06/2015 16:56:38 number of iteration 8/

I would like to ask, how can I make concurrent message consumption for all
consumers.

I mean:

/client cl1 received ... message of iteration 0
client cl2 received ... message of iteration 0
client cl1 received ... message of iteration 1
client cl2 received ... message of iteration 1/

I found prefetch limit settings, but don't know how to use
ActiveMQConnectionFactory and ActiveMQConnection classes without refactoring
in client.java class. Is there any other options to make message consumption
concurrent for all consumers?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Concurrent-message-consumption-in-ActiveMQ-tp4696175.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message