Search code examples
requestjmsmulereply

Is it possible to Print/Logs Mule Reply or Reponse in Request-Reply block?


I would like to print or logs contents of response that is sent to reply queue. I've a two queues (Request and Reply) in my mule Request-Reply block. I can't use Logger in or out side of Request-Reply block because it throws compilation error like "Invalid content was found starting with element 'logger'. No child element is expected at this point".

<request-reply >
    <jms:outbound-endpoint queue="StudioIN" connector-ref="Active_MQ1"  exchange-pattern="one-way"/>
    <jms:inbound-endpoint queue="StudioOUT" connector-ref="Active_MQ1" exchange-pattern="one-way"/>
    <logger message="Reply messages/response: #[payload]" level="INFO" doc:name="Logger"/>
</request-reply>

Is there any way to print contents of reply messages. It would be great if someone can provide example of this.


Solution

  • Try the following and it should work.

    <request-reply >
       <jms:outbound-endpoint queue="StudioIN" connector-ref="Active_MQ1"  exchange-pattern="one-way"/>
       <jms:inbound-endpoint queue="StudioOUT" connector-ref="Active_MQ1" exchange-pattern="one-way">
         <logger message="Reply messages/response: #[payload]" level="INFO" doc:name="Logger"/>
       </jms:inbound-endpoint>
    </request-reply>
    

    Hope this helps.