Enabling outbound messaging SendReceiveImmediate services

WebSphere Commerce can interact with other systems through the outbound messaging SendReceiveImmediate (formally Send/Receive) services. This allows WebSphere Commerce to send a message to another system and wait for a reply. The behavior of SendMsgCmd.sendReceiveImmediate() is similar to the SendMsgCmd.sendImmediate() method except that it waits for a return reply from the system receiving its message request.

Note: The 'mode' set under the Administration Console must be set to 1.

After sending the request message, WebSphere Commerce listens to the inbound queue (by default, JMSInboundQueue) and waits until the reply message is placed on the queue with a correlation ID equal to the message ID of the request message.

You should use separate queues for SendReceiveImmediate from the queues used for the WebSphere MQ listener.

To enable WebSphere Commerce to use the SendReceiveImmediate message service, do the following:

  1. Create a message type in the MSGTYPES table for the new message used for the Send/Receive.
  2. To generate the outbound message, create an entry in the VIEWREG table to associate the VIEWNAME created in step 1 with a JSP file. The entry must use the following values:
    INTERFACENAME
    com.ibm.commerce.messaging.viewcommands.MessagingViewCommand
    CLASSNAME
    com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl
    PROPERTIES
    docname=JSP filename

    The value in the VIEWNAME column is the VIEWNAME used to generate the message to send.

  3. Create a JSP file to generate the message to send to the outbound queue. This JSP file name should have been specified when a row is added to the VIEWREG table.
  4. Create or customize a command (task command only, if working with customization) that uses the SendMsgCmd.sendReceiveImmediate() mode and the message type ID created in step 1. This is used to call the SendMsgCmd interface.
  5. Use the Administration Console to ensure that the transport assigned to the SendReceiveImmediate service is active, such as the WebSphere MQ adapter.
  6. Use the Administration Console to define each message type that you created in step 1. In the Mode field specify 1. This indicates a SendReceiveImmediate mode of communication.