Before you start
WebSphere Message Broker provides the source
for two sample user-defined nodes called SwitchNode and TransformNode. You
can use these nodes in their current state, or you can modify them. In addition you can view the User-defined Extension sample which
demonstrate the use of user-defined nodes, including a message processing
node written in C.
A loadable implementation library, or a LIL, is the implementation module for a C node (or parser). A LIL is implemented as a dynamic link library (DLL). It does not have the file extension .dll but .lil.
The implementation functions that have to be written by the developer are listed in C node implementation functions. The utility functions that are provided by WebSphere Message Broker to aid this process are listed in C node utility functions.
WebSphere Message Broker provides the source for two sample user-defined nodes called SwitchNode and TransformNode. You can use these nodes in their current state, or you can modify them. There is also the User-defined Extension sample sample for you to use.
Conceptually, a message processing node is used to process a message in some way, and an output node is used to output a message as a bitstream. However, when you code a message processing node or an output node, they are essentially the same thing. You can perform message processing within an output node, and likewise you can output a message to a bitstream using a message processing node. For simplicity, this topic mainly refers to the node as a message processing node, however, it discusses the functionality of both types of node.
The following procedure shows you how to declare and define your node to the broker:
Attributes are set whenever you start the broker, or when you redeploy a message flow with new values. Attributes are set by the broker calling user code on the configuration thread. The user code needs to store these attributes in its node context area, for use when processing messages later.
{ const CciChar* ucsAttr = CciString("nodeTraceSetting", BIP_DEF_COMP_CCSID) ; insAttrTblEntry(p, (CciChar*)ucsAttr, CNI_TYPE_INTEGER); _setAttribute(p, (CciChar*)ucsAttr, (CciChar*)constZero); free((void *)ucsAttr) ; } { const CciChar* ucsAttr = CciString("nodeTraceOutfile", BIP_DEF_COMP_CCSID) ; insAttrTblEntry(p, (CciChar*)ucsAttr, CNI_TYPE_STRING); _setAttribute(p, (CciChar*)ucsAttr, (CciChar*)constSwitchTraceLocation); free((void *)ucsAttr) ; }
When the broker retrieves a message from the queue and that message arrives at the input terminal of your user-defined message processing or output node, the broker calls the implementation function cniEvaluate. This function is called on the message processing thread and it should decide what to do with the message. This function might be called on multiple threads, especially if additional instances are used.
To delete an instance of a node, you use the cniDeleteNodeContext function. For example:
void _deleteNodeContext( CciContext* context ){ static char* functionName = (char *)"_deleteNodeContext()"; return; }
The cniDeleteNodeContext function is provided by the user, and is called by the broker when a message flow is deleted.
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
as09980_ |