Above code is my message driven bean and working fine for single queue 'Queue1'. Now i want to associate Queue2 to same mdb.
I can do the same thing by creating another mdb class "EJB3MessageDrivenBean2" and by just changing activationConfig property as follow.
but in this method i have to replicate my code and in future if i have to associate another queue Queue3 then i have to again replicate java file.
Any other method by changing in xml file or any other method.
Why have different queues if one MDB is going to process them?
Have the MDB listen to only one queue and maybe look at using your JMS provider settings to automatically route messages to the queue being listened to if you have to have multiple queues.
Joined: Jan 29, 2011
Lets say message in queue1 are JmsMsg11,JmsMsg12,JmsMsg13,JmsMsg14
Lets say message in queue2 are JmsMsg21,JmsMsg22,JmsMsg23,JmsMsg24
I have to process JmsMsg11 and JmsMsg21 simultaneously. After processing of JmsMsg11, i have to process JmsMsg12 then JmsMsg13 then JmsMsg14. Same is also applicable for queue2.
I have done same thing in weblogic 10.x by some change in ejb-jar.xml and weblogic-ejb-jar.xml by following code. dont know how to do in jboss 5.x.