Sun Java System Message Queue 4.1 Release Notes

Chapter 1 Sun Java System Message Queue 4.1 Release Notes

Version 4.1

Part Number 819-7753

These release notes contain important information available at the time of release of Sun Java™ System Message Queue 4.1. New features and enhancements, known issues and limitations, and other information are addressed here. Read this document before you begin using Message Queue. These release notes also contain information about the 4.0 release of Message Queue; see About Message Queue 4.0 for information about features introduced in that release.

The most up-to-date version of these release notes can be found at the Sun Java System Message Queue documentation web site. Check the web site prior to installing and setting up your software and then periodically thereafter to view the most up-to-date release notes and product documentation.

These release notes contain the following sections:

Third-party URLs are referenced in this document and provide additional, related information.

Sun is not responsible for the availability of third-party Web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused by or in connection with the use of or reliance on any such content, goods, or services that are available on or through such sites or resources.

Release Notes Revision History

The following table lists the dates for all 4.x releases of the Message Queue product and describes the main changes associated with each release.

Table 1–1 Revision History


Description of Changes  

May 2006 

Initial release of this document for version 4.0 of Message Queue. 

January 2007 

Initial release of this document for Beta version 4.1 of Message Queue. Adds description of JAAS support. 

April 2007 

Second release of this document for Beta version 4.1 of Message Queue. Adds high availability feature. 

September 2007 

Third release of this document for customer ship. Adds description of support for Java Enterprise System Monitoring Framework, fixed C ports, bug fixes, and other features. 

About Message Queue 4.1

Sun Java System Message Queue is a full-featured message service that provides reliable, asynchronous messaging conformant to the Java Messaging Specification (JMS) 1.1. In addition, Message Queue provides features that go beyond the JMS specification to meet the needs of large-scale enterprise deployments.

Version 4.1 of Message Queue adds support for high availability, for the Java Authentication and Authorization Service (JAAS), for the use of fixed C ports, and for Java Enterprise System Monitoring Framework. It also adds minor enhancements, and bug fixes. This section includes the following information.

For information about features introduced in Message Queue 4.0, see About Message Queue 4.0.

What's New in The 4.1 Release

Message Queue 4.1 introduces high availability (data and service availability) broker clusters, JAAS support, and various other minor features. This section describes these features and provides further references for your use.

High Availability

Message Queue 4.1 introduces high availability clusters, which provide data availability as well as service availability. If a client loses its connection to a high availability broker, it is automatically reconnected to another broker in a cluster. The broker that provides the new connection takes over the failed broker's persistent data and state, and continues to provide uninterrupted service to the failed broker's clients. You can run high availability brokers over a secure connection.

High availability brokers require the use of a highly available database (HADB). If you do not have such a database or if data availability is not important to you, you can continue to use conventional clusters, which offer automatic reconnection and service availability.

Configuring high availability brokers is simple: you specify the following kinds of broker properties for each broker in the cluster.

To use this feature, you must do the following:

  1. Install a highly available database.

  2. Install the JDBC driver's .jar file.

  3. Create the database schema for the highly available persistent store.

  4. Set those properties that are related to high availability for each broker in the cluster.

  5. Start each broker in the cluster.

For a conceptual discussion of high availability and how it compares to conventional clusters, see Chapter 4, Broker Clusters, in Sun Java System Message Queue 4.1 Technical Overview. For procedural and reference information about high availability, see Chapter 8, Broker Clusters, in Sun Java System Message Queue 4.1 Administration Guide and Cluster Configuration Properties in Sun Java System Message Queue 4.1 Administration Guide.

If you were using an HADB database with Message Queue version 4.0 and want to use a high availability cluster, you can use the dbmgr utility to upgrade to a shared HADB store. See Broker Clusters for more information.

JAAS Support

In addition to the file-based and LDAP-based built-in authentication mechanisms, Message Queue also supports the Java Authentication and Authorization Service (JAAS), which allows you to plug a variety of services into the broker to authenticate Message Queue clients. This section describes the information that the broker makes available to a JAAS-compliant authentication service, and it explains how you configure the broker to use such a service.

It is beyond the scope of this document to describe the JAAS API. Please consult the following sources if you need to know more.

The JAAS API is a core API in J2SE and therefore it is an integral part of Message Queue's runtime environment. JAAS defines an abstraction layer between an application and an authentication mechanism, allowing the desired mechanism to be plugged in with no change to application code. In the case of the Message Queue service, the abstraction layer lies between the broker (application) and an authentication provider. By setting a few broker properties, it is possible to plug in any JAAS-compliant authentication service and to upgrade this service with no disruption or change to broker code.

You can use JMX clients to manage the broker if you are using JAAS-based authentication, but you must manually set up JAAS support (by setting JAAS-related broker properties) before you start the broker. You cannot use the JMX API to change those properties.

Elements of JAAS

Figure 1–1 shows the basic elements of JAAS: a JAAS client, a JAAS-compliant authentication service, and a JAAS configuration file.

Figure 1–1 JAAS Elements

This figure shows the elements required for JAAS-compliant
authentication. The text that introduces the figure explains its content.

The next section explains how the Message Queue service uses these elements to provide JAAS-compliant authentication.

JAAS and Message Queue

