See information about the latest product version
Implementing a user-defined parser
Create a user-defined parser to interpret messages with a different format and structure.
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 WebSphere® Message Broker to help you are listed in C parser utility functions.
WebSphere Message Broker 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
To declare and define a user-defined parser to the broker, you must include an initialization function, bipGetParserFactory, in your LIL. The following steps outline how the broker 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 broker:
Creating an instance of the parser
Deleting an instance of the parser
Parsers are destroyed when a message flow is deleted or redeployed, or when the execution group 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;
}