FastTrack: Message Queue 4.2 (Harrier 2)

Sponsor: Linda Schneider

Release Binding: Minor

Sun Java System Message Queue which also shipped as an open source product under the name Open Message Queue (mq.dev.java.net) is a Message Orientated Middleware provider which implements the Java Message Service Specification.

This is a FastTrack request for minor interface changes in Java System Message Queue 4.2 (HarrierII). 4.2 is a maintenance release to Message Queue 4.1 (WSARC/2006/536). It includes bug fixes and a small number of minor enhancements.

This FastTrack modifies existing interfaces. It adds one new exported interface. It adds 5 new imported interfaces. It does not change the classification or remove any existing interface.

This document contains the final details of the changes to public interfaces or interface tables associated with 4.2. For additional detail about any of the features, see the individual functional specifications listed below.

Overview of Changes

Four minor features were added to 4.2 which impact the product's interfaces:

Specific interface Changes

For those features the following interfaces have been changed to public (Committed or Uncommitted) interfaces:
  1. The C-API defined in WSARC-2002-714
    • MQ C-API public headers and libmqcrt
    • Added a new interface, the name of the xa_switch_t
  2. Modification of syntax used for Destination Names.
    • must be compatible with Well Known Destination Names For Monitoring (WSARC-2002-714)
  3. Additions to the content of messages placed in the broker logs: (last modified WSARC-2006-536)
    • Broker Log Format
  4. The administration CLI (imqcmd), last modified in WSARC-2006-536
    • imqcmd CLI
    • imqcmd Ouput
  5. Changes to the installation GUI, introduced in WSARC-2006-536
    • Several jar files were added to imported interfaces for the registration functionality
    • CLI of installer/uninstaller
    • installer/uninstaler output
  6. The JMX (administration) API defined in WSARC-2004-283
    • MQ MBean Attribute names
    • MQ MBean Operation names
    • MQ MBean Notification type names
  7. JAXP was added as an import for XMLValidation support.

Additional changes have been made to private protocols:

  1. Client/Broker Protocol (Committed Private) - last modified in WSARC-2006-536

Note:For additional detail about these changes, see the associated functional specifications.

C-API and C Client Runtime

The following modifications are being made to the MQ C-API to address XA functionality that was not implemented during the initial API design.

  1. New Function (Callback): MQMessageListenerBAFunc
    
        /**
         * This callback is called before and after MQMessageListenerFunc call
         * for a XA session. The sessionHandle, consumerHandle, messageHandle
         * are for 'read-only' purpose only.  Please do not call MQFreeMessage  
         * for the messageHandle or MQCloseSession for the sessionHandle or 
         * MQCloseMessageConsumer for the consumerHandle in this callback 
         * function or any fuctions called by this callback. Restrictions in 
         * MQMessageListenerFunc callback also applies to this callback type.
         *
         * @param sessionHandle a handle to the session
         * @param consumerHandle a handle to the message consumer
         * @param messageHandle a handle to the message
         * @param errorCode processing status of the current message
         * @param callbackData whatever void * pointer that was passed to
         *        MQCreateAsyncMessageConsumer or MQCreateAsyncDurableMessageConsumer
         * @see MQCreateAsyncMessageConsumer and MQCreateAsyncDurableMessageConsumer. */
        typedef MQError (*MQMessageListenerBAFunc)(const MQSessionHandle  sessionHandle,
                                               const MQConsumerHandle consumerHandle,
                                               const MQMessageHandle  messageHandle,
                                               MQError                errorCode,
                                               void *                 callbackData);
    
  2. New Function: MQGetXAConnection
    
        /**
         * Get a XA connection
         *
         * @param connectionHandle the output parameter that contains the
         *        newly opened connection.
         * @return the status of the function call.  Pass this value to
         *         MQStatusIsError to determine if the call was
         *         successful.
         */
        EXPORTED_SYMBOL MQStatus
        MQGetXAConnection(MQConnectionHandle *connectionHandle);
    
    
  3. Modified (private) Function: MQCreateConnectionExt
    
    
         A new isXA parameter was added to MQCreateConnectionExt (a private method)
    
  4. New Function: MQGetConnectionProperties
    
    
        /**
         * Get the properties of a connection
         *
         * @param connectionHandle the connection handle
         * @param propertiesHandle the output parameter for the properties
         *        of this connection 
         * @return the status of the function call.  Pass this value to
         *         MQStatusIsError to determine if the call was
         *         successful.
         */
        EXPORTED_SYMBOL MQStatus
        MQGetConnectionProperties(const MQConnectionHandle connectionHandle,
                              MQPropertiesHandle *  propertiesHandle);
    
  5. New Function: MQCreateXASession
    
    
        /**
         * Creates a new XA session on a XA connection 
         *
         * For MQ_SESSION_SYNC_RECEIVE receiveMode, pass NULL for 
         * beforeMessageListener, afterMessageListener and callbackData.
         *
         * @param connectionHandle the handle to the XA connection on which
         *        to create a session
         * @param receiveMode synchronous or asynchronous message receiving
         * @param beforeMessageListener callback function before asynchronous message
         *                       delivery 
         * @param afterMessageListener callback function after asynchronous message
         *                       delivery 
         * @param callbackData  data pointer to be passed to the beforeDelivery
         *                      and afterDelivery functions
         * @param sessionHandle the output parameter that contains the
         *        newly created session.
         * @return the status of the function call.  Pass this value to
         *         MQStatusIsError to determine if the call was
         *         successful.  */
        EXPORTED_SYMBOL MQStatus
        MQCreateXASession(const MQConnectionHandle    connectionHandle,
                      MQReceiveMode               receiveMode,
                      MQMessageListenerBAFunc     beforeMessageListener,
                      MQMessageListenerBAFunc     afterMessageListener,
                      void *                      callbackData,
                      MQSessionHandle *           sessionHandle);
    
  6. Declared the name of the xa_switch_t structure: sun_mq_xa_switch

  7. New Error Codes:
    • MQ_THREAD_OUTSIDE_XA_TRANSACTION
    • MQ_XA_SESSION_NO_TRANSACTION
    • MQ_XA_SESSION_IN_PROGRESS
    • MQ_CALLBACK_RUNTIME_ERROR
    • MQ_NOT_XA_CONNECTION
    • MQ_ILLEGAL_CLOSE_XA_CONNECTION

Destination Name Syntax

Extends the syntax of supported destination names for topics by:

Since the wildcard characters (*,** and >) were not previous allowed in a name and . was only allowed in the case of metrics destinations which began with mq., this will not affect any existing applications.

Broker Log Format

The syntax of an individual log message has not changes, and the logs have not been moved. The only changes are new error, warning and info level messages which are associated with the new features.

Administration (CLI) changes

Highlighted sections are new additions.

  1. imqcmd list dst

    Adds two new columns, Wildcard Producers and Wildcard Consumers.

    Listing all the destinations on the broker specified by:
          
    -------------------------
    Host         Primary Port
    -------------------------
    localhost    7676
          
    ------------------------------------------------------------------------------------
       Name     Type    State      Producers        Consumers              Msgs           
                                Total  Wildcard  Total  Wildcard  Count  UnAck  Avg Size
    ------------------------------------------------------------------------------------
    mq.sys.dmq  Queue  RUNNING  0      -         0      -         0      0      0.0
    sun.stock   Topic  RUNNING  1      1         2      2         0      0      0.0
          
    Successfully listed destinations.

  2. imqcmd query dst Adds:
    1. new properties for wildcard topics:
      • Number of Wildcard Producers
      • List of each wildcard producers use with the number of producers using it
      • Number of Wildcard Consumers
      • List of each wildcard consumers use with the number of consumers using it
    2. new properties for XMLValidation:
      • is XML schema validation turned on
      • The list of locations to search for schema
      • Whether the schema should be reloaded (in case it has been updated) if a validation fails
         
    Querying the destination where: ------------------------------------ Destination Name Destination Type ------------------------------------ sun.stock Topic On the broker specified by: ------------------------- Host Primary Port ------------------------- localhost 7676 Destination Name sun.stock Destination Type Topic Destination State RUNNING Created Administratively true
    Current Number of Messages Actual 45 Held in Transaction 0 Current Message Bytes Actual 6390 Held in Transaction 0 Current Number of Producers 1 Current Number of Producer Wildcards 1 sun.* (1) Current Number of Consumers 2 Current Number of Consumer Wildcards 2 sun.* (1) *.stock (1) Max Number of Messages unlimited (-1) Max Total Message Bytes unlimited (-1) Max Bytes per Message unlimited (-1) Max Number of Producers 100 Limit Behavior REJECT_NEWEST Consumer Flow Limit 1000 Is Local Destination false Use Dead Message Queue true XML schema validation enabled true XML schema URI List http://foobar/EmployeeInvoice.EmployeeInvoiceInvoiced.xsd Reload XML schema on failure false
    Successfully queried the destination.
  3. Add support for the new destination attributes used with imqcmd create dst and imqcmd update dst:

    • validateXMLSchemaEnabled - have the client validate the XML either from an XSD provided to the broker or from the DTD in the XML message
    • XMLSchemaURIList - a space separated list of URIs to use to locate the XSD file (if any)
    • reloadXMLSchemaOnFailure - if a failure occurs when processing a message, have the client attempt to reload the XSD (in case it changed)

Installation changes

Installation changes are modifications to the MQ installer to support the optional registration of the product using a Sun Online Account username.

Installation depends on several new imported jar files:

