【问题标题】:How can I get the processor to work asynchronously in inbound-endpoint in Mule?如何让处理器在 Mule 的入站端点中异步工作?
【发布时间】:2019-10-30 00:17:23
【问题描述】:

我是 Mule 的新手,我正在做一个公司项目。我在单个流中用 XML 定义了许多入站端点。我正在尝试让处理响应的处理器“scbProcessor”在入站端点中异步工作。

我试图将处理器包装在<async></async> 中,但它给出了错误:“发现以元素'async'开头的无效内容”。然后我尝试使它成为子流然后引用流,这给出了同样的错误。

代码:

    <flow name="scb-services">
            <composite-source doc:name="Composite Source inbounds">

                <https:inbound-endpoint exchange-pattern="request-response" host="${httpInbound.secure.host}"
                                        port="${httpInbound.secure.port}" doc:name="HTTPS QWE Service (Deprecated)"
                                        path="${httpInbound.qwe.contextRoot}/${auto.external.serviceName}"
                                        responseTimeout="${service.qwe.auto.timeout}" connector-ref="httpsConnector">
                    <mule-ss:http-security-filter realm="mule-realm"/>
                    <mule-ss:authorization-filter requiredAuthorities="PUBLIC"/>                        
                    <response>              
                        <set-variable variableName="outgoingFromESBToClientDate"
                                      value="#[new org.mule.el.datetime.DateTime()]"
                                      doc:name="Register Outgoing date from ESB to Client"/>
                        <processor ref="scbProcessor" doc:name="SCB Logging Processor"/>
                    </response>
                </https:inbound-endpoint>
                .
                .
            </composite-source>
    </flow>
.
.

【问题讨论】:

    标签: asynchronous mule


    【解决方案1】:

    您可以将exchange-pattern="request-response" 更改为exchange-pattern="one-way" 以异步发送消息。可以在官方文档中看到:https://docs.mulesoft.com/mule-runtime/3.6/http-transport-reference

    或者,您可以在两者之间使用队列。收到消息后立即发送到队列,然后从队列中读取后处理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-15
      • 1970-01-01
      • 1970-01-01
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      相关资源
      最近更新 更多