You can configure the broker to do any of the following:
Start an RMI registry (imq.jmx.rmiregistry.start=true)
If the broker is configured to start an RMI registry, then the broker will do the following:
Start an RMI registry in the broker process. The RMI registry will remain operational during the lifetime of the broker.
Store the JMX connector stub for it's connectors in this RMI registry.
Advertise a static JMX Service URL that points to the relevant JMX connector stub in this registry.
Shut down the RMI registry as part of the broker shutdown process.
Use an existing RMI registry (imq.jmx.rmiregistry.use=true)
If the broker is configured to use an existing RMI registry on the local host, then the broker will do the following:
Expect an RMI registry to be running on the same host (at a port which can also be specified)
Store the JMX connector stub for it's connectors in this externally managed RMI registry.
Advertise a static JMX Service URL that points to the relevant JMX connector stub in this registry. This means the registry must remain operational during the lifetime of the broker.
Not shut down the RMI registry as part of the broker shutdown process.
Not use a registry at all (both imq.jmx.rmiregistry.start and imq.jmx.rmiregistry.use are set to false).
If the broker is configured to not use a registry, then the broker will advertise a dynamic JMX Service URL that contains the JMX connector stub as a serialized object.
The choice of using or not using an RMI registry depends upon whether you want a static or dynamic JMX Service URL, respectively. The advantages and disadvantages of using an RMI registry are shown in the following table.
Table D–1 Advantages and Disadvantages of Using an RMI Registry
Scenario |
Broker Configuration |
Advantages |
Disadvantages |
---|---|---|---|
Using a Registry (Static JMX Service URL) |
Configuration Properties: imq.jmx.rmigegistry.start imq.jmx.rmigegistry.use imq.jmx.rmigegistry.port |
The value of the JMX Service URL is constant across broker restarts. |
Broker depends on an RMI registry, either one it starts or one that is externally available. There is therefore one more port to worry about with regard to port conflicts or firewall configurations. |
Not Using a Registry (Dynamic JMX Service URL) |
Default |
Broker does not start up an RMI registry. There is therefore one less port to worry about with regard to port conflicts or firewall configurations. |
The value of the JMX Service URL changes at every broker startup. JMX applications need to be provided a new URL every time the broker restarts. (This is not an issue with JMX client applications that use the AdminConnectionFactory class.) |
If a registry is being used, the imq.jmx.rmiregistry.port property specifies the port number for the RMI registry. For convenience, you can also specify these RMI registry related properties by using equivalent Broker utility (imqbrokerd) options at broker startup: -startRmiRegistry, -useRmiRegistry, and -rmiRegistryPort, respectively (see Table 15–1).
When using an RMI Registry to store a JMX connector stub, the urlpath portion of the JMX service URL (see The JMX Service URL) does not change across broker startups and has the following form:
/jndi/rmi://brokerHost[:rmiPort]/brokerHost/portMapperPort/connectorName
This path consists of two segments:
/jndi/rmi://brokerHost[:rmiPort]
Specifies the RMI registry host and port at which the JMX contector stub is obtained by performing a JNDI lookup. The default port is 1099.
/brokerHost/portMapperPort/connectorName
Specifies the location within the RMI registry where the JMX connector stub is stored.
The following example shows the JMX service URL for the default jmxrmi connector in the case where an RMI registry is started on port 1098 on a host called yourhost:
# imqbrokerd -startRmiRegistry -rmiRegistryPort 1098
% imqcmd list jmx -u admin -passfile /myDir/psswds Listing JMX Connectors on the broker specified by: ------------------------- Host Primary Port ------------------------- localhost 7676 Name Active URL jmxrmi true service:jmx:rmi://yourhost/jndi/rmi://yourhost:1098 /yourhost/7676/jmxrmi ssljmxrmi false Successfully listed JMX Connectors. |
The JMX service URL could potentially contain a hostname and port three separate times, indicating the location of the JMX connector, the RMI registry, and the broker, respectively.
When not using an RMI Registry to store a JMX connector stub, the urlpath portion of the JMX service URL is dynamically generated at broker startup and has the following form:
/stub/rO0ABdmVyLlJlpIDJyGvQkwAAAARod97VdgAEAeA==
where the string following /stub/ is the is the serialized JMX connector stub encoded in BASE64 (shortened above for legibility)
The following example shows the JMX service URL for the default jmxrmi connector when no RMI registry is started by the broker and no existing registry is used.
# imqbrokerd
% imqcmd list jmx -u admin -passfile /myDir/psswds Listing JMX Connectors on the broker specified by: ------------------------- Host Primary Port ------------------------- localhost 7676 Name Active URL jmxrmi true service:jmx:rmi://yourhost/stub/rO0ABdmVyLlJlpIDJy== ssljmxrmi false Successfully listed JMX Connectors. |