Looping inOut messages on activemq get stuck

Solution Verified - Updated -

Issue

  • We have a number of routes that send messages via AMQ. In some cases a route may be used twice in the chain. When the message is sent to the queue the second time it appears to be allocated to the same consumer that sent the message resulting in a stuck message.
   <route id="loop">
      <from uri="activemq:inbox?destination.consumer.prefetchSize=1"/>
      <filter>
        <simple>${header.count} == null</simple>
        <setHeader headerName="count">
          <constant>0</constant>
        </setHeader>
      </filter>
      <setHeader headerName="count">
        <ognl>request.headers.count + 1</ognl>
      </setHeader>
      <filter>
        <simple>${header.count} >= 3</simple>
        <log message="message looped 3 times"/>
        <stop/>
      </filter>
      <inOut uri="activemq:inbox"/>
    </route>

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content