0 Replies Latest reply on Dec 19, 2017 4:48 AM by Rajendra Mallampati

    Wildfly/HornetQ dropping messages

    Rajendra Mallampati Newbie

      Hello,

       

      We use Wildfly for hosting a WebApplication where users can login and start using the application. It also has a batch processing component where the users upload a file with a number of lines of data for processing. We use JMS that comes up Wildfly for processing the files. One thread reads the lines from the file and publishes a message for each line to a Queue. The queue itself is a persistent Queue. On the consuming side, we use Listener objects created using Spring for processing these messages. Randomly, all of the messages published are not delivered to the consumers.

       

      Here is the JBOSS Messaging subsystem configuration:

       

      <subsystem xmlns="urn:jboss:domain:messaging:3.0">

                  <hornetq-server>

                      <persistence-enabled>true</persistence-enabled>

                      <journal-type>NIO</journal-type>

                      <journal-min-files>2</journal-min-files>

       

       

                      <connectors>

                          <netty-connector name="netty" socket-binding="messaging"/>

                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

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

                          </netty-connector>

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

                      </connectors>

       

       

                      <acceptors>

                          <netty-acceptor name="netty" socket-binding="messaging"/>

                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

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

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

                          </netty-acceptor>

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

                      </acceptors>

       

       

                      <security-settings>

                          <security-setting match="#">

                              <permission type="send" roles="guest"/>

                              <permission type="consume" roles="guest"/>

                              <permission type="createNonDurableQueue" roles="guest"/>

                              <permission type="deleteNonDurableQueue" roles="guest"/>

                          </security-setting>

                      </security-settings>

       

       

                      <address-settings>

                          <address-setting match="#">

                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                              <redelivery-delay>0</redelivery-delay>

                              <max-size-bytes>10485760</max-size-bytes>

                              <page-size-bytes>2097152</page-size-bytes>

                              <address-full-policy>PAGE</address-full-policy>

                              <message-counter-history-day-limit>10</message-counter-history-day-limit>

                          </address-setting>

                      </address-settings>

       

       

                      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

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

                              </entries>

                          </connection-factory>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                          </connection-factory>

                          <pooled-connection-factory name="hornetq-ra">

                              <transaction mode="xa"/>

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

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

                              </entries>

                          </pooled-connection-factory>

                      </jms-connection-factories>

       

       

                      <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="ControlQueue">

                              <entry name="queue/ControlQueue"/>

                          </jms-queue>

                          <jms-queue name="ProcessQueue">

                              <entry name="queue/ProcessQueue"/>

                          </jms-queue>

                          <jms-queue name="SigningQueue">

                              <entry name="queue/SigningQueue"/>

                          </jms-queue>

                          <jms-queue name="SigningRecoveryQueue">

                              <entry name="queue/SigningRecoveryQueue"/>

                          </jms-queue>

                      </jms-destinations>

                  </hornetq-server>

              </subsystem>

       

      Here is the IO subsystem configuration:

              <subsystem xmlns="urn:jboss:domain:io:1.1">

                  <worker name="default" io-threads="8" task-max-threads="50"/>

                  <buffer-pool name="default"/>

              </subsystem>

       

      Here is the Spring listener configuration:

       

      <bean id="XXXMessageListener"  class="XXXMessageListener">

              <property name="manager" ref="importManager"/>

              <property name="sender" ref="messagePublisher"/>

              <property name="formService" ref="entityInit"/>

              <property name="validateService" ref="entityValidator"/>

              <property name="dmrService" ref="importEntityService"/>

          </bean>

       

      <bean id="jmsContainer"  class="org.springframework.jms.listener.DefaultMessageListenerContainer">

              <property name="connectionFactory" ref="recConnectionFactory"/>

              <!-- this is the queue we will listen on -->

              <property name="destination" ref="entityQueue" />

              <property name="messageListener" ref="XXXMessageListener"/>

              <property name="concurrentConsumers" value="50"/>

              <property name="maxConcurrentConsumers" value="75"/>

              <property name="sessionTransacted" value="false"/>

          </bean>

       

      As said earlier, some of the messages published are not delivered to the listeners and it happens randomly. Any ideas or input is highly appreciated.

       

      Thanks

      Rajendra