I am trying to understand a use case for the request-reply scope when would this be preferred over request-response exchange pattern ?, especially if the underlying transport is JMS, I am guessing using the exchange pattern or the scope will do exactly the same things internally and functionally from a flow perspective.
There are a few hassles that crop up with using request-reply scope around maintaining the correlation id and replyTo properties details here and here , will the same challenges exist if one use a request-response exchange pattern ? (I am guess yes, can someone confirm please)
Basically when to use request-reply over the request-response exchange pattern
Updating my question to further probe into the behavior of request-reply scope.
To experiment use of request-reply scope in the first use case mentioned in the accepted answer.
Use Case 1
The endpoint itself does not support request-reponse and still you want to simulate synchronicity
I created a flow like below, I have tested this without the message property transformer too (same behavior)
The actual behviour is that the request waits for ever, even after the file is successfully written, the reply never comes into the outbound VM
My flow code is as below
<flow name="request-replyflowtest">
<http:listener config-ref="Orders_HTTP_Listener_Configuration" path="/rr" doc:name="request-reply-test"/>
<set-payload value="Hello world" doc:name="Set Payload"/>
<message-properties-transformer overwrite="true" doc:name="Message Properties" >
<add-message-property key="MULE_REPLYTO" value="vm://back"/>
<add-message-property key="MULE_CORRELATION_ID" value="#[java.util.UUID.randomUUID().toString()]"/>
</message-properties-transformer>
<request-reply doc:name="Request-Reply">
<file:outbound-endpoint path="C:\Users\sudarshan.sreenivasan\Desktop" outputPattern="hello.txt" responseTimeout="10000" doc:name="File"/>
<vm:inbound-endpoint exchange-pattern="one-way" path="back" doc:name="VM"/>
</request-reply>
<logger message="response not written out" level="INFO" doc:name="Logger"/>
<set-payload value="This is from a different flow" doc:name="Set Payload"/>
</flow>