Mule 3: Controlling whether a flow is allowed to be executed

我们两清 提交于 2019-11-30 09:58:16

Use a global property and a few MEL expressions to make this happen:

<global-property name="gate_open" value="true" />

<flow name="gated-flow">
    <vm:inbound-endpoint path="gated.in" />
    <expression-filter expression="#[app.registry.gate_open]" />
    ...
</flow>


<flow name="gate-controller">
    <vm:inbound-endpoint path="gate.in"  />
    <expression-component>
      app.registry.gate_open = false
    </expression-component>
</flow>

Sending any message to vm://gate.in will close the gate and gated-flow will stop processing the messages it receives.

You can use any protocol you want instead of VM.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!