Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Associate Same Mdb file to multiple queue in Ejb3 jboss 5.x server

 
chandr prakash
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
chandr prakash
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
ejb-jar.xml



weblogic-ejb-jar.xml


 
chandr prakash
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Waiting for reply!
 
chandr prakash
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am i clear? Please reply......
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic