Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a private flow using flow-ref or using vm endpoints request-response?

Tags:

mule

What is the difference between using a private flow using flow-ref to refernce another flow or using vm endpoints in request-response style?

They both get their own processing, threading and exception strategy? Is there a benefit or rule when to use one over the other?

like image 940
jon lee Avatar asked Dec 07 '22 07:12

jon lee


2 Answers

From Mule In Action 2nd ed: Before Mule3, a lot of VM endpoints were used to tie services together. But since Mule 3, another option for sharing flows is available called private flows.

Private flows are another type of reusable flows, much similar to sub-flows but with a very different behavior in term of threading and exception handling. The primary reason for using a private flow instead of a sub-flow is to define in it a different exception strategy than from the calling flow (something that is impossible with a sub-flow).

When a sub-flow is invoked the execution behaves as if the message processors of the sub-flow were actually located in the calling flow. With a private flow, the execution behaves as if a message was passed from the calling flow to the private flow. This decoupling allows defining processing and error handling strategies that are local to the private flow.

I think private-flow is new approach to handle request-response without using vm end-point and provides re-usability of sub-flow with add-on of exception-handling and processing-strategy

like image 192
Charu Khurana Avatar answered Apr 28 '23 23:04

Charu Khurana


The main differences are:

  • Property propagation must be dealt with when using a VM endpoint: you have to take care of copying properties from inbound to outbound scopes if you want them to be available on the other side of the VM endpoint.
  • The thread pool of the VM connector is used for a VM endpoint while it's either a global one used with the flow default processing strategy or a custom defined one.
like image 43
David Dossot Avatar answered Apr 28 '23 21:04

David Dossot