Configuring The JMS Adapter
Configuring The JMS Adapter
Document: Configuring the JMS Adapter URL: http://help.sap.com/saphelp_nw73/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/content.htm Date created: August 02, 2013
2013 SAP AG or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
Note This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.
Page 1 of 11
For FAQs about the JMS adapter, see SAP Note 856346.
Prerequisites
You must install the corresponding JMS driver to use the JMS adapter. The required Java libraries are product-specific and can be obtained from either the product vendor or other providers. Following installation, you must deploy the libraries on the AS Java so that the JMS adapter can access the required Java classes at runtime. If you are using MQSeries 53x.xxx, you must enter the following JAR files in com.sap.aii.adapter.lib.sda: com.ibm.mq.jar com.ibm.mqbind.jar com.ibm.mqjms.jar connector.jar (use the JAR file from the AS Java client directory)
Procedure
1. Create a communication channel in the Integration Directory. 2. To configure the adapter, select the Parameters tab page. 3. Select JMS as the Adapter Type.
More Information
For information about connecting asynchronous and synchronous systems, see Async/Sync and Sync/Async Bridges in the JMS Adapter.
Values SonicMQ JMS Provider WebSphereMQ (MQ Series) JMS Provider JNDI JMS Provider Lookup JMS Provider Administered Objects via File Generic JMS Provider
More Information
JMS 1.x Exactly Once Exactly Once In Order No Sender and receiver SAP NetWeaver Library under SAP NetWeaver Process Integration Special Development Tasks Applying Advanced Routing Techniques Using Adapter-Specific Message Attributes in the Message Header Quality of Service
Acknowledgments Module Processor In the module processor, you can specify generic modules that equip the adapter with additional functions. Security
Acknowledgment Support in the Adapter Engine Adding Modules in the JMS Adapter Module Processor SAP NetWeaver PI Security Guide
Prerequisites
There can only be one sender agreement for the defined communication channel.
Procedure
1. Under Transport Protocol, select the JMS provider: SonicMQ JMS Provider WebSphereMQ (non-JMS) Access JMS Provider with JNDI (Read) JMS Provider Administered Objects from File Access JMS Provider Generically 2. The Message Protocol is JMS 1.x. 3. Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine. This selection is not available in the PCK. Defining Connection Parameters 1. Select the Source tab page. 2. If you want to connect to a JMS topic, select the Enable Topic Support checkbox. 3. Depending on the transport protocol you have selected, enter the JMS provider connection parameters. Defining SonicMQ JMS Provider Settings Defining WebSphereMQ (MQ Series) JMS Provider Settings Defining JMS Provider Settings for JNDI Access Specifying Files for Administrable Objects of the JMS Provider Defining Generic Access to the JMS Provider 4. To make additional settings or replace the default settings, select Set Additional JMS Parameters or Replace Default Settings and enter the parameters and values in the table.
Example
For example, you can set the following parameters and values: JMSMessageClass with value com.ibm.jms.JMSMessage JMS.Messag.method.setStringProperty with value java.lang.String XAppId, java.lang.String myapp
Page 3 of 11
1. Specify the Initial context properties name and value in the table. Before SAP NW PI 7.20 release, initial context properties could be specified in the Additional Parameters table. Now this can be specified as: Name propertyName Value propertyValue
Note
Both propertyName and propertyValue are Strings. This table is available only if you select the Transport Protocol as JNDI JMS Provider Lookup.
Defining JMS Settings 1. Select the Processing tab page. 2. If you want to use a transactional JMS session, select Transactional JMS Session.
Note
The transactional JMS Session is the default setting and is recommended. If you do not use this setting, then the message delivery is not guaranteed. The message can be lost in such a case. Following processing of a message, a transactional session ends either with a COMMIT, or in the case of an error, with a ROLLBACK. 3. Enter the User and the Password with confirmation for accessing the JMS Queue/Topic . 4. Under JMS Message Selector, specify conditions that a JMS message in the specified JMS queue must fulfill to be processed by the sender adapter. For more information about the JMS message selector, see java.sun.com/j2ee/sdk_1.3/techdocs/api/index.html under javax.jms and Message. Defining Correlation Settings 1. Determine which algorithm is to be used to create the message ID of a new PI message. The ID must be a Globally Unique Identifier (GUID) according to ISO 11578. If the message ID is not a GUID, message processing fails. If the ID is not unique, this can result in message duplicates. This can also lead to a GUIDFormatException. Set the P I Message IDTo: GUID (Recommended Value) JMSMessageID (Uniqueness Is JMS-Provider-Dependent) JMSCorrelationID (Uniqueness Is JMS-Sender-Dependent) JMSProperty (Uniqueness Is JMS-Sender-Dependent) Enter the JMS Property Name. This value is set for the PI message ID. If the JMSCorrelationID or JMSProperty are not set in the JMS message, a message ID is generated automatically. If you have selected JMSMessageID, JMSCorrelationID, or JMSProperty and entered a JMS message ID in these fields, select Remove 'ID:' Marker from JMSMessageID indicator. The JMS specification stipulates that each JMS message ID starts with 'ID'. However, this conflicts with ISO-11578. Set PI Conversation ID (ConversationID) To: No value The PI Conversation ID is not set. JMSMessageID (Uniqueness Is JMS-Provider-Dependent) JMSCorrelationID (Uniqueness Is JMS-Sender-Dependent) JMSProperty (Uniqueness Is JMS-Sender-Dependent) Enter the JMS Property Name. This value is set for the PI message ID. Stored JMSCorrelationID of request The saved JMSCorrelationID of the request is used. Defining the Duplicate Handling Settings If you want to set an alert for the duplicate messages, select Enable Duplicate Handling, then perform the following substeps. 1. Enter Duplicate Message Threshold to set a value, beyond which an alert will be raised for the duplicate messages.
Example
If you enter a value n for duplicate message threshold, an alert will be raised for the n+1 duplicate message. 2. If you want to disable the channel (that is to stop further processing of messages) after the duplicate threshold is exceeded, select Disable Channel If Threshold Exceeded If you want the duplicate messages received from different channels (that is JMS Messages with the same Message ID) to be processed as a distinct JMS messages and not as duplicate messages, select Prefix Channel ID to JMS Message ID
Note
You use this option only for channels connecting to JMS Queue. This is a default function for channels connecting to JMS Topic.
Page 4 of 11
If you want to receive messages from the JMS Provider using message listener, select Use Message Listener Based Connector. If you want to receive messages from the JMS provider using message polling, then perform the following substeps. 1. Enter the Message Poll Interval (msecs) to specify the time period between the calls to receive messages from the JMS provider destinations. 2. Enter the Message Receive Wait Time (msecs) to specify the timeout value specified to the receive() call used for receiving messages from JMS Provider destinations.
Note
This is default approach to receive messages from the JMS provider. Message Polling based approach for receiving messages from JMS Provider destinations is the recommended approach.
Defining PI Settings 1. Select the Mapping of Message: If you want the JMS payload to contain the entire message, choose Entire Message = JMS Payload. If you only want the JMS payload to contain the payload of the message, choose Message Payload = JMS Payload. 2. In the Quality of Service drop-down, choose the type of quality of service (QoS) and perform the following sub-steps:. 1. In the Queue ID field, enter the queue ID.
Note
This option is available only for the Exactly Once in Order QoS. 2. In the Processing J2EE Cluster Server (Cluster ID) field, enter the cluster ID of the node on which you want the JMS adapter to process the message.
Note
If you do not specify the cluster ID, the JMS adapter executes the message on the first available node in the cluster. This option is not applicable for channels that connect to JMS queues and have an Exactly Once QoS. Channels connecting to JMS topics are active on only one node irrespective of the QoS configuration. For more information, see Quality of Service 3. To check for duplicate messages, IDs must be saved in the database. To prevent the database from getting unnecessarily large, these IDs are deleted after a certain amount of time. Under Time Period for Duplicate Check for EO(IO) (secs), specify when the IDs are to be deleted. For example, if you check message monitoring daily, deletion can take place after one day. Defining Error Handling Settings 1. Under Wait After Message Error (msecs), enter the number of milliseconds that the adapter must wait when a processing error occurs, before further messages are processed. In transactional processing, it can make sense to specify a certain time period, for example, because messages with errors remain in the queue following a ROLLBACK. 2. Under Wait Before Reconnect (msecs), specify a period of time after which an attempt is made to reestablish a connection following a connection error on the JMS side. If you enter -1, no attempt is made to reestablish the connection. Your JMS provider must support the registration of an ExceptionListener for this. Defining Adapter-Specific Message Attributes 1. Select the Advanced tab page. 2. To save adapter attributes in the message header of the PI message, select Set Adapter-Specific Message Attributes . To apply the following attributes in the PI message header, set the corresponding indicators: JMS Message Correlation ID: (technical name: DCJMSCorrelationID) JMS Message Delivery Mode: (technical name: DCJMSDeliveryMode) JMS Message Destination: (technical name: DCJMSDestination) JMS Message Expiration: (technical name: DCJMSExpiration) JMS Message ID: (technical name: DCJMSMessageID) JMS Message Priority : (technical name: DCJMSPriority) JMS Message Redelivered Flag: (technical name DCJMSRedelivered) JMS Message ReplyTo Destination: (technical name: DCJMSReplyTo) JMS Message Time Stamp: (technical name: DCJMSTimestamp) JMS Message Type: (technical name: DCJMSType) Used JMS Message Selector: (technical name: DCJMSMessageSelector) Used JMS Message Queue: (technical name: DCJMSMessageQueue) JMS User: (technical name: DCJMSUser) If you want to set additional JMS message attributes, select Specify Additional JMS Message Properties (Maximum of 10). In the table, enter the names of the JMS message properties whose values are to be included in the message header of the PI message. The technical names of the additional attributes are DCJMSMessageProperty0, DCJMSMessageProperty1, ..., DCJMSMessageProperty9. You can enter more than ten properties in the table. However, only the first ten are taken into account. The attribute namespace for the adapter is http://sap.com/xi/XI/System/JMS. Defining the Adapter Status
Page 5 of 11
1. Set the adapter to Active to enable messages to be exchanged. Defining Additional Parameters Specify the additional parameter Names and parameter Values in the table.
Example
For example, if you are connecting to a third party JMS provider you can enter the client ID and its corresponding value for each channel. However, these are specific to the third-party provider. For more information , see the documentation of the third-party provider.
Procedure
1. Under Transport Protocol, select the JMS provider: SonicMQ JMS Provider WebSphereMQ (MQ Series) JMS Provider JNDI JMS Provider Lookup JMS Provider Administered Objects via File Generic JMS Provider 2. Select the Message Protocol as JMS 1.x. 3. Select the Adapter Engine on the Integration Server, or select a non-centrally installed Adapter Engine. This selection is not available in the PCK.
For Generic JMS Provider, connection settings are specified in the Additional Parameters table. 5. If you want to connect to a JMS topic, select the Enable the Topic Support checkbox.
By default, JMS provider enables the queue support. 6. Depending on the transport protocol you have selected, enter the connection parameters for the JMS provider. Extra connection parameters can be specified in the Additional Parameters table of the Advanced tab page. Depending on the third party JMS provider, you may need to set a unique ClientID (for each channel) using the additional parameter table. The function for setting the ClientID is provider-specific.
The keep alive period determines how long the connection must be kept open after the delivery of a message. If the value is zero, the JMS receiver adapter opens the connection and closes it immediately after delivering the message. If the value is greater than zero, the JMS receiver adapter opens the connection for the first incoming message, delivers the message and closes the connection after the keep alive period lapses. If there are subsequent messages received during this active connection period, the adapter delivers these messages, resets the keep alive period everytime it delivers a message. and closes the connection after the keep alive period lapses for the last delivered message. The JMS receiver adapter cannot reconnect automatically to the JMS provider in the event of the provider failure.
Page 6 of 11
Value propertyValue
This table is available only if you select the Transport Protocol as JNDI JMS Provider Lookup.
Defining PI Settings
22. Select the Mapping of Message: If you only want the JMS payload to contain only the payload of the PI message, choose Message Payload = JMS Payload. (default setting) If you want the JMS payload to contain the entire PI message, choose Entire Message = JMS Payload. 23. The adapter can identify whether the connection has been terminated between the JMS commit and the commit in the database of the Adapter Framework. The adapter identifies the resulting duplicate data record. Select Handling of Pending PI Messages: Throw Exception (Message Retry Possible Later) (default) Bypass Pending Warning and Send Message to JMS (Duplicates Possible) A duplicate data record is created if the JMS commit is executed, but not the commit in the database of the Adapter Framework. If you select this option, you must make sure that this message has not yet been received in the JMS environment. Mark Message as Delivered (Message Loss Possible) The message is lost if the JMS commit is not yet executed. If you select this option, you must make sure that this message has already been received in the JMS environment.
For an example of how this parameter is used, see below under Example. 24. Under Time Period for Duplicate Check for EO(IO) (secs), specify when the IDs are to be deleted. To check for duplicate messages, IDs must be saved in the database. To prevent the database from getting unnecessarily large, these IDs are deleted after a certain amount of time. For example, if you check message monitoring daily, deletion can take place after one day. 25. If the JMS receiver is an application, the JMS adapter should return a delivery acknowledgment. Select Send PI Delivery Acknowledgment (Adapter Is Endpoint).
Page 7 of 11
Your JMS provider must support the registration of an ExceptionListener for this. 28. If the JMS provider does not call the ExceptionListener registered by the JMS adapter when a connection error occurs, you can force the connection to be reestablished by setting the parameter Reconnection if Exception Text Starts with. If a JMS exception is thrown when sending a message, the free text specified here is compared with the specified string. Once the period of time specified in Wait Before Reconnect (msecs) has passed, an attempt is made to reestablish the connection.
Only set this parameter if your JMS provider does not support the registration of an ExceptionListener.
Example
Below is a typical procedure for handling pending messages: 1. The default setting for the parameter of the receiver JMS adapter is Throw Exception. 2. You see the following exception in the message or adapter monitor: The channel is configured to throw a recoverable, temporary error for this warning (default). Decide whether you want to bypass this message. If so, set the Pending Handling channel parameter to 'Bypass' and restart the message afterwards. 3. Make sure that no further messages are sent through this communication channel by deactivating the corresponding sender channel. 4. Check whether the message or messages have arrived in the JMS environment. a. If the message has arrived in the JMS environment, select Mark Message as Delivered (Message Loss Possible). b. If the message has not arrived in the JMS environment, select Bypass Pending Warning and Send Message to JMS (Duplicates Possible). c. Choose Repeat in message monitoring. If some messages have arrived in the JMS environment and some have not, you must perform the procedure twice and resend the respective messages in each case. 5. Reset the parameter in the communication channel to Throw Exception. 6. Activate the corresponding sender communication channel.
Page 8 of 11
Prerequisites
You are configuring a JMS adapter. The default values on the interface relate to SonicMQ 3.0.
Procedure
1. Enter the Topic/QueueConnectionFactory Java Class. This is the SonicMQ implementation of the Topic/QueueConnectionFactory. The adapter uses a Topic/QueueConnectionFactory object to generate Topic/QueueConnection objects of a JMS provider. 2. Enter the Queue/Topic Java Class. A queue object encapsulates a provider-specific queue name. This enables a client to make the queue JMS API methods known. 3. Enter the IP Address or Server Name of the machine on which the JMS provider is running. If this is a local machine, the value is localhost. 4. Specify the Server Port. 5. Enter the name of theJMS Queue/Topic.
Prerequisites
You are configuring a JMS adapter. The default values on the interface relate to WebSphereMQ 5.3.
Procedure
1. Enter the Topic/QueueConnectionFactory Java Class. This is the WebSphereMQ implementation of the Topic/QueueConnectionFactory. The adapter uses a Topic/QueueConnectionFactory object to generate Topic/QueueConnection objects of the JMS provider. 2. Enter the Queue/Topic Java Class. A queue object encapsulates a provider-specific queue name. This enables a client to make the queue JMS API methods known. 3. Enter the IP Address or Server Name of the machine on which the JMS provider is running. If this is a local machine, the value is localhost. 4. Specify the Server Port. 5. Under Queue Manager Name, enter the display name of the queue manager. 6. Under Channel Name, specify the access channel for all queues. 7. Enter the name of theJMS Queue/Topic. 8. Under Character Set ID (CCSID) for Non-ASCII Names, specify the character set for the names specified above. This entry does not affect the character set of the transferred messages. 9. Select the Transport/Network Protocol: TCP/IP The JMS adapter communicates with the MQ Series server using TCP/IP sockets. WebSphereMQ Communication takes place using dynamic libraries. For example, Microsoft uses files with the ending .DLL; Unix uses files with the ending .SO or .SL. In a 64-bit operating system, the libraries must also be 64 bit.
If the libraries in a 64-bit operating system are not 64 bit, see SAP Note 790963. 10. Under Target Client, select one of the following: WebSphereMQ (Non-JMS) The receiver uses the WebSphereMQ API.
Page 9 of 11
For information about changing the default values, see SAP Note 802754.
Prerequisites
You are configuring a JMS adapter.
Procedure
1. Enter the JNDI Lookup Name of Topic/QueueConnectionFactory. The adapter uses a Topic/QueueConnectionFactory object to generate Topic/QueueConnection objects of a JMS provider. 2. Enter the JNDI Lookup Name of JMS Queue/Topic. A queue object encapsulates a provider-specific queue name. This enables a client to make the queue JMS API methods known. 3. Enter the Name of JNDI Initial Context Factory. This allows access to JNDI. If you want to use another registry, specify it here. 4. Enter the JNDI Server Address. If you are using the AS Java JMS provider, <host>:<port> is sufficient. If, for example, you are using OpenJMS, enter http://<host>:<port>/. 5. Enter the JNDI Logon User and JNDI Logon Password, and confirm.
Prerequisites
You are configuring a JMS adapter. The files must be copied to each cluster server.
Procedure
1. Enter the File Name of Serialized Topic/QueueConnectionFactory Java Object with path. 2. Enter the File Name of Serialized Queue/Topic Java object with path.
Page 10 of 11
Prerequisites
You are configuring a JMS adapter.
Example
For Websphere MQ, for example, the table contains the following values: Name JMS.QueueConnectionFactoryImpl.classname JMS.QueueConnectionFactoryImpl.method.setHostName JMS.QueueConnectionFactoryImpl.method.setChannel JMS.QueueConnectionFactoryImpl.method.setTransportType JMS.QueueConnectionFactoryImpl.method.setQueueManager JMS.QueueImpl.classname JMS.QueueImpl.constructor JMS.QueueImpl.method.setTargetClient Value com.ibm.mq.jms.MQQueueConnectionFactory java.lang.String p24537 java.lang.String JAVA.CHANNEL java.lang.Integer {com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP} java.lang.String QM_p24537 com.ibm.mq.jms.MQQueue java.lang.String postcard java.lang.Integer {com.ibm.mq.jms.JMSC.MQJMS_CLIENT_NONJMS_MQ}
Procedure
Adding Your Own Modules in the Sender Adapter
1. Insert your own modules before the CallSapAdapter module.
As of 710 SP 6, an additional and recommended method of setting the JMS Message Type is to add the following parameter name in the Additional Parameters table under the Advanced tab. JMS.Message.type with the value Text, bytes
Page 11 of 11