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 user
ID will share these tables.
To create a broker:
- Ensure that the user ID that the broker uses to 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 connects to the broker database using
the user ID and password that you specify in the -i and -u parameters
of the mqsicreatebroker command
when you create the broker.
For more information, see Authorizing access to broker 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.
For more information, see Enabling ODBC connections to the databases.
On Linux on System z® and Linux on POWER™, 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.
- Ensure that you are logged in using a user ID
that has authority to run the mqsicreatebroker command.
- Run the mqsiprofile script to set up
the command environment for the broker:
. install_dir/bin/mqsiprofile
You
must run this script before you can run any of the WebSphere Event
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 support access to 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 runs.
- dbuid and dbpw are the user
name and password that the broker uses 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 created and started a broker.
Next, you must perform the following
tasks:
- Create any other components that you need.
- Create a WebSphere MQ infrastructure
to connect the components together; see Connecting components.
- Add the broker to the broker domain:
When you have completed these tasks, the broker is ready to use.