JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server Message Queue 4.5 Developer's Guide for Java Clients
search filter icon
search icon

Document Information

Preface

1.  Overview

Setting Up Your Environment

Starting and Testing a Message Broker

To Start a Broker

To Test a Broker

Developing a Client Application

To Produce Messages

To Consume Messages

Compiling and Running a Client Application

To Compile and Run the HelloWorldMessage Application

Deploying a Client Application

Example Application Code

2.  Using the Java API

3.  Message Queue Clients: Design and Features

4.  Using the Metrics Monitoring API

5.  Working with SOAP Messages

6.  Embedding a Message Queue Broker in a Java Client

A.  Warning Messages and Client Error Codes

Index

Starting and Testing a Message Broker

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

  1. In a terminal window, change to IMQ_HOME/bin, the directory containing Message Queue executables.
  2. 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

One simple way to check the broker startup is by using the Message Queue command utility (imqcmd) to display information about the broker:

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

Example 1-1 Output From Testing a Broker

% 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