【发布时间】:2014-02-01 15:31:00
【问题描述】:
我有作为入站端点的流,我有 VM 队列。现在我想运行进程:
- VM 入站端点收到消息并开始长时间运行的处理流程
- 在 VM 入站端点上会出现另一条消息(例如 10 条消息),这些消息将启动另一个长时间运行的进程,但 VM 会将消息保留在队列中,直到第一个消息完成
- VM 队列上的每条消息都有超时从队列中删除此时间之后
如何在 MuleESB 中做到这一点?
【问题讨论】:
标签: mule mule-studio
我有作为入站端点的流,我有 VM 队列。现在我想运行进程:
如何在 MuleESB 中做到这一点?
【问题讨论】:
标签: mule mule-studio
如果是异步流,您可以使用处理策略来限制运行特定流的线程数。
<queued-asynchronous-processing-strategy name="allowOneThread" maxThreads="1"/>
<flow name="OnlyOneAtTheTime" processingStrategy="allowOneThread">
<vm:inbound-endpoint path="requestQueue" exchange-pattern="one-way" />
<logger level="ERROR" message="Before sleep : #[payload]"/>
<!-- Simulate long running processor -->
<component class="Sleep" />
<logger level="ERROR" message="After sleep : #[payload]"/>
<vm:outbound-endpoint path="responseQueue"/>
</flow>
【讨论】: