0 Replies Latest reply on Jul 29, 2015 9:09 AM by Manish Sharma

    JBOSS 6.4 JMS Messages from client going to DLQ

    Manish Sharma Newbie

      Developed a client for sending messages on JBOSS 6.4.

      Instead of going to correct queue - messages are going to DLQ.

       

      I found the remote client which generated messsages for XYZ_ResponseQueue - all the messages are getting redirected to DLQ?

       

      The java code written is as follows

       

      Properties properties = new Properties();

        //properties.setProperty(JMSClassHost, JMSHost);

        //properties.setProperty(JMSClassPort, JMSPort);

        properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

        properties.put(Context.PROVIDER_URL, "remote://localhost:4449");

        properties.put(Context.SECURITY_PRINCIPAL, "guest");

        properties.put(Context.SECURITY_CREDENTIALS, "guestpassword");

        try{

       

        ctx = new InitialContext(properties);

        queueConnectionFactory = (QueueConnectionFactory) ctx.lookup("XYZ_Connection_Factory");

        responseQueue = (Queue) ctx.lookup("XYZ_ResponseQueue");

       

        connection = queueConnectionFactory.createQueueConnection();

        session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        sender   = session.createSender(responseQueue);

        connection.start();

       

        TextMessage textMessage = session.createTextMessage("ABCDEF " + Calendar.getInstance().getTime());

        sender.send(textMessage);

        System.out.println("Sending Queue Name: "+sender.getQueue().getQueueName());

        System.out.println("Sending message ID: "+textMessage.getJMSMessageID());

        sender.close();

        session.close();

        connection.close();

       

      In domain.xml file - below is the set-up

      <connection-factory name="XYZ_Connection_Factory">

                                  <connectors>

                                      <connector-ref connector-name="netty"/>

                                  </connectors>

                                  <entries>

                                      <entry name="java:jboss/exported/XYZ_Connection_Factory"/>

                                      <entry name="XYZ_Connection_Factory"/>

                                  </entries>

                                  <compress-large-messages>false</compress-large-messages>

                                  <failover-on-initial-connection>false</failover-on-initial-connection>

                                  <use-global-pools>true</use-global-pools>

      </connection-factory>

      <jms-destinations>

                              <jms-queue name="ExpiryQueue">

                                  <entry name="java:/jms/queue/ExpiryQueue"/>

                              </jms-queue>

                              <jms-queue name="DLQ">

                                  <entry name="java:/jms/queue/DLQ"/>                           

                              </jms-queue>

                              <jms-queue name="XYZ_ResponseQueue">

                                  <entry name="java:jboss/exported/XYZ_ResponseQueue"/>

                                  <entry name="XYZ_ResponseQueue"/>

                                  <durable>true</durable>

                              </jms-queue>

      <jms-destinations>


      For some reason the message is going to the DLQ queue.

      Urgent help needed.