The next figure shows how JAAS is used by the Message Queue broker. It shows a more complex implementation of the JAAS model shown in the previous figure.

Figure 1–2 How Message Queue Uses JAAS

The figure shows how JAAS-compliant authentication is
used with Message Queue. The text that follows the figure explains its contents.

As was shown in the simpler case, the authentication service layer is separate from the broker. The authentication service consists of one or more login modules (LoginModule) and of additional authentication modules if needed. The login modules run in the same Java virtual machine as the broker. The Message Queue broker is represented to the login module as a LogInContext and it communicates with the login module by means of a CallBackHandler that is part of the broker runtime code.

The authentication service also supplies a JAAS configuration file that contains entries to the login modules. The configuration file specifies the order in which the modules are to be used and some conditions for their use. When the broker starts up, JAAS locates the configuration file by the Java system property or the Java security properties file. It then selects an entry in the JAAS configuration file, according to the value of the broker property That entry specifies which login modules will be used for authentication. As the figure shows, it is possible for the broker to use more than one login module. (The relation between the configuration file, the login module, and the broker is shown in Figure 1–3.)

The fact that the broker uses a JAAS plug-in authentication service remains completely transparent to the Message Queue client. The client continues to connect to the broker as it did before, passing a user name and password. In turn, the broker uses a callback handler to pass this information to the authentication service, and the service uses that information to authenticate the user and return the results. If authentication succeeds, the broker grants the connection; if it fails, the client runtime returns a JMS security exception that the client must handle.

After the Message Queue client is authenticated, if there is further authorization to be done, the broker proceeds as it would normally; it consults the access control file to determine whether the authenticated client is authorized to perform the actions it undertakes: accessing a destination, consuming a message, browsing a queue, and so on.

Setting up JAAS-Compliant Authentication

Setting up JAAS-compliant authentication involves setting broker and system properties to select this type of authentication, to specify the location of the configuration file, and to specify the entries to the login modules that are going to be used.

This section illustrates how the JAAS client, the login modules, and the JAAS configuration file are related and then describes the process required to set up JAAS-compliant authentication. The next figure shows the relation between the configuration file, the login module, and the broker.

Figure 1–3 Setting Up JAAS Support

This figure shows the relationship between JAAS-related
files. The text following the figure explains its content.

As shown in the figure, the JAAS configuration file, MyJAASCFile.config contains references to several login modules, grouped in an entry point. The broker locates the configuration file by consulting the Java system property or by consulting the Java Security properties file. The login modules to be used are determined by consulting the broker property, which specifies the desired entry in the configuration file. The classes for those modules are found in the lib/ext directory.

To set up JAAS support for Message Queue, you must complete the following steps. (In a development environment all these steps might be done by the developer. In a production environment, the administrator would take over some of these tasks.)

  1. Create one or more login module classes that implement the authentication service. The JAAS callback types that the broker supports are listed below.

    The broker uses this callback to pass the authentication service the locale in which the broker is running This value can be used for localization.

    The broker uses this callback to pass to the authentication service the user name specified by the Message Queue client when the connection was requested.

    The broker uses this callback to specify the value of imq.authentication.type to the authentication service when the TextInputCallback.getPrompt() is imq.authentication.type. Right now, the only possible value for this field is basic. This indicates Base-64 password encoding.

    The broker uses this callback to pass to the authentication service the password specified by the Message Queue client when the connection was requested.

    The broker uses this callback to provide logging services to the authentication service by logging the text output to the broker's log file. The callback's MessageType ERROR, INFORMATION, WARNING are mapped to the broker log levels ERROR, INFO, and WARNING respectively.

  2. Create a JAAS configuration file with entries that reference the login module classes and specify the location of this file to the Message Queue administrator. (The file can be located remotely, and its location can be specified with a url.)

  3. Note the name of the entry (that references the login implementation classes) in the JAAS configuration file.

  4. Archive the classes that implement the login modules to a jar file, and place the jar file in the Message Queue lib/ext directory.

  5. Configure the broker properties that relate to JAAS support. These are described in Table 1–2.

  6. Set the following system property to specify the location of the JAAS configuration file.

    For example, you can specify the configuration file when you start the broker.


    There are other ways to specify the location of the JAAS configuration file. For additional information, please see

The following table lists the broker properties needed to set up JAAS support.

Table 1–2 Broker Properties for JAAS Support




Set to basic to indicate Base-64 password encoding. This is the only permissible value for JAAS authentication.


Set to jaas to specify JAAS authentication.


Set to file.

Set to the name of the desired entry (in the JAAS configuration file) that references the login modules you want to use as the authentication mechanism. This is the name you noted in Step 3.


This property, used by Message Queue access control, specifies the implementation class in the login module(s) that the broker uses to extract the Principal name to represent the user entity in the Message Queue access control file. If, it is not specified, the user name passed from the Message Queue client when a connection was requested is used instead.


This property, used by Message Queue access control, specifies the implementation class in the login module(s) that the broker uses to extract the Principal name to represent the group entity in the Message Queue access control file. If, it is not specified, the group rules, if any, in the Message Queue access control file are ignored.

Persistent Store Format Change

Version 4.1 of Message Queue changes the JDBC store to support high availability. For this reason the JDBC store version is increased to 410. JDBC store versions 350, 370, and 400 are automatically migrated to the 410 version format.

