0 Replies Latest reply on Apr 25, 2013 2:42 AM by Arjun A

    help needed in configuring  JMS remote consumer using <pooled-connection-factory>

    Arjun A Newbie

      Hi all,


      I have 2 Maven project, JMSProducer and JMSConsumer which will be packaged as ' war ' and will be deployed in JBOSS AS 7.1.1 Final.


      JMSProducer is running in one machine say machine A, which will be posting messages to a queue in machine A.

      JMSConsumer is running in machine B which consumes messages from the remote queue of machine A.



      my JMSProducer


      public class QueueProducer {


          @Resource(mappedName = "java:/ConnectionFactory1Mgmt")

          ConnectionFactory connectionFactory;


          @Resource(mappedName = "/queue/testJMS")

          Queue queue;


          private Connection connection;


          public void sendMessage() {

               try {


                 new InitialContext();

                  this.connection = this.connectionFactory.createConnection();

                  Session session = this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

                  MessageProducer publisher = session.createProducer(this.queue);

                  TextMessage textMessage = session.createTextMessage("hello world");






              } catch (JMSException jmse) {



              } catch (NamingException ne) {








      in machine A standalone-full xml i configured


      jms queue configuration

      <jms-queue name="testJMS">

                              <entry name="queue/testJMS"/>

                              <entry name="java:jboss/exported/jms/queue/testJMS"/>





      My JMSConsumer




      @MessageDriven(activationConfig = {

              @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

              @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testJMS")




      in machine B standalone-full.xml



               <connector name="remote-jms-nonmgmt">


                       <param key="host" value="remotehost"/>

                       <param key="port" value="5445"/>


               <netty-connector name="remote-jms-mgmt" socket-binding="remote-jms-binding"/>



      <pooled-connection-factory name="ConnectionFactory1Mgmt">




                       <connector-ref connector-name="remote-jms-mgmt"/>



                       <entry name="java:/ConnectionFactory1Mgmt"/>




      i create a application user in machine A with roles as guest.

      Is my understanding correct?. What configuration i have to use in producer side (machine A) for connection factory - ConnectionFactory1Mgmt . 


      Thanks in advance