You are on page 1of 12

Create and Deploy BAR file from Command line

Create and Deploy BAR file from Command line

Author: Rameshkumar Swaminathan

DOCUMENT REVISION CONTROL


DATE

AUTHOR

VERSION

CHANGE DESCRIPTION

July 24, 2008

Rameshkumar
Swaminathan

1.0

Creation

Page 1 of 12

Create and Deploy BAR file from Command line

TABLE OF CONTENTS
INTRODUCTION..........................................................................................................................................3
MQSICREATEBAR.......................................................................................................................................3

Overview..........................................................................................................................3
Command.....................................................................................................................3
Parameters....................................................................................................................3
Usage of mqsicreatebar....................................................................................................4
Create bar-file for a MsgSet Project............................................................................4
Create bar-file for a MsgFlow Project.........................................................................5
Create bar-file for a Project that contains both Msgset and MsgFlows.......................5
Troubleshooting...............................................................................................................6
MQSIDEPLOY...............................................................................................................................................7

Overview..........................................................................................................................7
Command.....................................................................................................................7
Parameters....................................................................................................................7
Usage of mqsideploy.......................................................................................................9
Troubleshooting.............................................................................................................10
REFERENCE................................................................................................................................................11

Page 2 of 12

Create and Deploy BAR file from Command line

Introduction
This document describes the use of mqsicreatebar and mqsideploy commands.

mqsicreatebar
Overview
Command
The mqsicreatebar command provides a command line compiler that creates deployable
broker archive files containing message flows and dictionaries.
Together with the command line repository tools, this enables you to write scripts to
repeatedly deploy. Although you are recommended not to perform team development
without a repository, a repository is not required.

Note:
This executable for this command is found in broker installation\eclipse directory. So
you should either be in that directory while issuing the command or include this directory
in PATH(environment variable).

Parameters
-data workspace (Optional) The location of the workspace, if not the current product
installation Eclipse folder. This is an Eclipse provided option.
-b barName (Required) The name of the bar (zip format) archive file where the result is
stored. The bar is replaced if it already exists and the META-INF/broker.xml file is
created.

Page 3 of 12

Create and Deploy BAR file from Command line

-version versionString (Optional) Append the _ (underscore) character and the value of
the versionString to the names of the objects added to the bar, before the file extension.
-p projectName (Optional) Projects containing files to link. You can specify multiple
projects that can be a message flow project, a message set project, or a message flow
plug-in node project. This option allows you to use the command line tool to open
existing or closed projects. The specified project is fully built and added to the workspace
used to compile the bar file.
-o filePath (Required) The workspace relative path (including the project) of a msgflow
or messageSet.mset file to add to the broker archive. The file can be in a message flow
project, a message set project, or a message flow plug-in node project.
Note: msgflow is the extension of the message flow file that, for example, you can call
myFlow.msgflow, whereas the name of the message set file is fixed.
You can add more than one deployable file to this command by using the following
format -o filePath1 -o filePath2 .... -o filePathn

Usage of mqsicreatebar
Create bar-file for a MsgSet Project
Command
mqsicreatebar -data D:\MB_Workspace -b CblMsgSet.bar -p MSfromCbl -o
MSfromCbl\ms1\messageSet.mset
Screenshot of Output

Page 4 of 12

Create and Deploy BAR file from Command line

Create bar-file for a MsgFlow Project


Command
mqsicreatebar -data D:\MB_Workspace -b myflow.bar -p
POC_MSGSET_COPYBOOK_MSGFLOW -o
POC_MSGSET_COPYBOOK_MSGFLOW\POC_MSGSET_COPYBOOK_MSGFLO
W.msgflow
Screenshot of Output

Create bar-file for a Project that contains both Msgset and MsgFlows
Command
mqsicreatebar -data D:\MB_Workspace -b myflow.bar -o
POC_MSGSET_COPYBOOK_MSGFLOW\POC_MSGSET_COPYBOOK_MSGFLO
W.msgflow MSfromCbl\ms1\messageSet.mset
Screenshot of Output

Page 5 of 12

Create and Deploy BAR file from Command line

Troubleshooting
Scenario 1(Another Session already running in the associated workspace)

Above error means an active session of toolkit exists. To resolve this exit the toolkit session and
re-issue the command.
Scenario 2 (BIP0960E)

This error occurs when we give the o option twice to include additional source files. To resolve
this use only one occurance of -o and add all the source files separated by blank.

Page 6 of 12

Create and Deploy BAR file from Command line

mqsideploy
Overview
Command
Use the mqsideploy command to make a deploy request to the Configuration Manager.
This allows you to make the various flavors of deploy requests from a batch command
script, without the need for manual interaction.
The default situation is a delta or incremental deploy. Select -complete to override the
default operation. The return code from mqsideploy is zero if the command succeeds. If
the command fails, the return code is theBIP message number that describes the failure,
minus 1000 for messages in the format BIP1xxx; or minus 8000, for messages in the
format BIP8xxx. For example, if the command fails with the message BIP1034, the
return code is 34.
mqsicfgutil.ini found in MB Installation dir\bin directory is the configuration file for
the mqsideploy utility. In this file we have to specify the config manager details like
hostname, queueManager, port and securityExit(if required)

