Mule ESB:如何将 Until Successful Scope 应用于 Jersey Resources?
Mule ESB: How to apply Until Successful Scope to Jersey Resources?
假设,我们的应用程序中只有一个资源:HelloWorldResource
Mule 流配置如下所示:
<http:listener-config doc:name="HTTP Listener Configuration" host="0.0.0.0" name="HTTP_Listener_Configuration" port="9988"/>
<flow name="HelloWorldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/*"/>
<jersey:resources>
<component class="acme.HelloWorldResource">
</component>
</jersey:resources>
</flow>
我现在的问题是:
是否可以为 Jersey 资源申请 Until Successful Scope?
我到底想达到什么目的:
以防万一,当 Jersey 资源端点失败时——我希望 Mule 重试调用。
我尝试进行以下更改:
<until-successful
maxRetries="2"
millisBetweenRetries="100"
objectStore-ref="objectStoreUntilSuccessful"
failureExpression="#[message.inboundProperties['http.status'] != 200]">
<flow name="HelloWorldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/*"/>
<jersey:resources>
<component class="acme.HelloWorldResource">
</component>
</jersey:resources>
</flow>
</until-successful>
但是,我的更改只是导致服务器启动期间出现异常:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'until-successful'
您已将 until-successful 放在流程之外,它需要在流程内部并且就在 jersey:resources 元素周围
假设,我们的应用程序中只有一个资源:HelloWorldResource
Mule 流配置如下所示:
<http:listener-config doc:name="HTTP Listener Configuration" host="0.0.0.0" name="HTTP_Listener_Configuration" port="9988"/>
<flow name="HelloWorldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/*"/>
<jersey:resources>
<component class="acme.HelloWorldResource">
</component>
</jersey:resources>
</flow>
我现在的问题是:
是否可以为 Jersey 资源申请 Until Successful Scope?
我到底想达到什么目的: 以防万一,当 Jersey 资源端点失败时——我希望 Mule 重试调用。
我尝试进行以下更改:
<until-successful
maxRetries="2"
millisBetweenRetries="100"
objectStore-ref="objectStoreUntilSuccessful"
failureExpression="#[message.inboundProperties['http.status'] != 200]">
<flow name="HelloWorldFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/*"/>
<jersey:resources>
<component class="acme.HelloWorldResource">
</component>
</jersey:resources>
</flow>
</until-successful>
但是,我的更改只是导致服务器启动期间出现异常:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'until-successful'
您已将 until-successful 放在流程之外,它需要在流程内部并且就在 jersey:resources 元素周围