Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mule 2.0 and infinite loops

 
Sander Evanfield
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using mule 2.0, need to handle poison message for a jms endpoint. Mule goes to infinite loop

My configuration files are:

jms:endpoint name="someChannel" queue="${some.q}" connector-ref="EMSConnector"
synchronous="true">

jms:connector name="EMSConnector" acknowledgementMode="DUPS_OK_ACKNOWLEDGE" durable="false"
noLocal="true" persistentDelivery="true" maxRedelivery="3" cacheJmsSessions="true" eagerConsumer="false"
specification="1.1" connectionFactory-ref="EMSConnectionFactory" username="${ems.usr.name}" password="${ems.usr.passwd}"
redeliveryHandlerFactory-ref="RedeliveryHandlerFactory" createMultipleTransactedReceivers="false"
numberOfConcurrentTransactedReceivers="1">
<spring:property name="exceptionListener" ref="OMSExceptionStrategy"/>
</jms:connector>

<spring:bean name="RedeliveryHandlerFactory" class="org.mule.transport.jms.CountingRedeliveryHandlerFactory" />

spring:bean name="EMSConnectionFactory" class="com.tibco.tibjms.TibjmsQueueConnectionFactory">
<spring:constructor-arg value="${ems.host.name}" />
</spring:bean>

How can I redesign this to handle a poison message and prevent infinite loop.

 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maxRedelivery="2" ??
 
Sander Evanfield
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate on why reMaxDelivery = 2 works instead of any finite number (in my case 3)
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, I did not realized you have defined it already, nothing special about 2, I just picked it randomly.But did it work by changing value to 2?
if not then I would suggest to inspect redelivery count property of message, it should increment everytime the message is put back to queue, is it incrementing?

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic