Develop > Controller layer > Integrate with back-end systems and external applications > Outbound services > Send services
Configuration of transport services used for a message
Use the following generic methods of the SendMsgCmd command to configure the transport services used for the message:
public void setConfigData(String key, String value) public void setNLConfigData(String key, String language, String value)
These generic methods of the SendMsgCmd command allow the user to configure the transport services used for the message. The key parameter refers to the administration name used to identify the attribute to be changed. The value parameter is the value to be assigned. Invoking these methods will cause the values specified here to override the values assigned in the Administration Console. The latter method allowing native language sensitive configuration data to be set. Refer to the table below containing the default transports available to the messaging system, and the attributes that apply to each.
The language parameter represents the LANGUAGE_ID found in the LANGUAGE table. For example, the subject field found in the following table. See the addMember method for an alternative way of setting e-mail recipients. See the API for information about the Messaging class.
Configuration attributes
The table below shows how the key parameter can be used to configure the message. The default transports available to the Messaging System use the attributes listed in the table.
Notes:
- If the transport to use is not in the list, you can develop the own, following the examples in the Sample adapter topic.
- Attribute keys are case sensitive
- For email addresses:
- Multiple addresses must be separated by a comma.
- RFC 822 internet e-mail addresses that contain spaces must be enclosed in double quotation marks. For example "My company<myco@mycompany.com>".
- All JMS queue names and the queue connection factory name must correspond with the names of the queue names and queue connection factory defined in the WebSphere Application Server Administration Console.
View overridden properties
The value overridden by the command calling the method cannot be viewed from the Administration Console. However, once the message is created, and before it is sent by the SendTransactedMsg scheduler job, it can be viewed:
- Open the Administration Console and select Site on the Administration Console Site/Store Selection page.
- Navigate to Monitoring > View Unsent Messages.
- Select the desired transport with the Delivery status as Pending.
- Click Search.
- Click the message ID of the last message on the last page.
- The overridden properties, with other properties, are displayed at the top of the page.
Transport Attribute key Description E-mail adapter username The user name used to logon to SMTP server. Once the user name is specified, an SSL connection to the SMTP server is required.
password The password assigned to authenticate SMTP server usage. subject The subject of the e-mail. You can specify one subject per locale. recipient The e-mail address of the recipient(s). sender The e-mail address of the sender. host Specify the fully qualified hostname or IP address of the SMTP server used to send the message. protocol The protocol used to connect to the mail host. port The SMTP port used to send the message. (In most systems this is 25) retryDuration Specify the period in hours in which to retry the connection to the server without decrementing the retry count. sendPartial The behavior if there are invalid e-mail addresses for multiple recipients. This value will be true if e-mail is still sent if some e-mail addresses are not valid. The value will be false if e-mail is not sent if there are invalid addresses. This property depends on the SMTP server. It is solely the responsibility of the SMTP server to honor this flag.
contentType The content type, for example text/plain or text/html. The default value is text/plain. BCC The e-mail address or addresses to send a blind carbon copy to. CC The e-mail address or addresses to send a carbon copy to. replyTo The reply to address for the e-mail. File adapter location The location of the file to be written. FileName The name of the file to be written. mode The type of write to perform.
- 0 - append, or create if the file does not exist
- 1 - overwrite
Adapter for WebSphere MQ factory Specify the JMS name of the queue connection factory. inQueue The inbound queue used for receiving reply messages when the sendReceiveImmediate sending service is used (by some commands). errorQueue Specify the JMS name of the error queue in which messages are placed that could not be processed. outQueue Specify the JMS name of the outbound queue, in which the outbound messages are placed. timeOut Specify the amount of time in seconds you want the messaging system to wait for a response if send/receive mode (mode = 1) is specified. If no response is received in the specified amount of time, the system will return with a null message. The default value is 60 seconds. mode The mode of outbound message being handled. The default value is 0, which is outbound only. This should be used with the sendImmediate sending service. If 1 is used, the sendReceiveImmediate sending service is used by the invoking command and the command will wait for a reply message until "timeOut" is reached. Otherwise, the timeOut value will not be used. JMSExpiration The time in seconds starting from the dispatch time of a message which the target JMS service provider should keep before removing it from a queue. Default value of 0 implies the message will not be kept until it is removed by a JMS application. JMSPriority The priority of the message. The value ranges from 0 to 9, where 9 is the most urgent. The default value is 4. JMSDeliveryMode Specifies the delivery mode of the message. The message will be delivered in persistent mode when the value is set to 2 and will be delivered in non-persistent mode when the value is set to 1. The default value is queue-dependent. When the message is sent in persistent mode, the message will be persisted to the MQ server and will be available upon restart. For more information, refer to the JMS provider documentation. JMSHeaderPropertyN (where N is an arbitrary unique identifier, for example, 1, 2, 3) Special fields used to store provider-specific header information. If more than one JMSHeaderProperty is needed, a unique digit or other identifier should be appended to the end of the "Admin" attribute of the EditableProperty node (for example from JMSHeaderProperty1 to JMSHeaderPropertyN).
Notes:
To set the JMSExpiration, JMSPriority, and other JMS provider specific header fields of an outbound JMS message, new EditableProperty nodes must be added to the InteractionSpec definition of JCAJMSInteractionSpec:
- setJMSExpiration
- setJMSPriority
- setJMSDeliveryMode
- setJMSHeaderProperty
This definition is found under the OutboundConnector named JMS.
- Backup of the WebSphere Commerce configuration file. Should to reverse this fix, we will need to restore the original xml configuration file.
- Add the following section to it:
<OutboundConnector default="true" id="3" name="JMS" retries="3"> <JNDI JndiName="eis/JCAJMS" display="false" /> ...
<InteractionSpec ClassName="com.ibm.commerce.messaging.adapters.jcajms.JCAJMSInteractionSpec" default="true"> ...
<EditableProperty Admin="JMSExpiration" display="false" editable="Yes" name="setJMSExpiration" value="60" />
<EditableProperty Admin="JMSPriority" display="false" editable="Yes" name="setJMSPriority" value="4" /> <!-- the value ranges from 0 to 9. The default value is 4. -->
<EditableProperty Admin="JMSDeliveryMode" display="false" editable="Yes" name="setJMSDeliveryMode" value="2" /> <!-- the value is 2 for persistent, 1 for non-persistent -->
<EditableProperty Admin="JMSHeaderProperty1" display="false" editable="Yes" name="setJMSHeaderProperty" value="JMS_IBM_MsgType='2'" /> <!-- sample value only -->
<EditableProperty Admin="JMSHeaderPropertyN" display="false" editable="Yes" name="setJMSHeaderProperty" value="JMS_IBM_Format='IBM JMS'" /><!-- sample value only -->
Any outbound messages sent through this connector will have, by default, a JMSExpiration value of 60 seconds. This value can be customized under Administration Console when a message type is assigned to the MQ Transport.
The value specified in the Admin attribute must be unique under the InteractionSpec node. Multiple EditableProperty elements are allowed and optional. If more than one JMSHeaderProperty is needed, a unique digit or other identifier should be appended to the end of the "Admin" attribute of the EditableProperty node (for example from JMSHeaderProperty1 to JMSHeaderPropertyN). You will need to modify the value attribute with the required name-value pair. The value within the name-value pair should be quoted with a single quote (').
- Restart the WebSphere Commerce Server.
- Re-assign the message type to the MQ transport method again. This will ensure that the outbound messages sent under this message type have the corresponding header properties set.
The following additional transports are available as part of WebSphere Commerce version 7:
Transport Attribute key Description SMS-HTTP APIKey The parameter name of the API identifier. APIValue The unique service API identifier associated with the account. CharacterLimit The maximum number of characters in a message. The default value is 160. CustomParameters Additional parameters to be passed to the HTTP API. These URL parameters must be manually encoded.
Endpoint The URL location of the telecommunication service HTTP API. MaxRecipients The maximum number of recipients sent to the gateway in a single request. For gateways that do not support bulk messaging, the value should be set to 1. MessageKey The parameter name of the Message identifier. MessageValue The default message if not overridden by a custom JSP file. Password The Password used for authentication to the service. Passwords are stored as encrypted values using the merchant's key. PasswordKey The parameter name of the Password identifier. RecipientDelimiter The delimiter character for multiple recipients in the recipient parameter. RecipientKey The parameter name of the Recipient identifier. RecipientValue The destination number of the recipient(s). SenderKey The parameter name of the Sender identifier. SenderValue The name or number of the sender. usePostMethod Indicates whether the HTTP-POST method is used. If false, the HTTP-GET method is used. UserNameKey The parameter name of the UserName identifier. UserNameValue The UserName identification for the service. SMS-WS CharacterLimit The maximum number of characters in a message. The default value is 160. Endpoint The URI of the Parlay X 3.0 gateway service. Message The default message if not overridden by a custom JSP file. Password The Password used for authentication to the service. Passwords are stored as encrypted values using the merchant's key. Recipient The destination number of the recipient(s). SenderValue The name or number of the sender. UserNameValue The registered username of this Web Service.
Notes:
When integrating SMS transports in WebSphere Commerce:
- The provided attribute keys are generic name-value pairs common to most gateway services supporting the HTTP API interface. Some of the provided fields can be optional depending on varying available service configurations. The customParameters field provides further customization options, increasing compatibility with various gateway services.
- The provided attribute keys are URL encoded and valid for transmission through a URL string unless specifically stated. Alternatively, the CustomParameters value is not URL encoded, allowing for greater flexibility when managing custom values. Therefore, the customParameters URL parameters must be manually encoded.
- The SMS HTTP adapter is configurable to work with several third party telecommunication gateway services supporting the HTTP interface. Requests are initiated using an HTTP POST request, with the parameter values complying with their individually specified HTTP API.
- The message content corresponding to the MessageKey parameter, and the recipient address corresponding to the RecipientKey parameter are dynamically generated, depending on the message type and customer identity. These fields are passed to the adapter for message delivery after being generated.
- The RecipientDelimiter is used for SMS gateways that support bulk messages with the addresses concatenated into a complete address list, separated by the specified delimiter. This configuration depends on the gateway's handling and interpretation of the delimiter. For example, some gateways support a semicolon as the delimiter, while others support a comma or pipe characters as the delimiter. Therefore, this character is not URL encoded.
The SMS HTTP adapter is configurable to work with other third party telecommunication gateway services supporting the HTTP interface. An example of a third party gateway that supports an HTTP API is the Clickatell gateway.
The request is initiated using an HTTP POST request, with the correct parameter values in compliance with their individually specified HTTP API. The following is an example of a request made to the Clickatell gateway:
http://api.clickatell.com/http/sendmsg?api_id=someAPI&user=someUser&password=somePassword&to=5552221234,5552225678,5552220987&from=someSender&text=This+is+some+message+from+the+SMS+HTTP+adapter&queue=1&concat=2
The parameters should be assigned the following values to send the HTTP POST request using the Clickatell gateway:
Parameter values used to send the HTTP POST request using the Clickatell gateway
Parameter Value APIKey api_id APIValue someAPI CharacterLimit 160 CustomParameters &queue=1&concat=2 Endpoint http://api.clickatell.com/http/sendmsg MaxRecipients 100 MessageKey text Password somePassword PasswordKey password RecipientDelimiter , RecipientKey to SenderKey from SenderValue someSender UserNameKey user UserNameValue someUser usePostMethod true
Related concepts
Related tasks
Assign a message type to a transport method for a site or store
Related reference
Error handling in the messaging system composition service
Example: Using the messaging system composition service