是否可以阻止接收管道将消息发布到消息框。
我开发了一个管道组件来检查输入消息的有效性。我想添加代码以在验证失败时停止将消息发布到消息框。
简而言之,如果输入文件未通过验证,则它不应调用任何编排或发送端口。另外,我还必须发送一封邮件,发布接收管道中的错误详细信息。
谢谢。
Is it possible to stop a receive pipeline from publishing a message to messagebox.
I've developed a pipeline component to check validity of the input message. I want to add code to stop the message getting published to messagebox if validation fails.
Simply to say if the input file fails the validation it should not invoke any orchestration or sendport. Also I've to send a mail publishing the details of the error from receive pipeline.
Thanks.
发布评论
评论(1)
实现目标并获得更加动态和灵活的解决方案的一种方法是利用 消息路由失败。
当消息验证失败时,在管道中的验证代码中,您可以从 ErrorReport 命名空间添加一些合适的属性(例如描述和失败代码)。
然后,您可以让现有的编排和发送端口仅订阅没有失败代码的消息。最后,您将创建一个使用现有失败代码订阅消息的编排,并从该编排发送电子邮件。
One way to achieve your goal and to get a more dynamic and flexible solution is to utilize Failed Message Routing.
Within you validation code in your pipeline you can then add some suitable properties from the ErrorReport namespace (say for example a description and an failure code) when a validation of a message fails.
You can then have your existing orchestrations and send ports only subscribe to messages that don't have a failure code. Finally you'll create an orchestration that subscribes to messages with an existing failure code and send your email from that orchestration.