How to connect to a remote queue using MDB
johanvankampen May 1, 2014 8:46 AMI am trying to connect to a queue on a remote server. In my setup I have a 'producer' server holding the queue (queue/test) and a 'consumer' server running a ear-file containing the MDB
I couldn't find any examples on how to do this via http-remoting (don't know if it is possible?). Therefore I tried it using a netty-connector.
Until now without complete success. The steps I took are :
1. configuring WildFly to use netty - connector. As far as I can see it works. See below output of startup-log
12:13:45,075 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221020: Started Netty Acceptor version unknown 127.0.0.1:5445
12:13:45,081 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221020: Started Netty Acceptor version unknown 127.0.0.1:5455
12:13:45,082 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221007: Server is now live
2. add queues to 'producer' server
12:13:45,082 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 58) HQ221001: HornetQ Server version 2.4.1.Final (Fast Hornet, 124) [17f3235f-cfb4-11e3-a34f-894a05f9ecb4]
12:13:45,098 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 58) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
12:13:45,099 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 59) HQ221003: trying to deploy queue jms.queue.testQueue
12:13:45,105 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 59) JBAS011601: Bound messaging object to jndi name queue/test
12:13:45,105 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 59) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/queue/test
12:13:45,106 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221003: trying to deploy queue jms.queue.tutorialQueue
12:13:45,108 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 60) JBAS011601: Bound messaging object to jndi name java:jboss/exported/tutorialQueue
12:13:45,109 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 61) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
12:13:45,141 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-8) JBAS010406: Registered connection factory java:/JmsXA
3. Deploy MDB configured like :
@MessageDriven(
name = "TutorialConsumer",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/test"),
@ActivationConfigProperty(propertyName = "user", propertyValue = "quickstartUser"),
@ActivationConfigProperty(propertyName = "password", propertyValue = "quickstartPwd1!"),
@ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "-1"),
@ActivationConfigProperty(propertyName = "setupAttempts", propertyValue = "-1"),
@ActivationConfigProperty(propertyName="connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),
@ActivationConfigProperty(propertyName="connectionParameters", propertyValue = "host=localhost;port=5455")
})
4. I see the deployment 'succeeding'. However the connection with the queue on the 'producer' server not :
12:17:34,076 INFO [org.hornetq.ra] (default-threads - 16) HQ151000: awaiting topic/queue creation queue/test
12:17:36,077 INFO [org.hornetq.ra] (default-threads - 16) HQ151001: Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@5bb3a811 destination=queue/test destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=quickstartUser password=**** maxSession=15)
Furthermore :
* I also tried connecting to the server via port 5445 -> same result
* changing the password results in a authentication failure on the producer. So, the MDB is trying to connect.
* Messages aren't read from the queue
* No errors are shown
What am I missing ?