Wednesday, November 17, 2010

IBM WESB Tips and Aches - part II

IBM ESB v7.x has some nice improvements over its earlier one from both development and runtime standpoint. The earlier 6.x version lacked reusability and involved quite a bit of development for even the simplest tasks. With 7.x, IBM now supports XPATH 1.1 functions and additional primitives such as tracing, and mediation subflow which when properly designed can result in productive development.

First, to talk about tracing which is somewhat similar to logger, is quite handy at development time which simply streams your entire xml graph onto a specified/default file location. In production, you may enable/disable this feature by promoting and configuring boolean property. When you extend this feature across all modules you may want to have a generic reusable logger rather than one for each module. This is accomplished using mediation subflow that includes tracing primitive wired between its IN and OUT terminals.

Mediation subflows by design are intended to be reused across all modules and applications and therefore when working with those, care should be taken so that they are not created within "Application" or "Module" construct, but instead within a "Library" construct. This allows reuse across multiple modules or applications (ofcourse it also depends on what you have created within subflow).

One interesting note with mediation subflow, is accessing contextual information within the flow. Context information can either be correlation, transient or user context. Normally your business objects or custom BO's are bound to context and if you wanted to access those from within mediation subflow at design time, you may not find a handle to it. This is by design of mediation subflows which are supposed to be agnostic to your application or module and thus any type of contextual information. One way to get around this is to use "MessageSetter" prmitive as the first element within subflow and cast appropriate context (user, transient or correlation) with your business object. This facilitates visibility of context information within subflow for any wiring or transformation.

No comments:

Post a Comment