Please note that the file-based persistent store version remains 370 because no changes were made to it.

Broker Configuration

The property IMQ_DEFAULT_EXT_JARS has been added to the imqenv.conf file. You can set this property to specify the path names of external .jar files to be included in CLASSPATH when the broker starts up. If you use this property to specify the location of external .jar files, you will no longer need to copy these files to the lib/ext directory. External jars can refer to JDBC drivers or to JAAS login modules. The following sample command, specifies the location of jdbc drivers.


JES Monitoring Framework Support

Message Queue supports the Sun Java Enterprise System (JES) Monitoring Framework, which allows Java Enterprise System components to be monitored using a common graphical interface. This interface is implemented by a web-based console called the Sun Java System Monitoring Console. If you are running Message Queue along with other JES components, you might find it more convenient to use a single interface to manage all these components.

The JES monitoring framework defines a common data model (CMM) to be used by all JES component products. This model enables a centralized and uniform view of all JES components. Message Queue exposes the following objects to the JES monitoring framework:

Each one of these objects is mapped to a CMM object whose attributes can be monitored using the JES monitoring console. At runtime, administrators can use the console to view performance statistics, create rules to monitor automatically, and acknowledge alarms. For detailed information about the mapping of Message Queue objects to CMM objects, see the Sun Java Enterprise System Monitoring Guide.

To enable JES monitoring, you must do the following

  1. Install and configure all the components in your deployment (Message Queue and other components) according to instructions given in the Sun Java Enterprise System Installation Guide.

  2. Enable and configure the Monitoring Framework for all of your monitored components, as described in the Sun Java Enterprise System Monitoring Guide.

  3. Install the Monitoring Console on a separate host, start the master agent, and then start the web server, as described in the Sun Java Enterprise System Monitoring Guide.

Using the JES Monitoring Framework will not impact broker performance because all the work of gathering metrics is done by the monitoring framework, which pulls data from the broker's existing monitoring data infrastructure.

Transaction Management

Previously, only transactions in a PREPARED state were allowed to be rolled back administratively. That is, if a session that was part of a distributed transaction did not terminate gracefully, the transaction remained in a state that could not be cleaned up by the broker administrator. In Message Queue 4.1, you can use the imqcmd utility to clean up (roll back) transactions that are in the following states: STARTED, FAILED, INCOMPLETE, COMPLETE, PREPARED.

To help you determine whether a particular transaction can be rolled back (especially when it is not in a PREPARED state), the imqcmd utility provides additional data as part of the imqcmd query txn output: it provides the connection id for the connection that started the transaction and specifies the time when the transaction was created. Using this information, the administrator can decide whether the transaction needs to be rolled back. In general, the administrator should avoid rolling back a transaction prematurely.

Fixed Ports for C Client Connections

C clients can use the MQ_SERVICE_PORT_PROPERTY connection property to specify a fixed port to connect to. This can be useful if you're trying to get through a firewall or if you need to bypass the broker's port mapper service (which assigns ports dynamically).

Remember that you need to configure the JMS service port on the broker side as well. For example, if you want to connect your client via ssljms to port 1756, you would do the following.

Note –

The MQ_SERVICE_PORT_PROPERTY connection property was introduced with version 3.7 Update 2 of Message Queue.

Hardware and Software Requirements

For hardware and software requirements for Version 4.1, please consult the Sun Java System Message Queue 4.1 Installation Guide.

About Message Queue 4.0

Message Queue 4.0 is a release limited to supporting Application Server 9 PE. It is a minor release that includes a few new features, minor enhancements, and bug fixes. This section includes the following information.

What’s New in the 4.0 Release

Message Queue 4.0 includes the following new features:

These are described in the following subsections.

Caution – Caution –

One of the more minor but potentially disruptive changes introduced with version 4.0 is the deprecation of the command-line option to specify a password. Henceforth, you must store all passwords in a file as described in Deprecated Password Option.

Interface Changes to the C API and C Client Runtime

Version 4.0 of Message Queue adds two new properties which will be set on all messages that have been placed on the dead message queue.

Interface Changes to the Java API and the Java Client Runtime

Version 4.0 of Message Queue adds two new properties which will be set on all messages that have been placed on the dead message queue.

Displaying Information About the Persistent Store

The query subcommand was added to the imqdbmgr command. Use this subcommand to display information about the persistent store, including the store version, the database user, and whether the database tables have been created.

The following is an example of the information displayed by the command.

imqdbmgr query

[04/Oct/2005:15:30:20 PDT] Using plugged-in persistent store:
        database connection url=jdbc:oracle:thin:@Xhome:1521:mqdb
        database user=scott
Running in standalone mode.
Database tables have already been created.

Persistent Store Format Changes

Version 3.7 UR1 of Message Queue introduced two changes to the persistent store format to improve performance. One change is to the file store, the other is to the JDBC store.

Because these changes impact store compatibility, the store version for both the file store and the JDBC store was changed from 350 to 370 in version 3.7 UR1 of Message Queue.

Version 4.0 of Message Queue introduced changes to the JDBC store for optimization and to support future enhancements. For this reason the JDBC store version was increased to 400. Note that in Version 4.0, the file-based persistent store version remains 370 because no changes were made to it.

