Mule请求失败
我有一个全局http侦听器。我正在使用此侦听器进行所有API调用。当一个API调用由于json解析问题而失败时,等等?然后所有其他API调用也都失败了。失败的api调用或代码流不会在其他api调用中使用。在我们再次重新启动运行时(muleesb单机版)之前,所有后续的API请求都会失败 遵循我们已实施的全球例外战略Mule请求失败,mule,mule-esb,Mule,Mule Esb,我有一个全局http侦听器。我正在使用此侦听器进行所有API调用。当一个API调用由于json解析问题而失败时,等等?然后所有其他API调用也都失败了。失败的api调用或代码流不会在其他api调用中使用。在我们再次重新启动运行时(muleesb单机版)之前,所有后续的API请求都会失败 遵循我们已实施的全球例外战略 <choice-exception-strategy name="globalException"> <catch-exception-strat
<choice-exception-strategy name="globalException">
<catch-exception-strategy when="#[exception.causedBy(org.mule.module.http.internal.request.ResponseValidatorException) && message.inboundProperties.'http.status'==409]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "File Not Downloaded."}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.module.http.internal.request.ResponseValidatorException)]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "Your Search Did Not Fetch Anything!"}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(java.sql.SQLException)]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "Malformed Query "}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.api.transformer.TransformerException) && 501==flowVars.errorCode]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "File Not Downloaded. "}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.api.transformer.TransformerException) && 404==flowVars.errorCode]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "Unauthorized To Download "}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.api.transformer.TransformerException) && 401==flowVars.errorCode]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "Unauthorized Access "}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.api.MessagingException) && 127==flowVars.con_id]" doc:name="Catch Exception Strategy">
<set-payload value="{"error": "Did Not Fetch Anything!"}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy when="#[exception.causedBy(org.mule.api.MessagingException)]">
<set-payload value="{"error": "Invalid Credentials Cannot Proceed Further"}" doc:name="Set Payload"/>
</catch-exception-strategy>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<set-payload value="{"error": "#[exception.getMessage().replaceAll("\'","").replaceAll("\"","").replaceAll("\n","")]"}" doc:name="Set Payload"/>
</catch-exception-strategy>
</choice-exception-strategy>
我试图了解你的代码是如何运行的,你能回答这些问题吗
使用的异常策略是什么?如何解析JSON
是变压器还是数据编织?如果您使用的是Transformer,
您正在处理org.mule.api.transformer.*
异常吗
如果您使用的是Dataweave,您是否正在处理
'com.mulesoft.weave.*'
异常李>
您的代码是否处理默认的异常策略
现在您可以试试这个了。在API调用期间,您是否使用了任何成功状态验证代码?这应该在HTTP组件-->高级-->中配置,并放入200..599
<http:success-status-code-validator values="200..599"/>
Hi Kamal,感谢您的回复#1:我已经更新了这个问题,我们如何遵循异常策略实现和输入json解析#2:我们用变压器。是的,我们正在处理例外情况#3:我们没有使用dataweave#4:是的。我们可以。你能试试这个吗…在api调用期间,从200..500配置成功验证代码。好的,我们这里不使用HTTP请求。我们正在使用http侦听器,这些是带有POST的RESTAPI调用。我们看不到GET调用有任何问题。请澄清,您是说如果在/endpoint2上的api调用成功,那么对/endpoint1的调用失败,对/endpoint2的后续调用失败?您的HTTP侦听器设置如何?你看到的例外是什么?
<http:success-status-code-validator values="200..599"/>