【问题标题】:dynamic inbound endpoint no longer available?动态入站端点不再可用?
【发布时间】:2023-09-18 21:46:01
【问题描述】:

在 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

听起来他们不再让表达式评估器在创建入站之前处理“地址”。我的解释正确吗?

【问题讨论】:

    标签: dynamic mule endpoint inbound


    【解决方案1】:

    你是对的,3.3 不再支持这个。

    您可以使用&lt;poll&gt; 元素在流程的开头包装以下脚本:

    <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>
    

    【讨论】:

    • 感谢您快速而明确的回答。