Creating message catalogs
Create your own message catalogs to write tailored entries to the local error log.
About this task
In some error and other situations, you might choose to write information to the error log so that you can track what is happening in a message flow. You can use the Throw and Trace built-in nodes to generate entries in the log, or you can create your own nodes and user exits, and write entries in the log from your user-defined extensions.
- A fixed set of messages that are provided in the product message
catalog. This set provides a range of numbers for Throw nodes (BIP3001 to BIP3049),
and a second range for Trace nodes
(BIP3051 to BIP3099). A third range
(BIP2951 to BIP2999) is provided
for the ESQL statements LOG and THROW.
When you use these messages, you can also provide additional text that is displayed in the message text.
- Your own messages, created in your own message catalog. You can use this additional catalog to define specialized message content, and you can include variables or inserts that are determined by the code that generates the message. You can also share your own message catalog with other applications that are not associated with IBM® Integration Bus.
When you throw an exception from ESQL by using a THROW statement, the ESQL code adds an extra leading insert that contains the name of the current component. The rest of the inserts that are provided by the ESQL script follow this leading insert. Therefore, you must consider this insert when you are writing your own message catalog.
The instructions in this topic describe how to create message catalogs for C programs. If you want to create a Java™ resource bundle, refer to the documentation for the Java 2 Platform, Standard Edition.
Read the section appropriate to your integration node operating system:
Building and installing a Windows message source
About this task
On Windows, you must create your additional message catalog as a DLL file. The DLL file contains definitions of your event messages, which the event viewer can display in a readable format, based on the event message written by your application. When you compile a message catalog, a header file is created that defines symbolic values for each event message number you have created. You must include the header file in your application.
To create an event source for the Windows Event Log Service:
Procedure
Creating an XPG/4 catalog for Linux, UNIX, and z/OS
About this task
On Linux®, UNIX, and z/OS® systems, messages are written to the SYSLOG facility. If you want to use your own message catalog, you must create an XPG/4 message catalog.
The process for creating a message catalog (a .cat file) depends on the operating system on which you are creating it. The commands that you use are typically gencat (create or modify a message catalog) and dspcat (to display all or part of a message catalog). The gencat command merges text files that contain your message text, to create or modify a formatted catalog. The text files typically have a file extension of .msg.
export MQSI_CONSOLE_NLSPATH=${MQSI_CONSOLE_NLSPATH}:${MY_INST_PATH}/messages/%L/%N:${MY_INST_PATH}/messages/En_US/%N
In
this example, the English version is hardcoded later in the search
path, ensuring that messages are displayed even in locales for which
no .cat file exists. 1234 "MSG1234E: \
Syntax Error. \n
The value '{0}' is not valid for property '{1}'.\n
Correct it and then reissue the command.\n"
If you create a message catalog on one operating system, you cannot port it to another operating system because the catalogs are binary-encoded. However, you can use the same .msg files as input to the gencat command on another system.
See the relevant information in the documentation for your operating system. For example:
- For AIX®, see the Commands Reference in the product documentation.
- For z/OS, see the UNIX System Services Command Reference in the z/OS product documentation online.
You must also check the information about additional supported locales, if you want to use messages in locales other than US English.