Wildfly 8.1: Can't connect remote to JMS-Topic using @MessageDriven
happy_robot Nov 7, 2014 8:40 AMHi all,
i'm running a wildfly 8.1 cluster and can't connect remotely to my JMS-Topic with @MessageDriven.
It all works fine doing it manually (trough JNDI-lookup), but fails if i try it by an @MessageDriven:activationConfig.
JMS-Config (Server, bound to http-connector):
<jms-destinations>
.....
<jms-topic name="byzzyTopic">
<entry name="java:/jms/topic/byzzy"/>
<entry name="java:jboss/exported/topic/byzzy"/>
</jms-topic>
</jms-destinations>
Successfully call from remote-client (Wildfly running on another JVM on the same host):
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");
env.put(Context.SECURITY_PRINCIPAL, "user");
env.put(Context.SECURITY_CREDENTIALS, "password");
Context remoteContext;
try {
remoteContext = new InitialContext(env);
ConnectionFactory factory = (ConnectionFactory) remoteContext.lookup("jms/RemoteConnectionFactory");
HornetQTopic topic = (HornetQTopic) remoteContext.lookup("topic/byzzy");
System.out.println(topic.getTopicName());
System.out.println(topic.getAddress());
} catch (NamingException exception) {
exception.printStackTrace();
}
Failing call from remote-client using @MessageDriven-annotation (Wildfly running on another JVM on the same host):
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/byzzy"),
@ActivationConfigProperty(propertyName = "user", propertyValue = "user"),
@ActivationConfigProperty(propertyName = "password", propertyValue = "password"),
@ActivationConfigProperty(propertyName="connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),
@ActivationConfigProperty(propertyName="connectionParameters", propertyValue = "http-remoting://127.0.0.1:8080"),
@ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "-1"),
@ActivationConfigProperty(propertyName = "setupAttempts", propertyValue = "-1") })
public class BackendListener implements MessageListener {
...
}
Using this annotation i get the following output om startup:
14:32:07,177 INFO [org.jboss.as.ejb3] (MSC service thread 1-10) JBAS014142: Started message driven bean 'BackendListener' with 'hornetq-ra.rar' resource adapter
14:32:08,456 INFO [org.jboss.resteasy.plugins.validation.AbstractValidatorContextResolver] (MSC service thread 1-15) Unable to find CDI supporting ValidatorFactory. Using default ValidatorFactory
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) Setting up org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@7852b725 destination=topic/byzzy destinationType=javax.jms.Topic ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) No connector params provided using default
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) Creating Connection Factory on the resource adapter for transport=[TransportConfiguration(name=78e8c65d-6682-11e4-8464-b931d8592433, factory=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory) ] with ha=false
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) Using context {java.naming.ldap.version=3, java.naming.factory.url.pkgs=org.jboss.as.naming.interfaces:org.jboss.ejb.client.naming} for org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@7852b725 destination=topic/byzzy destinationType=javax.jms.Topic ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) Destination type defined as javax.jms.Topic
14:32:08,826 DEBUG [org.hornetq.ra] (default-threads - 1) Retrieving javax.jms.Topic "topic/byzzy" from JNDI
14:32:08,842 DEBUG [org.hornetq.ra] (default-threads - 1) Unable to retrieve topic/byzzy from JNDI. Creating a new javax.jms.Topic named byzzy to be used by the MDB.
What's wrong with my @MessageDriven-Annotation?
Any ideas?
Thanks in advance
Daniel