Saturday, October 30, 2010

Different behavior of mqsicreatebar in MB v7

Though am essentially from a Java background, my last project was for integrating distinct applications and hence, involved the usage of IBM's Websphere MQ and Message Broker. And, this forms the base for the following post.

'mqsicreatebar' command that ships with the Message Broker Toolkit, though not widely used, is indispensible when automating the building of Broker Archives (BARs). With the recent release of V7 of the broker, I was involved in the process of migrating all our build scripts to use the latest version of the command. Not all our BARs were building successfully when the V6 scripts were used without any modifications. The reasons turned out to be following -

1. All the projects referenced from the message flows, message sets and message maps in the projects being added to the BAR need to be present in the workspace being used by the command. For example, if flows 'a' and 'b' are present in the same project 'A' and the BAR being built needs to have only flow 'a', even a project 'B' that is referred only from the message flow 'b' should be present in the workspace. It should also be passed in the values specified for the attribute 'p' required by the mqsicreatebar command. This unreferenced project was never needed in the workspace in V6.

2. There should be no error at all in the workspace on which the command is ran. Though this requirement is valid if the error is in the files being directly needed in the BAR (for e.g. in the message flows or maps), it also applies to files like the WSDL being used for creating the message sets. Though you might argue why such a thing would ever happen as the message set needs to be created from an "error-free" WSDL, I ran into a case where the WSDL inside the message set project was accidentally modified in the code repository after the message set was created. BAR building using V6 never failed even with such an error in the WSDL!