This tutorial assumes that you do not have a Message Queue message broker currently running. (If you run the broker as a UNIX startup process or Windows service, then it is already running and you can skip to Developing a Client Application.)
 To Start a Broker
To Start a BrokerIn a terminal window, change to the directory containing Message Queue executables (see the table below).
| Platform | Location | 
|---|---|
| Solaris | /usr/bin/ | 
| Linux | /opt/sun/mq/bin/ | 
| Windows | IMQ_HOME\bin\ | 
Run the broker startup command (imqbrokerd) as follows:
| imqbrokerd -tty | 
The -tty option causes all logged messages to be displayed to the terminal console (in addition to the log file). The broker will start and display a few messages before displaying the message
| imqbroker@host:7676 ready | 
The broker is now ready and available for clients to use.
 To Test a Broker
To Test a BrokerOne simple way to check the broker startup is by using the Message Queue command utility (imqcmd) to display information about the broker:
In a separate terminal window, change to the directory containing Message Queue executables (see the table shown at the beginning of the section To Start a Broker).
Run imqcmd with the following arguments:
| imqcmd query bkr -u admin | 
Supply the default password of admin when prompted to do so. The output displayed should be similar to that shown in the next example.
| % imqcmd query bkr -u admin Querying the broker specified by: ------------------------- Host Primary Port ------------------------- localhost 7676 Version 3.6 Instance Name imqbroker Primary Port 7676 Current Number of Messages in System 0 Current Total Message Bytes in System 0 Max Number of Messages in System unlimited (-1) Max Total Message Bytes in System unlimited (-1) Max Message Size 70m Auto Create Queues true Auto Create Topics true Auto Created Queue Max Number of Active Consumers 1 Auto Created Queue Max Number of Backup Consumers 0 Cluster Broker List (active) Cluster Broker List (configured) Cluster Master Broker Cluster URL Log Level INFO Log Rollover Interval (seconds) 604800 Log Rollover Size (bytes) unlimited (-1) Successfully queried the broker. Current Number of Messages in System 0 |