2 Replies Latest reply on Feb 3, 2005 1:06 AM by Adrian Brock

    Talking to JBossMQ from 3rd party Application server using j

    Narayana Rallabandi Newbie

      I am trying to integrate JBossMQ with a SunOne application server.

      I could have the JBoss classes in my class path and could lookup send and recieve the messages the following way.

      
      java.util.Hashtable env = new java.util.Hashtable();
       env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
       env.put(javax.naming.Context.PROVIDER_URL,"jnp://localhost:1099");
       env.put(javax.naming.Context.URL_PKG_PREFIXES,"org.jnp.interfaces");
       Context context = new InitialContext(env);
      
      javax.jms.QueueConnectionFactory ref = (javax.jms.QueueConnectionFactory) context.lookup("ConnectionFactory");
      
      


      I could deploy the jms-ra.rar in SunOne Application Server, I have deployed an MDB which is listening to JBossMQ using this rar, though the MDB could deploy but could not listen any messages.

      The sun-ejb-jar.xml using the rar is given below
      
      <sun-ejb-jar>
       <enterprise-beans>
       <unique-id>1</unique-id>
       <ejb>
       <ejb-name>SimpleMessageEJB</ejb-name>
       <jndi-name>topic/testTopic</jndi-name>
       <mdb-resource-adapter>
       <resource-adapter-mid>jms-ra</resource-adapter-mid>
       </mdb-resource-adapter>
       </ejb>
       </enterprise-beans>
      </sun-ejb-jar>
      
      


      How can I make the rar to listen to my MDB? Are there any modifications to be done?The log file is saying nothing.

      Thanks in advance

        • 1. Re: Talking to JBossMQ from 3rd party Application server usi
          Narayana Rallabandi Newbie



          I think the probable solution lies here in the deployed rar getting the context and looking up for the JBoss JMS provider. In case of the Jboss App server this is done by JNDI Provider Adapter given as in the ds.xml

          
          <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
           name="jboss.mq:service=JMSProviderLoader,name=HAJNDIJMSProvider">
           <attribute name="ProviderName">DefaultJMSProvider</attribute>
           <attribute name="ProviderAdapterClass">
           org.jboss.jms.jndi.JNDIProviderAdapter
           </attribute>
           <!-- The combined connection factory -->
           <attribute name="FactoryRef">XAConnectionFactory</attribute>
           <!-- The queue connection factory -->
           <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
           <!-- The topic factory -->
           <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
           <!-- Access JMS via HAJNDI -->
           <attribute name="Properties">
           java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
           java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
           java.naming.provider.url=localhost:1100
           </attribute>
           </mbean>
          
          


          If I am correct, how could the same be done in the 3rd party Application Servers?

          Does the rar gets the context from the MBean by any chance?


          • 2. Re: Talking to JBossMQ from 3rd party Application server usi
            Adrian Brock Master

            This is an FAQ:
            http://www.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureAnMDBToTalkToARemoteQueue

            You are configuring the jndi context properties and bindings in the JMSProvider.
            These need not be referencing a JBoss/JBossMQ instance/cluster.