Message Queue 4.0 supports automatic conversion of the persistent store to the newest versions of the file-based and JDBC persistent stores. The first time imqbrokerd starts, if the utility detects an older store it will migrate the store to the new format, leaving the old store behind.

If you should need to roll back this upgrade, you can uninstall Message Queue 4.0 and then reinstall the version you were previously running. Since the older copy of the store is left intact, the broker can run with the older copy of the store.

Broker Administration

The Command utility (imqcmd) has added a subcommand and several options that allow administrators to quiesce the broker, to shutdown the broker after a specified interval, to destroy a connection, or to set java system properties (for example, connection related properties.)

For complete information about the syntax of the imqcmd command, see Chapter 13, Command Line Reference, in Sun Java System Message Queue 4.1 Administration Guide.

JDBC Persistence Support

Apache Derby Version 10.1.1 is now supported as a JDBC-compliant persistent store provider.

SSL Support

Starting with release 4.0, the default value for the client connection factory property imqSSLIsHostTrusted is false. If your application depends on the prior default value of true, you need to reconfigure and to set the property explicitly to true.

You might choose to trust the host when the broker is configured to use self-signed certificates. In this case, in addition to specifying that the connection should use an SSL-based connection service (using the imqConnectionType property), you should set the imqSSLIsHostTrusted property to true.

For example, to run client applications securely when the broker uses self-signed certificates, use a command like the following.

java -DimqConnectionType=TLS 
      -DimqSSLIsHostTrusted=true <ClientAppName>

To run the administration tool imqcmd securely when the broker uses self-signed certificates, use a command like the following.

imqcmd list svc -secure -DimqSSLIsHostTrusted=true

JMX Support

A new API has been added for configuring and monitoring Message Queue brokers in conformance with the Java Management Extensions (JMX) specification. Using this API, you can configure and monitor broker functions programmatically from within a Message Queue client application. In earlier versions of Message Queue, these functions were accessible only from the command line or the Administration Console.

The API consists of a set of JMX Managed Beans (MBeans) for managing the following Message Queue–related resources:

These MBeans provide attributes and operations for synchronously polling and manipulating the state of the underlying resources, as well as notifications that allow a client application to listen for and respond asynchronously to state changes as they occur. Using the JMX API, client applications can perform configuration and monitoring tasks like the following:

For an introduction to the JMX API and for complete reference information, see the Sun Java System Message Queue 4.1 Developer’s Guide for JMX Clients.

Broker Support: JMX-Related Properties

Several new broker properties have been added to support the JMX API (see Table 1–3). None of these properties can be set from the command line with the Message Queue Command utility (imqcmd). Instead, they can either be set with the -D option of the Broker utility (imqbrokerd) or edited by hand in the broker's instance configuration file ( In addition, some of these properties (imq.jmx.rmiregistry.start, imq.jmx.rmiregistry.use, imq.jmx.rmiregistry.port) can be set with the new Broker utility options described in Table 1–4. The table lists each option, specifies its type, and describes its use.

Table 1–3 New Broker Properties for JMX Support






Specifies whether to start RMI registry at broker startup.

If true, the broker will start an RMI registry at the port specified by imq.jmx.rmiregistry.port and use it to store the RMI stub for JMX connectors. Note that the value of imq.jmx.rmiregistry.use is ignored in this case.

Default value: false



Specifies whether to use an external RMI registry.

Applies only if imq.jmx.rmiregistry.start is false.

If true, the broker will use an external RMI registry at the port specified by imq.jmx.rmiregistry.port to store the RMI stub for JMX connectors. The external RMI registry must already be running at broker startup.

Default value: false



Port number of RMI registry

Applies only if imq.jmx.rmiregistry.start or imq.jmx.rmiregistry.use is true. JMX connectors can then be configured to use the RMI registry by including this port number in the URL path of their JMX service URLs.

Default value: 1099



Names of preconfigured JMX connectors, separated by commas

Default value: jmxrmi,ssljmxrmi



Names of JMX connectors to be activated at broker startup, separated by commas

Default value: jmxrmi



urlPath component of JMX service URL for connector connectorName

Useful in cases where the JMX service URL path must be set explicitly (such as when a shared external RMI registry is used).

Default value: If an RMI registry is used to store the RMI stub for JMX connectors (that is, if imq.jmx.registry.start or imq.jmx.registry.use is true)


If an RMI registry is not used (the default case, imq.jmx.registry.start and imq.jmx.registry.use both false):


where rmiStub is an encoded and serialized representation of the RMI stub itself




Specifies whether to use a Secure Socket Layer (SSL) for connector connectorName.

Default value: false



Specifies whether to trust any certificate presented by broker for connector connectorName.

Applies only when imq.jmx.connector.connectorName.useSSL is true.

If false, the Message Queue client runtime will validate all certificates presented to it. Validation will fail if the signer of the certificate is not in the client's trust store.

If true, validation of certificates is skipped. This can be useful, for instance, during software testing when a self-signed certificate is used.

Default value: false

The imq.jmx.connector.list property defines a set of named JMX connectors to be created at broker startup; imq.jmx.connector.activelist specifies which of these are to be activated. Each named connector then has its own set of properties:




