Sending a message to the message types that support File and Short Message Service (SMS)

File and Short Message Service (SMS) transports are two of the many WebSphere Commerce Messaging subsystem transports. To send a message to these transports, use the WebSphere Commerce Messaging subsystem API, SendMessageCmd.

File transports are used to create messages for the My Portal Alert portlet.

There are five steps to send a message using the WebSphere Commerce Messaging subsystem API, SendMesageCmd:

  1. Initializing messaging services.
  2. Setting the message content.
  3. Configuring transport attributes.
  4. Managing target lists for messages.
  5. Sending the message.

Initializing the messaging services

To initialize the messaging services you need to know the Message Type ID, the Store ID, and the Message Type priority. There are three Application Program Interfaces (APIs) used to set these parameters:

For File and WebSphere Everyplace Connection Manager transports, the priority is set to 200. The priority can be set to 0, or any number of 100 or greater.

Setting the message content

In this step, the message sender has two ways to compose the message content:

Configuring transport attributes

In this step, there is only one generic API to set all the transport attributes:

public void setConfigData(String key, String value) 

The Short Message Service (SMS) transport and File transport contain the following attributes:

Transport Attribute Description
SMS URL (required) The URL of the WebSphere Everyplace Connection Manager
port (required) The port number used to communicate with the WebSphere Everyplace Connection Manager.
Mode (required) SMS message protocol.
Phone Number List of SMS phone numbers.
Subject The subject of the message.
Sender The sender of the message.

For information about the file transport attributes, see Configuration of transport services used for a message.

The message sender may not need to set up all of these attributes, since default values can be setup during the transport and message type configuration. For example, port and Mode can be setup in the transport configuration steps. This information should not change once configured. If the message sender uses this API to set the transport attributes, the default values that were setup during the transport configuration are ignored.

To send a personal message, the message sender does not need to configure any attributes, as a command called by the Portal.jsp will configure everything.

Failing to supply the required attributes (URL, port and mode) will cause an exception in the WebSphere Commerce Messaging subsystem adapter and the message will not be sent.

Managing target lists for messages

In this step, the message sender is provided with the API to add the member ID to the recipient list.

public void addMember(Long aMember) 

Sending the message

In this final step, the message sender has two APIs to send the message:

public void sendImmediate() 
public void sendTransacted()

Feedback