This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Pool of MDPs If Possible

Jun 28th, 2011, 11:59 AM

Hi,
I have a scenario where a lot of complex business logic is executed including the database updates and inserts done from the listener method of the MDB that I have registered in my Spring Configuration file.
At peak I am expecting a lot of messages arriving to the Queue that my MDP will be listening to - so holding them to have one of processings to get completed is not a good idea I thought.
My question is - Is there a way I can create a pooled MDPs so that each time a message comes it's listened (and do the complex business logic processing) by a different instance of MDP and so it kind of speeds up the process.
I also would like to know if it's possible, what are the possible points that can lead to a trouble.
Thanks,
Sharad

Comment

Mark thanks very much for this quick response. I definitely am using the combination of DefaultMessageListenerContainer and org.springframework.jms.connection.JmsTransactionM anager for the sake of listening and transaction management in this whole set of affairs. I will use this attribute to achieve what I wished to do.
Thanks again.

Comment

Hi,
I had that concurrentConsumers attribute set to 5 and things worked fine. But just to make sure If I am now spawning those 5 number of listener instances I wrote the default constructor in my Listener class and printed the "this" object. It surprisingly gets printed only twice and not 5 times. What can be the primary reason for it.How do I make sure programattically that I raelly have those paralell number of listeners running to grab the mesages from Queue.
Thanks and appreciate all the answers,
Sharad