How to enable paging in HornetQ in JBoss EAP / SOA-P ?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.1.2
    • 5.2
    • 6.x

Issue

  • How do I enable paging in HornetQ?

  • Many ESB threads blocked trying to send messages to SOA-P 5.3.1 instance

Resolution

JBoss-EAP-5.1.2 and JBoss-EAP-5.2
Configure paging in the $JBOSS_HOME/server/$PROFILE/deploy/hornetq/hornetq-configuration.xml via the address-setting configuration.

JBoss-EAP-6
Please configure paging in standalone-$PROFILE.xml file or domain.xml

Here's a sample configuration :

    ...
   <address-settings>
      ...
      <address-setting match="jms.queue.exampleQueue">
         <!-- enable paging -->
        <max-size-bytes>10485760</max-size-bytes>
         <page-size-bytes>2097152</page-size-bytes>
         <address-full-policy>PAGE</address-full-policy>
      </address-setting>
   </address-settings>

max-size-bytes
What's the max memory the address could have before entering on page mode, -1 would disable and host all messages in memory.
page-size-bytes
The size of each page file used on the paging system. The default value is 10 megabytes.
address-full-policy
This must be set to PAGE for paging to enable. If the value is PAGE then further messages will be paged to disk. If the value is DROP then further messages will be silently dropped. If the value is FAIL then the messages will be dropped and the client message producers will receive an exception. If the value is BLOCK then client message producers will block when they try and send further messages.

Note : the max-size-bytes must be larger than the page-size-bytes otherwise you will get an exception when starting up the server and the destination(s) will not be available.

Diagnostic Steps

  • Capture a Java Thread dump at the time of the problem

There are many HornetQ threads in TIMED_WAIT state eg:

"Thread-72" prio=10 tid=0x0000000024778800 nid=0x5cf0 in Object.wait() [0x00007fb6f8b23000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000007233e6da8> (a org.hornetq.core.client.impl.ClientConsumerImpl)
        at org.hornetq.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:254)
        - locked <0x00000007233e6da8> (a org.hornetq.core.client.impl.ClientConsumerImpl)
        at org.hornetq.core.client.impl.ClientConsumerImpl.receive(ClientConsumerImpl.java:391)
        at org.hornetq.jms.client.HornetQMessageConsumer.getMessage(HornetQMessageConsumer.java:225)
        at org.hornetq.jms.client.HornetQMessageConsumer.receive(HornetQMessageConsumer.java:134)
        at org.jboss.internal.soa.esb.rosetta.pooling.WrappedMessageConsumer.receive(WrappedMessageConsumer.java:144)
        at org.jboss.internal.soa.esb.couriers.JmsCourier.internalPickupPayload(JmsCourier.java:516)
        - locked <0x0000000723ba5a10> (a org.jboss.internal.soa.esb.couriers.JmsCourier)
        at org.jboss.internal.soa.esb.couriers.JmsCourier.pickupPayload(JmsCourier.java:477)
        at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:470)
        at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:228)
        at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:204)
        at org.jboss.soa.esb.listeners.message.MessageAwareListener.waitForEventAndProcess(MessageAwareListener.java:311)
        at org.jboss.soa.esb.listeners.message.MessageAwareListener.doRun(MessageAwareListener.java:267)
        at org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115)
        at java.lang.Thread.run(Thread.java:701)

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments