1 Reply Latest reply on Mar 21, 2012 6:24 AM by Veit Guna

    Error resending received Message to another queue

    Veit Guna Newbie



      I'm using JBoss 7.1.0 final together with the shipped HornetQ for messaging.


      My MDB receives a message and sends this message to a temporary error queue when such occurs where it is "parked".

      After an interval, I manually receive this messages from the queue with a consumer via message selector. After that I want

      to put this message to its origin destination. That seems to work. But when onMessage on the receiving MDB should be invoked (I guess),

      HornetQ runs in an endlees loop printing:


      19:40:24,668 ERROR [org.hornetq.ra.inflow.HornetQMessageHandler] (Thread-0 (HornetQ-client-global-threads-2055205546)) Failed to deliver message: java.lang.IndexOutOfBoundsException

          at org.jboss.netty.buffer.AbstractChannelBuffer.readByte(AbstractChannelBuffer.java:236)

          at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readByte(ChannelBufferWrapper.java:337)

          at org.hornetq.utils.TypedProperties.decode(TypedProperties.java:459)

          at org.hornetq.jms.client.HornetQMapMessage.doBeforeReceive(HornetQMapMessage.java:439)

          at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:269)

          at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:983)

          at org.hornetq.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:48)

          at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1113)

          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_27]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_27]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]



      A server restart won't help since it immediately starts printing these lines again. Manually deleting the messagingjournal get things going again.

      Any ideas what that might cause?




        • 1. Re: Error resending received Message to another queue
          Veit Guna Newbie

          Ok, digged deeper into the problem and found the cause. As the stacktrace indicates, it's a problem with the MapMessage. Indeed I'm using a MapMessage while pushing it from one queue to another.

          But the point is, it seems to be a problem when it's empty:


          1) Sending the message via producer to queue A works.

          2) Moving the message via MDB on queue A to queue B works.

          3) Moving the message via consumer receive (with selector) from B to A again produces the previous mentioned Exception.


          Since it was a programming error on my side that the MapMessage wasn't filled, but I think someone might want to take a look at this?