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.
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 VIEWREG table 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 VIEWREG table. 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:
- 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 Connector:
<EditableProperty Admin="outQueue" editable="Yes" name="setOutboundQueue" display="false" value="JMSParallelOutboundQueue" />
The JMS queue object, JMSParallelOutboundQueue, 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. For more information refer to the WebSphere Commerce Additional Software Guide.
- Add an entry in the VIEWREG table 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
For example:
select * from viewreg where devicfmt id=-20000