Message publisher stops when sending messages to HornetQ in JBoss EAP

Solution Unverified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.2
    • 6
  • HornetQ

Issue

  • When sending messages to a JMS destination the message producer hangs. The address settings in hornetq-configuration.xml are as follows:
<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>
      <message-counter-history-day-limit>10</message-counter-history-day-limit>
      <address-full-policy>BLOCK</address-full-policy>
   </address-setting>
</address-settings>
  • This is what I see on the client when I take a thread dump:
java.lang.Thread.State: WAITING (parking)  
at sun.misc.Unsafe.$$YJP$$park(Native Method)  
- parking to wait for &lt;0x18ea1e50&gt; (a java.util.concurrent.Semaphore$NonfairSync)  
at sun.misc.Unsafe.park(Unsafe.java)  
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)  
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)  
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905)  
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217)  
at java.util.concurrent.Semaphore.acquire(Semaphore.java:441)  
at org.hornetq.core.client.impl.ClientProducerCreditsImpl.acquireCredits(ClientProducerCreditsImpl.java:74)  
at org.hornetq.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:305)  
at org.hornetq.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:142)  
at org.hornetq.jms.client.HornetQMessageProducer.doSend(HornetQMessageProducer.java:451)  
at org.hornetq.jms.client.HornetQMessageProducer.send(HornetQMessageProducer.java:210)  
at org.hornetq.jms.client.HornetQMessageProducer.publish(HornetQMessageProducer.java:268)  
at ...
- locked &lt;0x18b47e88&gt; (a java.lang.Object)  

Resolution

  • Once a destination becomes "full" according to the configured <max-size-bytes> the subsequent behavior is governed by the <address-full-policy>. In this case, since the <address-full-policy> is BLOCK then producers will block when they attempt to acquire more "credits" from the server to send messages. Read more about the available options here from the Content from docs.jboss.org is not included.HornetQ docs
Components
Category

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.