0

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.

Ale Sequeira
  • 2,039
  • 1
  • 11
  • 19
Neel
  • 303
  • 1
  • 4
  • 15

2 Answers2

0

You can keep logger after <request-reply > to log the response/reply message like the following :-

<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"/>
</request-reply>
<logger message="Reply messages/response: #[payload]" level="INFO" doc:name="Logger"/>

Please check the following for your reference :- https://github.com/daveEason/mule-demo-synch-asynch-pattern/blob/master/src/main/app/mule-config.xml

Anirban Sen Chowdhary
  • 8,233
  • 6
  • 39
  • 81
0

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.

user1760178
  • 6,277
  • 5
  • 27
  • 57