I’ve created a simple MDB application and deployed it to Glassfish v 3.1 with embedded MQ broker. Destination Resource with name “jms/Queue” was created as well.
Please see part of the code below:
@MessageDriven(
mappedName = "jms/Queue",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
}
)
public class MessageBean implements MessageListener {
public void onMessage(Message message) {
........
This works fine, but how to configure this application to work with remote MQ broker instance(located on another host)?
You have two options:
Use the REMOTE mode when configuring your JNDI resources for
ConnectionFactoryandQueueentities so these entities are hosted by a remote OpenMQ.Configure a bridge to connect together two queues hosted in difference instances. Here is the documentation reference about that feature.