Developing user-defined parsers
Create a user-defined parser to interpret messages with a different format and structure.
Before you begin
About this task
A loadable implementation library, or a LIL, is the implementation module for a C parser (or node). A LIL is a Linux® or UNIX shared object or Windows dynamic link library (DLL), that does not have the file extension .dll but .lil.
The implementation functions that you must write are listed in C parser implementation functions. The utility functions that are provided by IBM® Integration Bus to help you are listed in C parser utility functions.
IBM Integration Bus provides the source for a sample user-defined parser called BipSampPluginParser.c. This example is a simple pseudo-XML parser that you can use in its current state, or you can modify.
Declaring and defining the parser
About this task
To declare and define a user-defined parser to the integration node, you must include an initialization function, bipGetParserFactory, in your LIL. The following steps outline how the integration node calls your initialization function and how your initialization function declares and defines the user-defined parser:
The following procedure shows you how to declare and define your parser to the integration node:
Procedure
Creating an instance of the parser
About this task
Procedure
Deleting an instance of the parser
About this task
Parsers are destroyed when a message flow is deleted or redeployed, or when the integration server process is stopped (using the mqsistop command). When a parser is destroyed, it must free any used memory and release any held resources using the cpiDeleteContext function. For example:
void cpiDeleteContext(
CciParser* parser,
CciContext* context
){
PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ;
int rc = 0;
return;
}