0 Replies Latest reply on Mar 29, 2018 9:44 AM by Natalie Hunter

    jms queue processing files out of order

    Natalie Hunter Newbie

      We are running a jms queue on Wildfly 10 using activemq, We need the files to be processed in the order the are sent to the queue, but the only way I have found to accomplish this is by setting the max-pool-size=1. Is there any way to do an ordered process on the submissions? Are there drawbacks to having max-pool-size=1? The previous setting was 2.

       

      Looking at our logs, the files are submitted in order, but are taken off the queue out of order when max-pool-size=2.

       

      Settings:

      MDB jboss-ejb3.xml

      <enterprise-beans>

           <message-driven>

                <ejb-name>BatchProcessor</ejb-name>

                     <activation-config>

                          <activation-config-property>

                               <activation-config-property-name>destination</activation-config-property-name>

                               <activation-config-property-value>java:/jms/queue/batchQueue</activation-config-property-value>

                          </activation-config-property>

                          <activation-config-property>

                               <activation-config-property-name>maxSessions</activation-config-property-name>

                               <activation-config-property-value>2</activation-config-property-value>

                          </activation-config-property>

                </activation-config>

           </message-driven>

      </enterprise-beans>

       

       

      <assembly-descriptor>

              <p:pool>

                  <ejb-name>BatchProcessor</ejb-name>

                  <p:bean-instance-pool-ref>batchProcessor-pool</p:bean-instance-pool-ref>

              </p:pool>

      </assembly-descriptor>

      </jboss:ejb-jar>

       

       

      Pool & mdb Configuration in standalone.xml

                 <mdb>

                      <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>

                      <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

                  </mdb>

                 <pools>

                      <bean-instance-pools>

                          <!-- Automatically configure pools. Alternatively, max-pool-size can be set to a specific value -->

                          <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                          <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                          <strict-max-pool name="batchProcessor-pool" max-pool-size="2" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                          <strict-max-pool name="documentProcessor-pool" max-pool-size="10" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>

                      </bean-instance-pools>

                  </pools>

       

       

       

      Subsystem settings in standalone.xml for activemq

             <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">

                  <server name="default">

                      <security-setting name="#">

                          <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>

                      </security-setting>

                      <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"/>

                      <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>

                      <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">

                          <param name="batch-delay" value="50"/>

                      </http-connector>

                      <in-vm-connector name="in-vm" server-id="0"/>

                      <http-acceptor name="http-acceptor" http-listener="default"/>

                      <http-acceptor name="http-acceptor-throughput" http-listener="default">

                          <param name="batch-delay" value="50"/>

                          <param name="direct-deliver" value="false"/>

                      </http-acceptor>

                      <in-vm-acceptor name="in-vm" server-id="0"/>

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

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

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

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

                      <connection-factory name="InVmConnectionFactory" connectors="in-vm" entries="java:/ConnectionFactory"/>

                      <connection-factory name="RemoteConnectionFactory" connectors="http-connector" entries="java:jboss/exported/jms/RemoteConnectionFactory"/>

                      <pooled-connection-factory name="activemq-ra" transaction="xa" connectors="in-vm" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory"/>

                  </server>

              </subsystem>