Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.2
-
Fix Version/s: 2.0 ITR7, 2.1.0, 2.2.2 (EE only), 2.2.4 (EE only)
-
Component/s: Core: Configuration
-
Labels:None
-
User impact:Low
-
Affects Docs:Yes
-
Similar Issues:None
Description
It is simple to convert an asynchronous message flow to a synchronous one by setting the synchronous property of the endpoint to true. All flows from that endpoint onwards will be synchronous.
In order to convert a synchronous message flow into an asynchronous one, you need to either use remote-sync (imposing the overhead of keeping the event context around) or use a wiretap inbound router and wire tap the message to your asynchronous endpoint. Your original message flow remains as-is so this is not really a conversion of sync to async.
This is a funky solution to a simple problem. IMHO, Mule should support this pattern more explicitly, perhaps by just allowing to set the sync property of an endpoint to false and doing the right thing. Example of an API that can achieve this: the endpoint's synchronous property can be a java.lang.Boolean with three possible values: true - force synchronous from now on; false - force asynchronous; null - use whatever is the current mode (get it from the event).
The responses would be propagated by the remote-sync / sync endpoints and will be dropped if they reach async endpoint (a DEBUG or INFO log message would be good.)
Issue Links
- blocks
-
MULE-4617
JMSReplyToHandler tries to send to JMS endpoint synchronously (creating temp destination) rather than dispatching
-
- is blocked by
-
MULE-4620
MULE_REMOTE_SYNC_PROPERTY should not be used to determine outbound endpoint synchronicity
-
- relates to
-
MULE-3767
Review the need for remoteSync attribute
-
-
MULE-3759
Remove the synchronous param from the Router.route API methods
-
-
MULE-4608
Loanbroker example not working
-
-
MULE-3759
Remove the synchronous param from the Router.route API methods
-