users@glassfish.java.net

Re: ERROR [B3276]: Starting a GlassFish-managed broker directly using imqbrokerd is not allowed

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Wed, 04 Jan 2012 12:34:44 +0000

If all you did was to extract the GlassFish 3.1.1 files and then run C:\glassfish3\mq\bin\imqbrokerd then a default
broker will start without error (I just checked this). This broker has the name "imqbroker".

However if you started GlassFish previously and then stopped it, this will also have started (and stopped) a default
broker, also named "imqbroker". This broker is then considered to be "managed" by GlassFish and you cannot subsequently
use imqbrokerd to start it.

As you discovered, you can subsequently use "imqbrokerd -name <brokername>" to start a broker with a different name.
This will store its config and log files in a different directory from the default and so will not be considered to be
"managed" by GlassFish. Do you actually want to use GlassFish? If you intend to use GlassFish as well then I would
recommend allowing GlassFish to manage the broker for you. It is possible to manage GlassFish and the broker separately
but this is an advanced option requiring extra configuration.

The basic idea is that

* if you are using MQ only, and do not intend to use GlassFish, then you use imqbrokerd to start the broker.

* if you are using GlassFish then if you start GlassFish using "asadmin start-domain" it will start the broker for you.
The broker will run in the same JVM as GlassFish. You should not use imqbrokerd.

* there is an advanced option in which you manage both GlassFish and the broker separately. Only do this if you have a
specific need to do this (e.g. because you want GlassFish and the broker to run on different machines).

(I agree this might be better explained in the docs. Feel free to log a documentation bug)

Nigel