Parameters
-b Brokername (Optional) The name of the broker to which to deploy. If any of the
-topics, -topology, or -cancel flags are specified, the -b option is ignored. This is because,
when deploying topics or topology, or when cancelling an in-progress deployment, all
brokers in the domain are affected. Without the -e and -bar flags, a broker configuration
deploy is initiated.
-e EGName (Optional) The name of the execution group to which to deploy. The -b and
-bar options must also be specified with this option.
-bar BARFile (Optional) The name of the BAR (Broker Archive) file that is to be used
for a message flow or message set deploy. The -b and -e options must also be specified
with this option.
-topics (Optional) Deploy all the topics configuration information. Information is
deployed to all brokers in the domain.
-topology (Optional) This flag specifies that the Topology configuration should be
deployed. Information is deployed to all brokers in the domain if the -complete flag is
also set, otherwise the information is deployed only to brokers with a changed topology
configuration.

Page 7 of 12

Create and Deploy BAR file from Command line

-cancel (Optional) Cancel any outstanding deploys, that is, brokers that have not replied
to previous deploy requests (cancel deploy). All other flags except -w and -r are ignored
when this option is used.
-r (Optional) Read and display log records associated with the previous deploy request.
Use this in conjunction with the -w option to wait for a specified amount of time. Once a
log record has been read, the deploy is considered complete and the log record, or
records, associated with it are deleted.
-w timeoutValue (Optional) The time in seconds that the utility waits for the broker to
reply before returning control to the command line. The mqsideploy command polls the
Configuration Manager log records looking for the results of the deploy request that has
just been sent. The relevant log records contain information indicating whether the deploy
has been successful. The timeoutValue is the number of seconds to wait before timing
out, in the range 1 - 999 999. If you do not provide a timeoutValue the command
completes as soon as the Configuration Manager reports that the deployment has been
initiated.
-connection connectionParametersFile (Optional) The name of a .configmgr file that
describes the connection parameters to the Configuration Manager. The file is in XML,
using the .configmgr format saved by the Eclipse GUI. For example: <?xml
version="1.0" encoding="UTF-8"?> <configmgr host="localhost" listenerPort="1414"
queueManager="LUCAS" securityExit="test.myExit"/> If you omit the -connection
option, the command gets the configuration information from a file in the utilitys
working directory called mqsicfgutil.ini. This file has the format: hostname = localhost
queueManager = QMNAME port = 1414 securityExit = test.myExit Specifying the
-connection option causes the mqsicfgutil.ini file to be ignored. These files need to be in
the directory from which the command is being run. This is not necessarily the same
directory as the mqsideploy.bat file.
-rmMsgFlow name (Optional) Removes the named message flow from the supplied
execution group. This change is deployed to the broker immediately.
-rmMsgSet name (Optional) Removes the named message set from the supplied
execution group. This change is deployed to the broker immediately.
-complete (Optional) Deploy complete information:
For a BAR file deploy, -complete removes all currently-deployed message flows
and message sets from the execution group as part of the deploy. If -complete is
not set, the contents of the BAR file are deployed in addition to what is already
deployed on the execution group. In this case, any deployed objects with the same
name as an item inside the BAR are replaced by the version inside the BAR.
For a topology configuration deploy, -complete deploys complete interbroker
configuration information to all brokers. If -complete is not set, only changed
interbroker configuration is deployed to brokers whose interbroker configuration
has changed.

Page 8 of 12

Create and Deploy BAR file from Command line

For a broker deploy, -complete deploys all the brokers available configuration
attributes to the specified broker, for example, multicast parameters. If -complete
is not set, only changed configuration attributes are deployed.
For a topic tree deploy, -complete deploys the entire topic tree to all brokers. If
-complete is not set, only changes to the topic tree are deployed to all brokers.
For a remove message flow or remove message set operation, the flag is ignored.

Usage of mqsideploy
Command
mqsideploy -b WBRK_BROKER -e POC -bar D:\MyPOC\CblMsgSet.bar -w 300
Screenshot of Output

Command
mqsideploy -b WBRK_BROKER -w 300

Page 9 of 12

Create and Deploy BAR file from Command line

Screenshot of Output

Troubleshooting
Scenario 1(BIP1034S)

Page 10 of 12

Create and Deploy BAR file from Command line

This error occurs because Properties file 'mqsicfgutil.ini' does not exist or was not found in the
current directory. Change to broker installation\bin directory and reissue the command
Scenario 2 (BIP1036S)

Page 11 of 12

Create and Deploy BAR file from Command line


This error occurs when the config file mqsicfgutil.ini is not properly configured. To resolve this

specify the config manager details like hostname, queueManager, port and securityExit(if
required). If the details are already present verify the same.

Reference
For mqsicreatebar - messagebroker_Configuration_Administration_and_Security.pdf ->
operations -> commands -> mqsicreatebar.
For mqsideploy- messagebroker_Configuration_Administration_and_Security.pdf ->
operations -> commands -> mqsideploy.
For troubleshooting the best site is http://www.mqseries.net search here to find if this
issue has already been discussed and resolution provided. If not (register if required, )
logon and post a thread with your issue.

Page 12 of 12