The MRM domain can be used to parse and write a wide variety of
message formats. It is primarily intended for non-XML message formats,
but it can also parse and write XML. For guidance on when to consider
using the MRM parser, instead of one of the XML parsers, to parse
XML, see Which XML parser should you use?
The key features of the MRM domain are:
- Support for messages from applications that are written in C,
COBOL, PL/I and other languages, by using the Custom Wire Format (CWF)
physical format. This support includes the ability to create a message
model directly from a C header file or COBOL copybook.
- Support for text messages, perhaps with field content that is
identified by tags, separated by specific delimiters, or both, by
using the Tagged Delimited String (TDS) physical format. This includes
industry standards such as CSV, HL7, SWIFT, EDIFACT, and X12.
- Support for XML messages, including those that use XML namespaces,
by using the XML physical format.
IBM® Integration Bus uses the MRM parser
to read and write messages that belong to the MRM domain. When reading
a message, the MRM parser constructs a message tree from a bit stream.
When writing a message, the MRM parser creates a bit stream from a
message tree. The MRM parser is always model-driven, and it is guided
by a message dictionary that describes the shape of the message tree
(the logical model) and the physical layout of the bytes or characters
in the bit stream (the physical format). A message dictionary is created
automatically from the content of a message set when it is added to
the broker archive (BAR) file. Therefore, when you create a message
set for use with the MRM domain, you must define both the logical
model and the appropriate physical format information.
The operation of the parser depends on the physical format that
you have associated with the input or output message:
- For a binary message, the parser reads a set sequence of bytes
according to information in the CWF physical format, and translates
them into the fields and values in the message tree.
- For a text message, the parser uses a key piece of TDS physical
format information called Data Element Separation to
decide how to parse each portion of the message bit stream. This informs
the parser whether the message uses delimiters, tags, fixed length
elements, patterns, and so on. The parser then reads the data according
to information in the TDS physical format, and translates it into
the fields and values in the message tree.
- For an XML message, the parser reads the XML markup language (element
tags and attributes), guided by information in the XML physical format,
and translates them into the fields and values in the message tree.
Because the MRM parser is model-driven, it can perform validation
of messages against the model that is defined in the deployed dictionary.
The level of validation that is performed by the MRM parser is similar
to that defined by XML Schema 1.0, but is not fully compliant. If
you use XML messages, and you want fully compliant XML Schema 1.0
validation, use the XMLNSC domain.
The MRM parser is an on-demand parser. See Parsing on demand.
If you want to use the MRM domain to parse a particular message:
- Create a new message set with an appropriate CWF, TDS, or XML
physical format; or locate an existing message set.
- Ensure that the message set has its Default message domain set
to MRM, or that the MRM check
box under Supported message domains is selected
to indicate that the message set supports the MRM domain.
- Create a message definition file in the message set to represent
your message, ensuring that both logical and physical format information
is provided. If you have an existing C, COBOL, XML Schema, or DTD
description of your message, you can import the description by using
a wizard.
- Add the message set to a broker archive (BAR) file which will
generate a message dictionary for use by the MRM parser, and deploy
the BAR file to the broker.
- Select MRM as Message Domain on
the appropriate node in your message flow.
- Additionally set values for Message Set, Message
Type, and Message Format on the node. Message
Type is the name of the message in the message definition
file.
The following samples all use the MRM parser to process messages:
You can view information about samples only when you use the product documentation that is integrated with the IBM Integration Toolkit or the online product documentation. You can run samples only when you use the product documentation that is integrated with the IBM Integration Toolkit.
Some predefined message models are supplied with the IBM Integration Toolkit and can be imported by using
the New Message Definition File From IBM supplied
Message wizard. The CSV, ALE IDoc, and File IDoc models are specifically
for use with the MRM domain. See Message Sets: IBM supplied messages that you can import.
IBM supplies predefined message
sets for industry standard formats SWIFT, X12, EDIFACT, and FIX. For
more information, contact Dublin Adapters at dubadapt@ie.ibm.com.