so the message driven beans have to connect to different JMS brokers one at mq://localhost:1234 and the other mq://myserver:9876
In glassfish admin console create a destination resource(Resources->JMS Resources->Destination Resources). Create a new physical destination with the same name as the destination name on the host server. So in the above problem we have to create 3 different destination.
Then for each JMS broker create a connection factory. For the above problem we need to create 2 different connection factory
1) LocahostConnectionFactory fill in all the regular connection pool info. In the properties add the following properties and values
2) MyServerConnectionFactory fill in all the regular connection pool info. In the properties add the following properties and values
now we need to tell each messagedriven bean what queue messages to listen so add the below annotation for each message driven bean. The mappedname parameter needs to have the exact same JNDI name used to create the Destination resource in step 1.
Finally we need to tell for each MDB queue which connection factory to use. this is done in the ejb-jar.xml file