Mule 3.3.0中的开始/停止流/端点 [英] Start/Stop Flow/Endpoint in Mule 3.3.0
本文介绍了Mule 3.3.0中的开始/停止流/端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要以编程方式启动或停止一个流程或另一个流程的终结点.能做到吗?有消息丢失的风险吗?
I need to programmatically start or stop a flow or endpoint from another flow. Can this be done? Is there risk of message loss?
<flow name="control>
<vm:inbound-endpoint path="in">
<script:component>
<!-- start/stop -->
</script:component>
</flow>
<flow name="startable-stoppable>
<any-transport:inbound-endpoint/>
<component/>
</flow>
推荐答案
经过研究,我发现最好的选择是启动/停止与要控制的端点关联的连接器.
After some research I've found that the best option in my case is to start/stop the connectors associated with the endpoints I want to control.
<script:component>
<script:script engine="groovy">
muleContext.getRegistry().lookupConnector('connectorName').start() // or stop()
</script:script>
</script:component>
此方法的缺点是与连接器关联的所有端点都将受到影响.如果出现问题,则每个端点都应具有自己的连接器.
A disadvantage of this approach is that all the endpoints associated with the connector will be affected. If this is a problem, every endpoint should have its own connector.
这篇关于Mule 3.3.0中的开始/停止流/端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文