When you create a broker, if the queue
manager does not already exist, the queue manager is automatically created.
The broker database must already exist but the tables in which the broker
stores its internal data are created automatically when the first broker to
use that database is created. Subsequent brokers that are created using the
same database and database userid will share these tables.
To create
a broker:
- Ensure that the user ID with which the broker will connect to the
broker database is authorized to create tables in the broker database. If you are not sure, check with your database administrator (DBA). The
broker will connect to the broker database using the user ID
and password that you will specify in the -i and -u parameters of the mqsicreatebroker
command when you create the broker.
For more information, see Authorizing access to the databases.
- Define the ODBC data source name (DSN) of the broker database to
enable the broker to make a connection. Multiple brokers on the
same host can use the same ODBC DSN to connect to the same broker database.
On Linux (zSeries platform) and Linux (POWER platform),
the only supported database manager is DB2 and ODBC is not used; the broker
connects to the broker database directly. When you create the broker, use
the DB2 alias of the database as the data source name.
For more information,
see Enabling connections to the databases.
- Ensure that you are logged in using the user ID under which the
broker will run (the service user ID). The service user ID can
be different from the user ID that the broker uses to access its broker database
(the data source user ID).
If you switch from another user ID using the
su command
ensure that you specify the dash (-) parameter to run the new user's profile:
su - userID
where
userID is the user ID that you want to use as the broker service user ID.
- Run the mqsiprofile script to set up the command environment for
the broker:
. install_dir/bin/mqsiprofile
You
must do this before you can run any of the WebSphere Message Broker commands.
For
more information, see Setting up a command environment.
- Run the SQL profile that was created when the broker database was
created. For example, if the broker database is a DB2 instance,
run the db2profile. For more information,
see Setting your environment to access databases.
- Use the mqsicreatebroker command
to create the broker.
For example, if you want to create
a broker called
WBRK_BROKER on
a queue manager called
WBRK_QM with
a broker database that has the data source name
WBRKBKDB,
enter the following command:
mqsicreatebroker WBRK_BROKER -i wbrkuid -a wbrkpw
-q WBRK_QM -n WBRKBKDB -u dbuid -p dbpw
where:- wbrkuid and wbrkpw are
the user name and password under which the broker will run.
- dbuid and dbpw are the user name
and password that the broker will use to access the broker database and create
tables to store its internal data.
If you want to add a User Name Server to your broker
domain, create the broker with the additional -s and -j parameters on the mqsicreatebroker command. For more
information, see Enabling a User Name Server.
For
more information about the command options, see mqsicreatebroker command.
You have now created and started a broker.