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 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.
Note: String language, 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.The default transports available to the Messaging System contain the following attributes (attribute keys are case sensitive):
Transport Attribute key Description E-mail adapter username The user name used to logon to SMTP server.
Note: Once the user name is specified, the secure 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.
Note: Multiple recipient e-mail addresses can be specified separated by commas ","sender The e-mail address of the sender. host The mail host 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 The time period in which the connection will be retried to a SMTP server. 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. Note: 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 blind copy field of the e-mail. CC The carbon copy field of the e-mail. 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 InterChange Server userName The user name used to logon to the WebSphere InterChange Server adapter.
iorFile The location of the .ior file, used to establish the IBM WebSphere InterChange Server adapter connection. functionName The function name, which includes the WebSphere InterChange Server collaborationName, port, and verb. Adapter for WebSphere MQ factory The JMS queue connection factory name. inQueue The inbound queue used for receiving reply messages when the sendReceiveImmediate sending service is used (by some commands). errorQueue The error queue where the erratic inbound messages are stored. outQueue The outbound queue where the outbound messages are put. timeOut The time out value (in seconds) used to wait for an optional reply message from an external system. The default value is 60. 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 your 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). The following additional transports are available as part of WebSphere Commerce Enhancements for version 6:
Transport Attribute key Description HTTP Connector and Web Service over HTTP Connectors URL The URL to which the message should be transported contentType The content type of the message userName The user name to be used for authentication. For HTTP over Web Services, this is the user name for the web service. password The password to be used for authentication. For HTTP over Web Services, this is the password for the web service. errorLifeExpectancy As a feature of this particular connector, when an exception occurs when executing the request based on the connection properties, this connector will wait this specified period of time (in seconds) before allowing the same request to execute again. This prevents the backend system from being flooded with a series of requests when it is unavailable or unresponsive. Certain communication exceptions will be caught and cached and assigned this timeout value. When requests based on the same connection information are made, the cached exception will be thrown instead of executing the request. When the timeout expires, the request will be made as usual. The purpose of this is to provide the caller with an exception while trying to avoid making repeated requests to a backend system that currently is not responding. Web Service over JMS Connector factory The JMS queue connection factory name. inQueue The inbound queue used for receiving reply messages when the sendReceiveImmediate sending service is used (by some commands). errorQueue The error queue where the erratic inbound messages are stored. outQueue The outbound queue where the outbound messages are put. userName The user name to be used for basic authentication. password The password to be used for basic authentication. timeOut The time out value (in seconds) used to wait for an optional reply message from an external system. The default value is 60. 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 your 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). targetService The port operation to be invoked. For example, "InventoryServices". The target services can be found in the WSDL for the service provider. 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 your instance.xml file before making any changes to it. Should you want to reverse this fix, restore the original xml configuration file.
- Add the following section to the instance.xml file:
<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 WebSphere Commerce Administration Console when a message type is assigned to the MQ Transport.
Note: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.
(C) Copyright IBM Corporation 1996, 2006. All Rights Reserved.