7 Replies Latest reply on Oct 9, 2017 5:03 AM by kpreeta12

    HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity

    kpreeta12

      DefaultMessageListenerContainer stops consuming after inactivity- Spring Forum

       

      Our customer has the above issue and it results in consumer count of one of the queues to be always "0".

       

      How do we fix this? Can the attribute maxInactivityDuration be added to Messaging subsystem of domain.xml to solve this issue ?

       

      Based on the link for now I have added it as JndiProviderUrl=http-remoting://10.76.82.120:6080?wireFormat.maxInactivityDuration=10000 in the JMS lookup.

       

      One more concern is this issue when it happens the consumer is kind of blocked. Not sure if the above setting in JMS lookup followed by restarting the application server would bring the state back to active and will consumer count become more than 0.

       

      Thanks,

      Preeta

        • 1. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
          mnovak

          Hi Preeta,

           

          is customer using ActiveMQ 5.x or HornetQ for messaging? Those are 2 different projects. Could you provide your configuration of WF 8?

           

          Thanks,

          Mirek

          • 2. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
            kpreeta12

            Hi Mirek

             

            Attached please find the standalone-full.xml of the customer's application. They are using Hornetq that comes with wildfly 8.2 and not ActiveMQ.

             

            Thanks,

            Preeta

            • 3. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
              kpreeta12

              The exception is as below:-

               

              00:30:08,330 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (Camel (BEEEcamelAgent) thread #289 - JmsConsumer[BEEEInboundQueue]) Execution of JMS message listener failed, and no ErrorHandler has been set.: javax.jms.IllegalStateException: Session is closed

                  at org.hornetq.jms.client.HornetQSession.checkClosed(HornetQSession.java:1221) [hornetq-jms-client-2.4.7.Final.jar:]

                  at org.hornetq.jms.client.HornetQSession.getTransacted(HornetQSession.java:193) [hornetq-jms-client-2.4.7.Final.jar:]

                  at org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:572) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:481) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948) [org.springframework.jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]

                  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

               

              -preeta

              • 4. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
                mnovak

                Configuration of messaging subsystem looks ok. I have no experience with Spring but for sure something closed connection or session which is used by AbstractMessageListenerContainer. Do you see some other errors or warning before:

                 

                00:30:08,330 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (Camel (BEEEcamelAgent) thread #289 - JmsConsumer[BEEEInboundQueue]) Execution of JMS message listener failed, and no ErrorHandler has been set.: javax.jms.IllegalStateException: Session is closed

                • 5. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
                  kpreeta12

                  Here is our exception  before it throws the javax.jms.IllegalStateException

                  8:29:22,005 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (Camel (BEEEcamelAgent) thread #113 - JmsConsumer[BEEEInboundQueue]) Setup of JMS message listener invoker failed for destination 'BEEEInboundQueue' - trying to recover. Cause: readerIndex(22) + length(2303068) exceeds writerIndex(307217): UnpooledHeapByteBuf(ridx: 22, widx: 307217, cap: 307217)

                   

                   

                   

                  Also one more thing is from our past experience whenever the consumer count becomes 0 or more than 5 (5 is what we have configured), we are helpless. The only solution we find to make it work is installing our application on a different VM. The current VM stores some JMS statistics it seems somewhere outside installation directory in the file system. We are not sure where it stores but on moving to a brand new VM everything works and consumer count becomes 5 which is expected value.

                   

                  -preeta

                  • 6. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
                    mnovak

                    Could you share the whole log?

                     

                    Cause: readerIndex(22) + length(2303068) exceeds writerIndex(307217): UnpooledHeapByteBuf(ridx: 22, widx: 307217, cap: 307217) is not a good sign. It seems that there is environmental issue but without stacktrace is hard to move further. There might be 3rd party tool/application spamming HornetQ by "unknown" packets or something else.

                    • 7. Re: HornetQ: JMS on Wildfly 8.2  DefaultMessageListenerContainer stops consuming after inactivity
                      kpreeta12

                      Attached please find the complete logs.

                       

                      Thanks,

                      Preeta