3 Replies Latest reply on Oct 3, 2019 9:19 AM by Miroslav Novak

    HowTo - Configure DLQ in jboss EAP7

    Vamshi Krishna Newbie

      Hey there,

      I have the following mbean code with respective JMS Queue and DLQ from current/legacy EAP5 and migrating to EAP7,  Can anyone please let me know how to configure this in EAP7 ..?

       

       

      <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=ABCRequestQ" xmbean-dd="xmdesc/Queue-xmbean.xml">

      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

      <depends>jboss.messaging:service=PostOffice</depends>

      <attribute name="JNDIName">queue/ABCRequestQ</attribute>

      <attribute name="MaxDeliveryAttempts">10</attribute>

      <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=ABCErrorQ</attribute>

      <attribute name="RedeliveryDelay">10000</attribute>

      <attribute name="Clustered">true</attribute>

      </mbean>

       

       

      <mbean code="org.jboss.jms.server.destination.QueueService" name="jboss.messaging.destination:service=Queue,name=ABCErrorQ" xmbean-dd="xmdesc/Queue-xmbean.xml">

      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

      <depends>jboss.messaging:service=PostOffice</depends>

      <attribute name="JNDIName">ABCErrorQ</attribute>

      <attribute name="Clustered">true</attribute>

      </mbean>

       

       

      Is this the correct way of configuring JMS and its DLQ's ..?

       

      Address-setting & JMS Queue Configuration from JBOSS EAP7:

      <address-setting name="ABCCreditCheckRequest" dead-letter-address="jms.queue.ABCCreditCheckRequest" redelivery-delay="60000" max-delivery-attempts="10"/>

      <address-setting name="CreditCheckRequest" dead-letter-address="jms.queue.CreditCheckError" redelivery-delay="60000" max-delivery-attempts="10"/>

       

       

      <jms-queue name="ABCRequestQ" entries="java:jboss/exported/jms/queue/ABCRequestQ"/>

      <jms-queue name="ABCErrorQ" entries="java:jboss/exported/jms/queue/ABCErrorQ"/>

        • 1. Re: HowTo - Configure DLQ in jboss EAP7
          Miroslav Novak Master

          Hi,

           

          looking at your EAP 7 config, it should looks something like:

           

          <subsystem xmlns="urn:jboss:domain:messaging-activemq:7.0">
              <server name="default">
                  ...
          <address-setting name="jms.queue.ABCRequestQ" dead-letter-address="jms.queue.ABCErrorQ" expiry-address="jms.queue.ExpiryQueue" redelivery-delay="10000" max-delivery-attempts="10" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
          <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                  ...
          <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
          <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
          <jms-queue name="ABCRequestQ" entries="java:/queue/ABCRequestQ java:jboss/exported/queue/ABCRequestQ"/>
          <jms-queue name="ABCErrorQ" entries="java:/ABCErrorQ java:jboss/exported/ABCErrorQ"/>
                  ...
              </server>
          </subsystem>
          
          
          
          

          As you probably know 'address-settings' is configured in hierarchy so you need to provide address-settings with name '#" to provide some default for other queues/topic.

           

          If you're unsure which adress-settings will be applied for given queue then there is CLI command for this:

          cd EAP7_HOME/bin

          sh jboss-cli.sh -c

          /subsystem=messaging-activemq/server=default:resolve-address-setting(activemq-address=jms.queue.ABCRequestQ)

           

          which provides following output:

          [standalone@localhost:9990 server=default] :resolve-address-setting(activemq-address=jms.queue.ABCRequestQ)
          {
              "outcome" => "success",
              "result" => {
                  "address-full-policy" => "PAGE",
                  "dead-letter-address" => "jms.queue.ABCErrorQ",
                  "expiry-address" => "jms.queue.ExpiryQueue",
                  "expiry-delay" => -1L,
                  "last-value-queue" => false,
                  "max-delivery-attempts" => 10,
                  "max-redelivery-delay" => 100000L,
                  "max-size-bytes" => 10485760L,
                  "message-counter-history-day-limit" => 10,
                  "page-max-cache-size" => 5,
                  "page-size-bytes" => 2097152L,
                  "redelivery-delay" => 10000L,
                  "redelivery-multiplier" => 1.0,
                  "redistribution-delay" => -1L,
                  "send-to-dla-on-no-route" => false,
                  "slow-consumer-check-period" => 5L,
                  "slow-consumer-policy" => "NOTIFY",
                  "slow-consumer-threshold" => -1L,
                  "auto-create-jms-queues" => false,
                  "auto-delete-jms-queues" => false,
                  "auto-create-addresses" => true,
                  "auto-delete-addresses" => true,
                  "auto-create-queues" => false,
                  "auto-delete-queues" => false
              }
          }

           

           

          Cheers,

          Mirek

          • 2. Re: HowTo - Configure DLQ in jboss EAP7
            Vamshi Krishna Newbie

            Thanks mnovak for your response.

             

            I see for the default Queues the entries are mentioned as "java:/jms/queue/DLQ" & "java:/jms/queue/ExpiryQueue" but for the user defined queue I see they are defined as "java:queue/ABCRequestQ java:jboss/exported/queue/ABCRrequestQ".  Why only default queues are mentioned as :"/jms/queue" but not for user defined queues ..?

            <jms-queuename="ExpiryQueue"entries="java:/jms/queue/ExpiryQueue"/>

            <jms-queuename="DLQ"entries="java:/jms/queue/DLQ"/>

            <jms-queuename="ABCRequestQ"entries="java:/queue/ABCRequestQ java:jboss/exported/queue/ABCRequestQ"/>

            <jms-queuename="ABCErrorQ"entries="java:/ABCErrorQ java:jboss/exported/ABCErrorQ"/>

            Does "/jms/queue" have value only to default queues or do they have any effect for user defined queues also ..?

            • 3. Re: HowTo - Configure DLQ in jboss EAP7
              Miroslav Novak Master

              I tried to modify the config to look as your EAP 5 config as much as possible. So when a queue is defined like:

              <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>

               

              then EAP 7 will create queue with "core" address "jms.queue.DLQ" which can be looked up from JNDI under "jms/queue/DLQ".

               

              In you case had ABCRequestQ which could be looked up in EAP 5 under "queue/ABCRequestQ" and equivalent configuration for EAP 7 is:

              <jms-queue name="ABCRequestQ" entries="java:/queue/ABCRequestQ java:jboss/exported/queue/ABCRequestQ"/>

               

              I've omitted the ".../jms/..." which is not required as JNDI can set by you.

               

              I'll just note here that you do JNDI lookup from outside EAP 7 server, for example from remote JMS client then you need to registry queue under "java:jboss/exported/..." context.

               

              So for example for "java:jboss/exported/queue/ABCRequestQ" can be looked up from clients under "queue/ABCRequestQ" ("java:jboss/exported/" prefix is omitted)

               

              Thanks,

              Mirek