By default, two JMX connectors are created, named jmxrmi and ssljmxrmi; the first is configured not to use SSL encryption (imq.jmx.connector.jmxrmi.useSSL = false, the second to use it (imq.jmx.connector.ssljmxrmi.useSSL = true). By default, only the jmxrmi connector is activated at broker startup; see SSL Support for JMX Clients for information on how to activate the ssljmxrmi connector for secure communications.

For convenience, new options (Table 1–4) are also added to the command-line Broker utility (imqbrokerd) to control the usage, startup, and port for the RMI registry. The use and effects of these options are the same as those of the equivalent broker properties, as described in Table 1–3. The table lists each option, specifies its equivalent broker property, and describes its use.

Table 1–4 New Broker Utility Options for JMX Support


Equivalent Broker Property 




Specifies whether to start RMI registry at broker startup.



Specifies whether to use external RMI registry.



The port number of RMI registry

A new subcommand (Table 1–5) is added to the command-line Command utility (imqcmd) for listing the JMX service URLs of JMX connectors created and started at broker startup. This information is needed by JMX clients that do not use the Message Queue convenience class AdminConnectionFactory to obtain their JMX connectors, and can also be used for managing or monitoring Message Queue via a generic JMX browser such as the Java Monitoring and Management Console (jconsole).

Table 1–5 New Command Utility Subcommand



list jmx

List JMX service URLs of JMX connectors

SSL Support for JMX Clients

As mentioned above, a Message Queue message broker is configured by default for insecure communication using the preconfigured JMX connector jmxrmi. Applications wishing to use the Secure Socket Layer (SSL) for secure communication must activate the alternate, secure JMX connector, ssljmxrmi. This requires the following steps:

  1. Obtain and install a signed certificate in the same way as for the ssljms, ssladmin, or cluster connection service, as described in the Message Queue Administration Guide.

  2. Install the root certification authority certificate in the trust store if necessary.

  3. Add the ssljmxrmi connector to the list of JMX connectors to be activated at broker startup:


  4. Start the broker with the Message Queue Broker utility (imqbrokerd), either passing it the key-store password in a password file or typing it from the command line when prompted.

  5. By default, the ssljmxrmi connector (or any other SSL-based connector) is configured to validate all broker SSL certificates presented to it. To avoid this validation (for instance, when using self-signed certificates during software testing), set the broker property imq.jmx.connector.ssljmxrmi.brokerHostTrusted to true.

On the client side, the administrator connection factory (AdminConnectionFactory) must be configured with a URL specifying ssljmxrmi as the preferred connector:

AdminConnectionFactory  acf = new AdminConnectionFactory();
acf.setProperty(AdminConnectionConfiguration.imqAddress, "mq://myhost:7676/ssljmxrmi");

If needed, use the system properties and to point the JMX client to the trust store.

Client Runtime Logging

This section describes Message Queue 4.0 support for client runtime logging of connection and session-related events.

JDK 1.4 (and above) includes the java.util.logging library. This library implements a standard logger interface that can be used for application-specific logging.

The Message Queue client runtime uses the Java Logging API to implement its logging functions. You can use all the J2SE 1.4 logging facilities to configure logging activities. For example, an application can use the following Java logging facilities to configure how the Message Queue client runtime outputs its logging information:

For more information about the Java Logging API, please see the Java Logging Overview at

Logging Name Spaces, Levels, and Activities

The Message Queue provider defines a set of logging name spaces associated with logging levels and logging activities that allow Message Queue clients to log connection and session events when a logging configuration is appropriately set.

The root logging name space for the Message Queue client runtime is defined as javax.jms. All loggers in the Message Queue client runtime use this name as the parent name space.

The logging levels used for the Message Queue client runtime are the same as those defined in the java.util.logging.Level class. This class defines seven standard log levels and two additional settings that you can use to turn logging on and off.


Turns off logging.


Highest priority, highest value. Application-defined.












Lowest priority, lowest value. Application-defined.


Enables logging of all messages.

In general, exceptions and errors that occur in the Message Queue client runtime are logged by the logger with the javax.jms name space.

The following tables list the events that can be logged and the log level that must be set to log events for JMS connections and for sessions.

The following table describes log levels and events for connections.

Table 1–6 Log Levels and Events for javax.jms.connection Name Space

Log Level 



Connection created 


Connection started 


Connection closed 


Connection broken 


Connection reconnected 


Miscellaneous connection activities such as setClientID


Messages, acknowledgments, Message Queue action and control messages (like committing a transaction)  

For sessions, the following information is recorded in the log record.

The table below describes log levels and events for sessions.

Table 1–7 Log Levels and Events for javax.jms.session Name Space

Log Level 



Session created 


Session closed 


Producer created 


Consumer created 


Destination created 


Miscellaneous session activities such as committing a session. 


Messages produced and consumed. (Message properties and bodies are not logged in the log records.) 

By default, the output log level is inherited from the JRE in which the application is running. Check the JRE_DIRECTORY/lib/ file to determine what that level is.

You can configure logging programmatically or by using configuration files, and you can control the scope within which logging takes place. The following sections describe these possibilities.

Using the JRE Logging Configuration File

The following example shows how you set logging name spaces and levels in the JRE_DIRECTORY/lib/ file, which is used to set the log level for the Java runtime environment. All applications using this JRE will have the same logging configuration. The sample configuration below sets the logging level to INFO for the javax.jms.connection name space and specifies that output be written to java.util.logging.ConsoleHandler. file.
# "handlers" specifies a comma separated list of log Handler 
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.

	handlers= java.util.logging.ConsoleHandler

# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility-specific level.
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.

    .level= INFO

# Limit the messages that are printed on the console to INFO and above.

    java.util.logging.ConsoleHandler.level = INFO
    java.util.logging.ConsoleHandler.formatter = 

# The logger with javax.jms.connection name space will write
# Level.INFO messages to its output handler(s). In this configuration 
# the ouput handler is set to java.util.logging.ConsoleHandler.

    javax.jms.connection.level = INFO

Using a Logging Configuration File for a Specific Application

You can also define a logging configuration file from the java command line that you use to run an application. The application will use the configuration defined in the specified logging file. In the following example, configFile uses the same format as defined in the JRE_DIRECTORY/lib/ file.

java -Djava.util.logging.config.file=configFile MQApplication

Setting the Logging Configuration Programmatically

The following code uses the java.util.logging API to log connection events by changing the javax.jms.connection name space log level to FINE. You can include such code in your application to set logging configuration programmatically.

import java.util.logging.*;
//construct a file handler and output to the mq.log file 
//in the system's temp directory.

    Handler fh = new FileHandler("%t/mq.log");
    fh.setLevel (Level.FINE);

//Get Logger for "javax.jms.connection" domain.

    Logger logger = Logger.getLogger("javax.jms.connection");
    logger.addHandler (fh);

//javax.jms.connection logger would log activities   
//with level FINE and above.

    logger.setLevel (Level.FINE);

Connection Event Notification

Connection event notifications allow a Message Queue client to listen for closure and reconnection events and to take appropriate action based on the notification type and the connection state. For example, when a failover occurs and the client is reconnected to another broker, an application might want to clean up its transaction state and proceed with a new transaction.

If the Message Queue provider detects a serious problem with a connection, it calls the connection object's registered exception listener. It calls the listener's onException method, and passes it a JMSException argument describing the problem. The Message Queue provider also offers an event notification API that allows the client runtime to inform the application about connection state changes. The notification API is defined by the following elements:

The following sections describe the events that can trigger notification and explain how you can create an event listener.

Connection Events

The following table lists and describes the events that can be returned by the event listener.

Note that the JMS exception listener is not called when a connection event occurs. The exception listener is only called if the client runtime has exhausted its reconnection attempts. The client runtime always calls the event listener before the exception listener.

Table 1–8 Notification Events

Event Type 



The Message Queue client runtime generates this event when it receives a notification from the broker that a connection is about to be closed due to a shutdown requested by the administrator. 


The Message Queue client runtime generates this event when a connection is closed due to a broker error or when it is closed due to a shutdown or restart requested by the administrator. 

When an event listener receives a ConnectionClosedEvent, the application can use the getEventCode() method of the received event to get an event code that specifies the cause for closure.


The Message Queue client runtime has reconnected to a broker. This could be the same broker to which the client was previously connected or a different broker.  

An application can use the getBrokerAddress method of the received event to get the address of the broker to which it has been reconnected.


The Message Queue client runtime has failed to reconnect to a broker. Each time a reconnect attempt fails, the runtime generates a new event and delivers it to the event listener. 

The JMS exception listener is not called when a connection event occurs. It is only called if the client runtime has exhausted its reconnection attempts. The client runtime always calls the event listener before the exception listener. 

Creating an Event Listener

The following code example illustrates how you set a connection event listener. Whenever a connection event occurs, the event listener's onEvent method will be invoked by the client runtime.

//create an MQ connection factory.

com.sun.messaging.ConnectionFactory factory =
        new com.sun.messaging.ConnectionFactory();

//create an MQ connection.

com.sun.messaging.jms.Connection connection = 
       (com.sun.messaging.jms.Connection )factory.createConnection();

//construct an MQ event listener.  The listener implements 
//com.sun.messaging.jms.notification.EventListener interface.

com.sun.messaging.jms.notification.EventListener eListener = 
       new ApplicationEventListener();

//set event listener to the MQ connection.

connection.setEventListener ( eListener );

Event Listener Examples

In this example, an application chooses to have its event listener log the connection event to the application's logging system:

public class ApplicationEventListener implements
				com.sun.messaging.jms.notification.EventListener {

public void onEvent ( com.sun.messaging.jms.notification.Event connEvent ) {
      	log (connEvent);
private void log ( com.sun.messaging.jms.notification.Event connEvent ) {
	      String eventCode = connEvent.getEventCode(); 
      	String eventMessage = connEvent.getEventMessage();
    	  //write event information to the output stream.

Hardware and Software Requirements

For hardware and software requirements for Version 4.0, please consult the Release Notes for the Sun Java System Application Server Platform Edition 9.

Bugs Fixed in This Release

The following table shows bugs that were fixed in the 4.1 version of Message Queue.

Table 1–9 Bugs Fixed in Message Queue 4.1




Transacted remote messages can be committed twice if the broker originating the message restarts. 


Cannot clean up an uncompleted distributed transaction. 


The commit and rollback options for imqcmd do not prompt for confirmation. 


Default for autocreated queues should be round robin. (MaxNumberConsumers = -1).


Broker log shows ConcurrentModificationException for imqcmd list dst command.


Memory leak when limit behavior is REMOVE_OLDEST or REMOVE_LOWER_PRIORITY.


Broker spins, and client waits for reply to acknowledge. 


Broker does not honor the dead message queue's default limit of 1000 messages. 


Client runtime needs to improve reconnect logic when the client is connected to a high availability cluster by allowing the client to reconnect no matter what the value of the imqReconnectEnabled property is.


Windows automatic startup service (imqbrokersvc) crashes during startup.


Messages are delivered to the wrong consumer when both share a session. 


Produced messages in a PREPARED transaction are delivered out of order if they are committed after broker restarts.

The following table describes the bugs fixed in Message Queue 4.0.

Table 1–10 Bugs Fixed in Message Queue 4.0

Bug Number 



In Message Queue 3.5, calling Session.recover could hang in auto-reconnect mode.


Redelivered flag was set to false for redelivered messages after calling Session.recover.


Change new connection message to include the number of connections on the service in addition to the total number of connections. 


Message Queue outputs garbage message to syslog in locales that use non-ASCII characters for messages. 


Message selection using JMSMessageID doesn't work.


ConcurrentModificationException on connectList during cluster shutdown.


java.nio.BufferOverflowException in java.nio.HeapByteBuffer.putLong/Int.


First message published after startup is slow with Oracle storage.  


Selector processing on JMSXUserID always evaluates to false.


The queue browser shows messages that are part of transactions that have not been committed. 


Connection Flow Control does not work properly when closing a consumer with unconsumed messages. 


Message Queue should not allow two brokers to use the same jdbc tables. 


Master broker does not start up correctly if the system's IP address is changed, unless the store is cleared (using —reset store.)


Message Queue broker needs to set SO_REUSEADDR on the network sockets it opens.


Unable to set ClientID property for TopicConnectionFactory.


The txn log is a performance bottleneck.


Message Queue C API lacks ability to determine the name of a queue from a reply-to header.  


The broker sometimes picks up JDK 1.4 before JDK 1.5 on Solaris even if both versions are installed.  


Multibroker cluster initialization throws java.lang.NullPointerException.


The jms client throws java.lang.NoClassDefFoundError when committing a transaction from the subscriber.


Support MESSAGE type in C-API.


Add Support for Apache Derby database.  

Important Information

This section contains the latest information that is not contained in the core product documentation. This section covers the following topics:

Installation Notes

Refer to the Sun Java System Message Queue 4.1 Installation Guidefor information about pre-installation instructions, upgrade procedures, and all other information relevant to installing Message Queue, Platform Edition on the Solaris, Linux, and Windows platforms.

Refer to the Sun Java Enterprise System Installation Guide for information about pre-installation instructions and all other information relevant to installing Message Queue, Enterprise Edition on the Solaris, Linux, and HPUX platforms.

Refer to the Sun Java Enterprise System Upgrade and Migration Guide for information about upgrade and migration instructions relevant to upgrading to Message Queue Enterprise Edition on the Solaris, Linux, HPUX, and Windows platforms.

Compatibility Issues

This section covers compatibility issues in Message Queue 4.1.

Interface Stability

Sun Java System Message Queue uses many interfaces that may change over time. Appendix B, Stability of Message Queue Interfaces, in Sun Java System Message Queue 4.1 Administration Guide classifies the interfaces according to their stability. The more stable an interface, the less likely it is to change in subsequent versions of the product.

Issues Related to the Next Major Release of Message Queue

The next major release of Message Queue may introduce changes that make your clients incompatible with that release. This information is provided now to allow you to prepare for these changes.

Documentation Updates for Message Queue 4.1

Other than this Release Notes document, Message Queue 4.1 includes only one new document: Sun Java System Message Queue 4.1 Developer’s Guide for JMX Clients. This document was introduced with the 4.0 release of Message Queue. In the 4.1 version, conceptual information has been added that introduces the JMX model.

The Message Queue documentation that was published for Message Queue 3.6 SP3, 2005Q4, is up to date with respect to the needs of Application Server 9 PE clients. This documentation set is available at the following location.

Installation and Upgrade Information

The Sun Java System Message Queue 4.1 Installation Guide was updated to reflect platform-specific information. This document now contains installation and upgrade information relevant to Message Queue 4.1.

Administration Guide

The Administration Guide was updated to provide information about high availability clusters, JAAS support, and JMX support.

Developer's Guide for Java Clients

TheDeveloper’s Guide for Java Clients was updated to reflect the addition of client runtime logging support and of connection event notifications.

Developer’s Guide for C Clients

TheDeveloper’s Guide for C Clients was updated to reflect the addition of the MQGetDestinationName function, of the MQ_Message message type, and of fixed ports.

Known Issues and Limitations

This section contains a list of the known issues with Message Queue 4.1. The following product areas are covered:

For a list of current bugs, their status, and workarounds, Java Developer Connection™ members should see the Bug Parade page on the Java Developer Connection web site. Please check that page before you report a new bug. Although all Message Queue bugs are not listed, the page is a good starting place if you want to know whether a problem has been reported.

Note –

Java Developer Connection membership is free but requires registration. Details on how to become a Java Developer Connection member are provided on Sun’s “For Developers” web page.

To report a new bug or submit a feature request, send mail to

Installation Issues

This section describes issues related to the installation of Message Queue version 4.1.

Product Registry and JES

Version 4.1 of Message Queue is installed by a new installer, which also installs and upgrades the shared components that Message Queue needs; for example, JDK, NSS libraries, JavaHelp, and so on. This installer and the Java Enterprise System (JES) installer do not share the same product registry. If a version of Message Queue that was installed with JES is removed and upgraded to Message Queue 4.1 by the Message Queue installer, the JES product registry may be in an inconsistent state. As a result, when the JES uninstaller is run, it may inadvertently remove Message Queue 4.1 and the shared components upon which it depends, which it did not install.

The best way to upgrade software that was installed by the JES installer is as follows.

  1. Use the JES uninstaller to remove Message Queue and its shared components.

  2. Use the Message Queue installer to install Message Queue 4.1.

Selecting the Appropriate JRE

The Message Queue 4. 1 Installer JDK Selection Screen allows you to select existing JDK/JRE's on the system for use by Message Queue. Unfortunately, the list shown also includes the JRE used to run the installer application. This JRE is part of the installer bundle and is not really installed on the system. (Bug 6585911)

The JRE used by the installer is recognizable by its path, which should be within the unzipped installer directory and should include the subdirectory mq4_1–installer. For example:


Do not select this JRE for use by Message Queue. Instead, select another JDK on the system. If one does not exist, take the action appropriate for your platform.

Installing on Windows

When installing Message Queue on Windows, please note the following limitations.

Installing on Solaris

The error message and “incomplete” summary status misleads user trying to install using the installer-n command. The command actually succeeds. (Bug 6594351)

Installing on Linux

The following issues affect installation on the Linux Platform

Installing on All Platforms

These issues affect installation on all platforms.

Version Information

The installer displays Message Queue version information in an opaque form. (Bug 6586507)

On the Solaris platform, refer to the table below to determine the version being installed.

Table 1–11 Version Formats

Version as Displayed by the Installer 

Message Queue Release 


3.7 UR1 

3.7 UR2 

3.7 UR3 


3.6 SP1 

3.6 SP2 

3.6 SP3 

3.6 SP4 

Note –

For Patch releases to 3.6 SP4 (for example, 3.6 SP4 Patch 1), the releases string displayed by the installer stays the same. You need to run the command imqbrokerd –version to determine the exact version.

On the Linux platform, it is not possible to provide a simple format translation. The version number displayed by the installer on Linux is in the following form.


For example, 3.7–22. This tells us that it is one of the 3.7 releases, but not which specific one. To determine that, run the command imqbrokerd —version.

Localization Issues

The following issues relate to localization problems.

Deprecated Password Option

In previous versions of Message Queue, you could use the —p or —password option to specify a password interactively for the following commands: imqcmd, imqbrokerd, and imdbmgr. Beginning with version 4.0, these options have been deprecated. You must furnish passwords as follows.

  1. Set the password property to the desired value in a file used to store only passwords.

    Use the following syntax to specify passwords in the password file.


  2. Pass the name of the password file using the —passfile option.

A password file can contain one or more of the passwords listed below.

In the following example, the password to the JDBC database is set to abracadabra.


You can configure the broker to use the password file you create in one of the following ways.

General Issues

This section covers general issues in Message Queue 4.1. Some of these were introduced with previous Message Queue versions.

Administration/Configuration Issues

The following issues pertain to administration and configuration of Message Queue

Broker Issues

The following issues affect the Message Queue broker.

Broker Clusters

The following issues affect clustered brokers.

JMX Issues

On the Windows platform, the getTransactionInfo method of the Transaction Manager Monitor MBean returns transaction information that has incorrect transaction creation time (Bug ID 6393359).

Workaround Use the getTransactionInfoByID method of the Transaction Manager Monitor MBean instead.

Support for SOAP

You need to be aware of two issues related to SOAP support

Redistributable Files

Sun Java System Message Queue 4.1 contains the following set of files which you may use and freely distribute in binary form:



imq.jar (HPUX)

imqjmx.jar (UNIX)


mqcrt1.dll (Windows)



In addition, you can also redistribute the LICENSE and COPYRIGHT files.

Accessibility Features for People With Disabilities

To obtain accessibility features that have been released since the publishing of this media, consult Section 508 product assessments (available from Sun upon request) to determine which versions are best suited for deploying accessible solutions. Updated versions of applications can be found at

For information on Sun’s commitment to accessibility, visit

How to Report Problems and Provide Feedback

If you have problems with Sun Java System Message Queue, contact Sun customer support using one of the following mechanisms:

So that we can best assist you in resolving problems, please have the following information available when you contact support:

Sun Java System Software Forum

There is a Sun Java System Message Queue forum available at the following location:

We welcome your participation.

Java Technology Forum

There is a JMS forum in the Java Technology Forums that might be of interest.

Sun Welcomes Your Comments

Sun is interested in improving its documentation and welcomes your comments and suggestions.

To share your comments, go to and click Send Comments. In the online form, provide the document title and part number. The part number is a seven-digit or nine-digit number that can be found on the title page of the book or at the top of the document. For example, the title of this book is Sun Java System Message Queue 4.1 Release Notes, and the part number is 819-7753.

Additional Sun Resources

Useful Sun Java System information can be found at the following Internet locations: