Creating a broker on Linux and UNIX systems

On Linux and UNIX systems, you create brokers on the command line; on Linux (x86 platform), you can also create brokers in the Message Brokers Toolkit using the Command Assistant wizard.

Before you start:

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:

  1. 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.

  2. 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.

    Linux platform 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.

  3. 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.
  4. 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 Event Broker commands.

    For more information, see Setting up a command environment.

  5. 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.
  6. 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.
Next, you must perform the following tasks:
  1. Create any other components that you need.
  2. Create a WebSphere MQ infrastructure to connect the components together
  3. Add the broker to the broker domain:
When you have completed these tasks, the broker will be ready to use.
Related concepts
Brokers
Broker domains
Related tasks
Setting up a command environment
Creating a User Name Server
Creating a Configuration Manager
Adding a broker to a broker domain
Using WebSphere MQ trusted applications
Using the Command Assistant wizard
Related reference
mqsicreatebroker command