简体   繁体   English

重定向失败的消息时双向接收端口超时

[英]Timeout in two-way receive port when redirecting failed messages

I've a two-way WCF receive port, where i've checked both: 我有一个双向WCF接收端口,在此我都检查了两个端口:

1) Route failed messages 1)路由失败的消息

2) Suspend request message on failure 2)失败时挂起请求消息

This configuration is needed to redirect failed messages to our "exception portal". 需要此配置才能将失败的消息重定向到我们的“例外门户”。

When a message is received and it fails validation in XMLReceive pipeline, the message is redirected to our "exception portal" as expected. 当收到一条消息,并且在XMLReceive管道中验证失败时,该消息将按预期重定向到我们的“异常门户”。

The problem is however that the consumer of the WCF service never get's a fault, so the Connection gets a timeout after a while, which is very confusing for the consumer. 但是,问题在于WCF服务的使用者永远不会出错,因此Connection会在一段时间后超时,这对于使用者来说非常令人困惑。

Is there anyway to fix this problem? 反正有解决此问题的方法吗? Am I missing something? 我想念什么吗?

What's happening currently is that the message fails on the Receive pipeline, gets routed to your portal, but no response gets routed back. 当前发生的情况是消息在接收管道上失败,被路由到您的门户,但是没有响应被路由回。 You have to make sure to send a message back. 您必须确保发回邮件。 You could do that by: 您可以通过以下方式做到这一点:

  • creating an Orchestration that does the validation (instead of doing it on the pipeline), and making sure to send a response int he orchestration as well as routing failures to your portal 创建一个进行验证的业务流程(而不是在管道上进行),并确保在业务流程中发送响应以及将失败路由到您的门户
  • creating a custom component that validates the message (perhaps by calling the XML Validation pipeline in a try block and catching the exception without rethrowing it); 创建一个用于验证消息的自定义组件(可能通过在try块中调用XML验证管道并捕获异常而不将其重新抛出); on error it sends the message to your portal, and replaces pInMsg with something sensible to send back to the partner. 如果出错,它将消息发送到您的门户,并用明智的方式替换pInMsg并发回给合作伙伴。
  • having your portal receive location be a request response port (perhaps, again, with an orchestration behind it), and route the response back to the WCF two way port. 让您的门户接收位置是请求响应端口(也许再后面是业务流程),然后将响应路由回WCF双向端口。 This way is more involved, and to be honest I'm not entirely sure what a working implementation would look like here, but it may be possible. 这种方法涉及更多,并且说实话,我不确定在这里可以正常工作的实现是什么样子,但可能是可行的。

If it were up to me, I'd go for the Orchestration. 如果要由我决定,我会去参加编排。 You can certainly call the XML Validator pipeline from an orchestration, or you could use other validation logic in there (for example calling BRE). 您当然可以从业务流程中调用XML验证程序管道,也可以在其中使用其他验证逻辑(例如,调用BRE)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM