在 Mule 2 中,我们过去能够使用以下方法创建动态入站端点:
<quartz:endpoint-polling-job>
<quartz:job-endpoint
address="jms://retry.queue?selector=JMSTimestamp%3C%3D%23[System.currentTimeMillis() - 30000]" />
</quartz:endpoint-polling-job>
在 Mule 3 中,我们收到一个错误:
The endpoint "jms://retry.queue?selector=JMSTimestamp<=#[System.currentTimeMillis()
- 30000]" is malformed and cannot be parsed... Only Outbound endpoints can be dynamic
听起来他们不再让表达式求值器在创建入站之前处理“地址”。我的解释正确吗?
最佳答案
你是对的,3.3 中不再支持此功能。
您可以使用 <poll>
元素将以下脚本包装在流程的开头:
<scripting:component>
<scripting:script engine="groovy">
muleContext.client.request('jms://retry.queue?selector=JMSTimestamp%3C%3D'+(System.currentTimeMillis() - 30000), eventContext.timeout)
</scripting:script>
</scripting:component>
关于动态入站端点不再可用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17112587/