The specific exported interface changes are:

  1. Changes to the XML file used by OpenInstaller when used to install MQ. The changes add the new registration screen (and changes both the GUI and the CUI)
  2. Addition of a new argument (-r) to run just registration.
    installer -h
    Usage: installer [OPTION]
    
    Options:
      -a 
      Specify an answer file to be used by installer in non interactive mode.
    
      -h
      Show usage help
    
      -s
      Silent mode. No output will be displayed.
    
      -t
      Select Text mode instead of GUI mode.
    
      -n 
      Dry run mode. Does not install anything. Your install responses are saved to
       and can be used with -a to replicate this install.
    
      -r
      Register product. Does not install anything. Runs the installer's product
      registration screens.
    
      Exit status
      0     Success
      >0    An error occurred
    
  3. New installer Screens
    • Welcome Page:

      Welcome Page

    • Welcome Page (registration only):

      Welcome Page (registration only)

    • Registration Page:

      • Registration Page (GUI):

        Registration Page (gui)

      • Registration Page (CLI):

        Registration Page (cli)

    • Create a Sun Online Account:

      Sun Online Account Page

    • Registration Progress:

      Registration progress

    • Registration Progress Successful:

      Registration progress successful

    • Registration Progress Error:

      Registration progress error

    • Registration Only Page (Summary):

      Registration Only Page

JMX API changes

JAXP use for XML Validation

The XML Validation processing by the client uses the JAXP implementation. If the client is using a JDK1.5 or later JDK, those classes are available as part of the JRE. For client applications using 1.4 JDK's, the jaxp package must be in the clients classpath.

Client-Broker Protocol Changes

The client-Broker protocol is a committed private API. All changes are compatible with earlier versions of the product. See the individual functional specifications for descriptions of the changes.

Compatibility

MQ 4.2 is compatible with prior 4.X and 3.x releases. The compatibility includes API, protocol level, and administered objects.

For details see the compatibility matrix on:

http://mq.sfbay.sun.com/Wiki.jsp?page=HarrierII

Interfaces

The following interfaces have been modified as described previously.

Exported Interfaces
InterfaceClassificationComments
imqcmd Ouput UncommittedModified for both XML Validation and Wildcard Topic Support. See changes above.
Client/Broker Protocol Committed PrivateChanges are modifications to an existing interface. See individual functional specifications.
Destination Name SyntaxCommittedExtends existing syntax with the addition of *, **, > and .
Broker Log InfomationUncommitted adds new log messages (no format changes)
imqcmd CLICommittedadds new destination attributes
MQ MBean Attributes names Committed adds support for wildcard and XMLValidation operation
MQ MBean Operation namesCommittedadds support for wildcard and XMLValidation operation
MQ MBean Lookup keys for CompositeDataCommittedadds support for wildcard and XMLValidation operation
sun_mq_xa_switchCommittedNew Interface.
Name of the provided xa_switch_t to be used for C-API XA support

Imported Interfaces
InterfaceClassificationComments
JAXP API Standard JDK1.5 or JAXP package if JDK 1.4 is used (https://jaxp.dev.java.net/)

Interface was added in this release.

CLI of installer/uninstallerUncommittedArguments/options of installer script.
installer/uninstaler outputUncommittedOutput of installer script.
install-lib UncommittedDirectory on install media that contains files needed for the registration related screens of the installer. When the installer is invoked, the following is added to CLASSPATH:
  • install-lib/classes
  • jar files under install-lib/registration
Note: This directory is only on the installer media - it is not installed as part of the product.
sysnet-all.jar Contract Private New Interface.
Code that performs the following tasks:
  • create a local Service Tags registry (independent of the one used by 'stclient')
  • transfer information in a local Service Tags Registry to the Global Service Tags Registry
  • validate a Sun Online Account username and password combination
  • create a new Sun Online Account (with specified email, password, and other information)
  • send/register information in local Service Tags Registry to Sun Connection Database
The classes were taken from scn_stprs_util.jar.
registration-api.jarContract PrivateNew Interface
Classes (interfaces, factories, and some supporting classes) that define the registration module for AppServer 9.1 UR1.
registration-impl.jarContract PrivateNew Interface
A wrapper for sysnet-all.jar functionality.
commons-codec-1.3.jar VolatileNew Interface
This jar provides implementations of common encoders and decoders such as Base64 and is used by sysnet-all.jar. It comes from http://commons.apache.org/codec/
Syntax of files for defining
  • flow/order of installer screens
  • labels for screens
  • splash screen image
  • welcome text
  • license page
UncommittedLSARC/2007/099: Added new screens, including their labels and associated text.
Purple Haze engine CLIUncommittedLSARC/2007/095:Used new CLIs for adding install-lib directory to classpath.

References

Message Queue 4.1 (Harrier) WSARC case: http://sac.sfbay.sun.com/arc/WSARC/2006/536

Message Queue 4.2 (HarrierII) Web Site: http://mq.sfbay.sun.com/Wiki.jsp?page=HarrierII

Message Queue 4.2 (HarrierII) feature functional specifications:

Contracts: