3 Replies Latest reply on Oct 19, 2012 5:16 PM by John Deviney

    EJB 2.1 and MDB listening to remote queue on JBoss 6.1.0

    John Deviney Newbie

      Can anyone confirm whether or not the instructions in the following article still work for JBoss 6.1.0, HornetQ 2.2.5 and EJB 2.1?

       

      https://community.jboss.org/wiki/HowDoIConfigureAnMDBToTalkToARemoteQueue

       

      The article above involves defining invoker proxy bindings to get an MDB to listen to a remote JMS queue.

       

      I have a EJB 2.1 style MDB that I need to configure to listen to a remote queue hosted on another JBoss 6.1.0 instance.  The configuration that I had working under JBoss 4.2.2 no longer works after migrating to JBoss 6.1.0.  There are no deployment or runtime warnings or errors but my MDB also never successfully connects to the remote queue.

       

      I have looked through the HornetQ 2.2.5 example, jca-remote, but it is EJB 3 style using annotations and no invoker proxy bindings.

        • 1. Re: EJB 2.1 and MDB listening to remote queue on JBoss 6.1.0
          John Deviney Newbie

          Here is a sample log entry from the server hosting the MDB:

           

          11:09:59,690 INFO  [HornetQActivation] awaiting topic/queue creation queue/EsbToTbot

          11:10:01,688 INFO  [HornetQActivation] Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@10a5e71 destination=queue/EsbToTbot destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=8)

          • 2. Re: EJB 2.1 and MDB listening to remote queue on JBoss 6.1.0
            John Deviney Newbie

            EJB 2.1 is still supported in JBoss 6.1.0 is it not?  If the answer is yes, then in theory there should be a way to make this work without porting to EJB 3.

            • 3. Re: EJB 2.1 and MDB listening to remote queue on JBoss 6.1.0
              John Deviney Newbie

              I was able to get this working by adding activation config properties to the MDB deployment descriptor.  I updated the ejb-jar.xml file like the following:

               

                <message-driven>
                   <ejb-name>EsbMDB</ejb-name>
                   <ejb-class>org.twia.esb.EsbMDB</ejb-class>
                   <transaction-type>Container</transaction-type>
                   <message-destination-type>javax.jms.Queue</message-destination-type>
                   <activation-config>
                      <activation-config-property>
                         <activation-config-property-name>connectorClassName</activation-config-property-name>
                         <activation-config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</activation-config-property-value>
                      </activation-config-property>
                      <activation-config-property>
                         <activation-config-property-name>connectionParameters</activation-config-property-name>
                         <activation-config-property-value>host=remoteJMShostname;port=5445</activation-config-property-value>
                      </activation-config-property>
                   </activation-config>
                </message-driven>

               

              No other configuration or code changes were necessary.