Wednesday, 17 June 2015

IBM Integration Bus - Oh, that's where the logs are hiding ...

I've had a sterling day with IBM Integration Bus, getting to grips with some basic flows, starting with a two-node flow, with an input node receiving a message from Queue A and an output node posting the same (!) message to Queue B.

I then got much more clever, creating a Database Service to run a query against a DB2 database, posting a single row to the output Queue.

I then went one step further, using a JSON message posted to Queue A to control the SQL query against DB2, via the Database Service, to return a specific row, and post it to Queue B.

During the journey, I hit a few DB2-related issues, and wondered where the logs were.

I know where to look for WebSphere MQ, but couldn't find the corresponding IIB logs.

Then I remembered that my IBM Egypt colleague had pointed out that IIB writes to the OS system log.

On Windows, this is in the Event Viewer.

On Unix, this is, by default, the System Log.

As an example, this is what we see on my Linux box: -

cat /var/log/messages

<snip>
Jun 17 19:24:27 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 3/7) BIP2488E:  (.customerService_Compute.Main, 6.3) Error detected whilst executing the SQL statement 'retrieveEmployee(dbResultSetRef);'. 
Jun 17 19:24:27 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 4/7) BIP2934E: Error detected whilst executing the function or procedure 'retrieveEmployee'. 
Jun 17 19:24:27 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 5/7) BIP2488E:  (DatabaseService.EMPLOYEE_OPS_GROUP.retrieveEmployee, 3.2) Error detected whilst executing the SQL statement 'SET dbResultSetRef.row[ ] = SPECIFICPASSTHRU('SELECT EMPNO, FIRSTNME, LASTNAME FROM DB2INST1.EMPLOYEE', Database.SAMPLE);'. 
Jun 17 19:24:27 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 6/7) BIP2393E: Database error: ODBC return code '-1' from data source 'SAMPLE' using ODBC driver manager ''. 
Jun 17 19:24:27 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 7/7) BIP2347E: Database error: SQL State 'IM002'; Native Error Code '0'; Error Text 'System information file not found. Please check the ODBCINI and the ODBCSYSINI environment variables are correctly set.' 
Jun 17 19:24:28 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 63080] (Msg 1/1) BIP2648E: Message backed out to a queue; node 'customerService.Input'. 

</snip>

Thankfully, we can choose to move the IIB logs elsewhere, as documented here: -

On Linux and UNIX systems, all IBM® Integration Bus messages (other than messages that are generated by the command-line utilities) are sent to the syslog subsystem.

You must configure this subsystem so that all diagnostic messages that enable you to monitor the performance and behavior of your broker environment are displayed.

The configuration steps you make to ensure that all relevant messages are displayed depend on the version of Linux and UNIX that you are using. Refer to your operating system documentation relating to syslog (or syslog-ng for some versions of Linux) for information about how to configure the syslog subsystem.

IBM Integration Bus processes call the syslog commands on the operating system but only those messages that correspond to the filter defined for the output destination are displayed. IBM Integration Bus messages have:

• A facility of user.
• A level of err, warn, or info, depending on the severity of the situation causing the message to be issued.

To record all IBM Integration Bus messages, create a filter on the user facility for messages of level info or greater. It is good practice to write these messages to a separate file; there might be a high number of them and they are more likely to be of interest to broker administrators rather than to system administrators.

The following line in a syslog.conf file causes all IBM Integration Bus events to be written to a file /var/log/user.log

user.info /var/log/user.log

Many UNIX systems provide a command-line utility, known as logger, to help you test and refine your configuration of the syslog subsystem.
</snip>

Now I am using Red Hat Enterprise Linux 6.6, which uses rsyslog rather than syslog.

However, the change was minimal: -

(a) I edited /etc/rsyslog.conf

vi /etc/rsyslog.conf

adding: -

<snip>
# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log

user.info /var/log/user.log

# ### begin forwarding rule ###

</snip>

(b) Restarted the rsyslog service: -

service rsyslog restart

Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]

(c) Checked the newly created file /var/log/user.log

tail -f /var/log/user.log 

<snip>
Jun 17 19:50:09 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 64690] (Msg 4/7) BIP2934E: Error detected whilst executing the function or procedure 'retrieveEmployee'. 
Jun 17 19:50:09 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 64690] (Msg 5/7) BIP2488E:  (DatabaseService.EMPLOYEE_OPS_GROUP.retrieveEmployee, 3.2) Error detected whilst executing the SQL statement 'SET dbResultSetRef.row[ ] = SPECIFICPASSTHRU('SELECT EMPNO, FIRSTNME, LASTNAME FROM DB2INST1.EMPLOYEE', Database.SAMPLE);'. 
Jun 17 19:50:09 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 64690] (Msg 6/7) BIP2393E: Database error: ODBC return code '-1' from data source 'SAMPLE' using ODBC driver manager ''. 
Jun 17 19:50:09 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 64690] (Msg 7/7) BIP2347E: Database error: SQL State 'IM002'; Native Error Code '0'; Error Text 'System information file not found. Please check the ODBCINI and the ODBCSYSINI environment variables are correctly set.' 
Jun 17 19:50:10 bpmdemo IIB[44047]: IBM Integration Bus v9002 (IB9NODE.IIB9) [Thread 64690] (Msg 1/1) BIP2648E: Message backed out to a queue; node 'customerService.Input'.
</snip>


No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...