1 Reply Latest reply on Oct 25, 2016 10:19 PM by Justin Bertram

    WildFly 10.0.0 Final. Why my MDB does not receive messages? Remote JNDI entry binding in Naming Subsystem

    Ildar Gilfanov Newbie

      Hi,

       

      I have an application deployed on one WildFly 10.0.0 Final server that needs to access a remote JMS Topic on another WildFly 10.0.0 Final.

       

      A lookup can navigate through an external context. My configuration:

      <subsystem xmlns="urn:jboss:domain:naming:2.0">
           <bindings>
               <external-context name="java:/global/MyRemoteServer" module="org.jboss.as.naming" class="javax.naming.InitialContext" cache="true">
                   <environment>
                       <property name="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>
                       <property name="java.naming.provider.url" value="http-remoting://172.16.2.1:8080"/>
                       <property name="java.naming.security.principal" value="jmsguest"/>
                       <property name="java.naming.security.credentials" value="jmsguest"/>
                   </environment>
               </external-context>
               <lookup name="java:global/MyExportedQueue" lookup="java:/global/MyRemoteServer/jms/queue/MyQueue"/>
               <lookup name="java:global/MyExportedTopic" lookup="java:/global/MyRemoteServer/jms/topic/MyTopic"/>
               <lookup name="java:global/MyExportedFactory" lookup="java:/global/MyRemoteServer/jms/RemoteConnectionFactory"/>
          </bindings>
          <remote-naming/>
      </subsystem>
      

       

      I'd like to use resource injection and standard JMS activation properties for an MDB:

      @MessageDriven(name = "MyReceiver", activationConfig = {
              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
              @ActivationConfigProperty(propertyName=  "connectionFactory", propertyValue = "java:global/MyExportedFactory"),
              @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:global/MyExportedTopic"),
              @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
      public class MyReceiver implements MessageListener {
      

       

      Why my mdb does not receive messages?   Are no exceptions.

        • 1. Re: WildFly 10.0.0 Final. Why my MDB does not receive messages? Remote JNDI entry binding in Naming Subsystem
          Justin Bertram Master

          Couple of points:

          1. The ActiveMQ Artemis JCA RA doesn't support the activation configuration property "connectionFactory".  Perhaps you are looking for "connectionFactoryLookup"?
          2. The JNDI lookup for the destination and the actual connection used to consume messages are 100% independent of each other.  Therefore, all you've done here is configure a JNDI lookup for the destination while the connection goes to the local broker.
          3. I recommend using either the "connectorClassName" and "connectionParameters" activation configuration properties on the MDB itself or the connector configuration on the pooled-connection-factory which the MDB is using to configure consumption from the remote server.