消息传递方案的ESB异常 [英] ESB Exception on Messaging scenario

查看:95
本文介绍了消息传递方案的ESB异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在消息传递方案中实现ESB异常服务的有效方法是什么?


谢谢,Raja

What is the efficient way to implement ESB Exception services on messaging scenario?


Thanks, Raja

推荐答案

Raja,

Raja,

我的建议是通过Orchestration捕获异常来路由失败的消息

My suggestion would be to route the failed messages by catching the exception through an Orchestration

为了使用ESB异常处理框架,你需要引用几个dll。在Orchestration项目中添加对以下dll的引用。

In order to use the ESB exception handling framework you need to reference couple of dlls. Add Reference to the following dlls inside your Orchestration project.

1)C:\Program Files \ Microsoft Microsoft BizTalk ESB Toolkit 2.0 \Bin\Microsoft.Practices.ESB.ExceptionHandling。 dll

1) C:\Program Files\Microsoft BizTalk ESB Toolkit 2.0\Bin\Microsoft.Practices.ESB.ExceptionHandling.dll

2)C:\Program Files \ Microsoft BizTalk ESB Toolkit 2.0 \Bin\Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.dll

2) C:\Program Files\Microsoft BizTalk ESB Toolkit 2.0\Bin\Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.dll

然后

声明一个新的Orchestration消息(例如:MSG_FAULT)并将MessageType设置为Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage,您可以在"从参考装配中选择"下找到。选项。

Declare a new Orchestration message (ex: MSG_FAULT) and set the MessageType to Microsoft.Practices.ESB.ExceptionHandling.Schemas.Faults.FaultMessage, which you can find under the "Select from Referenced Assembly.." option.

在您的异常处理块内部构造故障消息(在步骤2中创建的消息),其中包含所需的相关信息。代码看起来像

Inside your Exception handling block construct the fault message (the one created in step 2) with relevant information required. The code will look like



  1: // Create Fault Exception Message


  2: MSG_FAULT = Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.CreateFaultMessage(); 


  3:  


  4: //Assign some properties


  5: MSG_FAULT.FailureCategory = "Some User Category";


  6: MSG_FAULT.FaultDescription = ex.Message;


  7: MSG_FAULT.FaultCode = "3002002"


  8: MSG_FAULT.FaultSeverity =


  9: Microsoft.Practices.ESB.ExceptionHandling.FaultSeverity.Severe; 


 10:  


 11: //Add request message (any other message if present)


 12: Microsoft.Practices.ESB.ExceptionHandling.ExceptionMgmt.AddMessage(MSG_FAULT,MSG_EMP_REQUEST);


这篇关于消息传递方案的ESB异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