Thursday, July 23, 2015

Message processor runs infinitely without dequing messages - WSO2 ESB

This issue appeared when working with ESB message processors, I had configured the message processor to listen to a ActiveMQ queue which already had messages. I was using ESB 4.9

Issue

Here I face a issue where the Message processor keeps on sending the messages infinitely. The following errors were observed.

ERROR - ForwardingService BlockingMessageSender of message processor [InMEn_Proc2] failed to send message to the endpoint
[2015-07-21 21:55:38,062]  WARN - ForwardingService Failed to send the message through the fault sequence. Sequence name does not Exist.

The reason.

The reason for this issue is the ESB is following the guaranteed delivery precautions, ESB is waiting till the message delivered successfully.

How to get this fixed

The easiest way to fix this is make the ESB ignore the message after sending the message out. You can do this by setting the following properties.

<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" />
<property name="OUT_ONLY" value="true" />

You need to add these properties before storing the message in the store. Refer the following sample API.


<api xmlns="http://ws.apache.org/ns/synapse" name="api" context="/api">
   <resource methods="POST GET">
      <inSequence>
         <log level="custom">
            <property name="VALUE" value="********* IN GET RESOURCE *********"/>
         </log>
         <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
         <property name="OUT_ONLY" value="true"/>
         <store messageStore="ActivMQ_Store2"/>
         <send>
            <endpoint key="POSTEP"/>
         </send>
      </inSequence>
   </resource>
</api>


No comments:

Post a Comment