1. Overview
The exception handling mechanism is very important for capturing exceptions and data backtracking. aeai ESB provides you with a process exception capturing mechanism that allows you to easily implement exception handling.
2. Example 2. 1. Main exception handling process 2.1.1. Create an HTTP Process
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4D/0E/wKiom1RKBcSj8VYOAAGN8ivo9FY398.jpg "Title =" a.png "alt =" wkiom1rkbcsj8vyoaagn8ivo9fy398.jpg "/>
2.1.2. Overall Flowchart
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4D/0F/wKioL1RKBj7Q82DYAABEVF0lv-0192.jpg "Title =" B .png "alt =" wKioL1RKBj7Q82DYAABEVF0lv-0192.jpg "/>
2.1.3. Throwing an exception component
Packagecom. aeai. Video. messageflows. exceptionhandlehttp;
Import com. agileai. ESB. Core. adapteexception;
Importcom. agileai. ESB. component. transformer. javatransformer;
Public class javaconverter1 extendsjavatransformer {
Publicvoid handlerequest () throws adapteexception {
Try {
Thrownew exception ("throwing an exception ");
} Catch (exception e ){
Logger. Error (E. getlocalizedmessage (), e );
Thrownew adapteexception (E. getlocalizedmessage (), e );
}
}
}
2. Exception Handling sub-process
2.2.1. Embed creation process
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4D/0E/wKiom1RKBoixZy6xAAF6Ogwm3D0714.jpg "Title =" c.png "alt =" wkiom1rkboixzy6xaaf6ogwm3d0714.jpg "/>
2.2.2. Overall Flowchart
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4D/0E/wKiom1RKBrahbC9VAABC6qqG0lo933.jpg "Title =" d.png "alt =" wkiom1rkbrahbc9vaabc6qq1_lo933.jpg "/>
2.2.3.
Exception Handling component
PackageCom. aeai. Video. messageflows. exceptionhandleembed;
ImportCom. agileai. ESB. Core. adapteexception;
ImportCom. agileai. ESB. component. transformer. javatransformer;
Public ClassJavaconverter1ExtendsJavatransformer {
Public VoidHandlerequest ()ThrowsAdapteexception {
Try{
Logger. Error ("= Exception = ");
// Handle exceptions
}Catch(Exception e ){
Logger. Error (E. getlocalizedmessage (), e );
Throw NewAdapteexception (E. getlocalizedmessage (), e );
}
}
}
2. 3. Call sub-process
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4D/0F/wKioL1RKB3eQdqJ4AAGmnsquFvg875.jpg "Title =" e.png "alt =" wkiol1rkb3eqdqj4aagmnsqufvg875.jpg "/> 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4D/0F/wKioL1RKB52TbKHYAAETh-mVxJs493.jpg "Title =" f.png "alt =" wKioL1RKB52TbKHYAAETh-mVxJs493.jpg "/>
2. 4. Test
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4D/10/wKioL1RKB9iR6_cfAAS4pcxZdqg437.jpg "Title =" g.png "alt =" wkiol1rkb9ir6_cfaas4pcxzdqg437.jpg "/>
Aeai ESB-based exception handling control document download
This article is from the "shutong changlian Portal Integration Platform" blog, please be sure to keep this source http://aeaiportal.blog.51cto.com/9300497/1567609
Aeai ESB-based Exception Handling Control