Working with the Listener for WebSphere MQ

The Listener for WebSphere MQ (MQ listener, formally MQSeries adapter or Transport Adapter), can be used as an alternative interface to the WebSphere Commerce system and functionality. The Listener for WebSphere MQ not only processes inbound requests, but can provide a reply to the request. Any command that formulates a response can be configured to provide a response through the Listener for WebSphere MQ.

About this task

When an inbound message is received by the Listener for WebSphere MQ it is mapped to a command and that command is called with the parameters specified in the inbound message. If a response is to be generated from this inbound request, an entry in the Struts configuration file is needed. If a response is generated by the command, that response is placed on the outbound queue of the Parallel or Serial connector. The queue that is used depends on which connector received the inbound request.

If an error with the inbound request occurs, the message generating the error is placed on the error queue. To generate an error response to the outbound queue, another entry is needed in the Struts configuration file. This entry maps the error response using the proper device format.

To configure the Listener for WebSphere MQ component to provide responses for inbound messages:

Procedure

  1. Verify that the WebSphere Commerce configuration file includes an Outbound Queue for Parallel and Serial Listeners for Websphere MQ by ensuring that syntax similar to the following is included for the Inbound Parallel and Serial Connector:
    
    <EditableProperty Admin="outQueue" 
          editable="Yes"
          name="setOutboundQueue"
          display="false"
          value="JMSOutboundQueue" />
    

    The JMS queue object, JMSOutboundQueue, specifies the location of the reply message queue. You can define a different names for the Serial and Parallel Listener outbound queues. If you define new names, you must map the names to the MQ queue object by using the WebSphere Application Server Administration Console. See Creating WebSphere MQ messaging provider queue destinations for more information.

  2. Add an entry in the Struts configuration file to define the response needed for the inbound request. This step is required both for existing WebSphere Commerce commands and for new commands. Use the following values:
    VIEWNAME
    The same value as for regular HTTP responses
    INTERFACENAME
    com.ibm.commerce.messaging.viewcommands.MessagingViewCommand
    CLASSNAME
    com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl
    PROPERTIES
    docname=JSP filename
    DEVICEFMT_ID
    -20000
    For XML inbound messages
    -30000
    For legacy inbound messages

    Refer to the topic Representing view implementations: action-mappings and global-forwards for directions.