JMS Adapter Author: Dennis Kropp 1 Objectives After completing this session, you will be able to: Understand the basics of J2EE JMS adapter Understand how to configure a sender & receiver JMS adapter channel Be familiar with technical aspects of the JMS adapter © SAP AG 2004, JMS Adapter, Dennis Kropp, 2 2 JMS Adapter To connect Messaging systems to the Integration Engine JMS Protocols Transport protocol Sonic MQ WebSphere MQ JNDI JMS provider Lookup JMS provider Objects via file Generic JMS Provider Message protocol: JMS 1.x Asynchronous Exactly one sender communication channel per Sender-CPA (1:1) At least interface name and sender service must be qualified in the sender agreement © SAP AG 2004, JMS Adapter, Dennis Kropp, 3 The JMS adapter is a JMS client acting as sender/receiver of messages. The JMS provider is the external queuing system (e.g. SonicMQ, IBM WebSphereMQ). 3 JMS adapter – prerequisites / general notes The examples provide information about receiving messages from message queuing systems (sender channel) and sending messages to message queuing systems (receiver channel ) for the JMS adapter an external driver is needed (java archive) this archive is provided by the respective provider of the queuing system the driver has to be deployed via SDM , see XI configuration guide for details Routing rules and sender has to be specified as for any other channel in the directory object model the message header information is determined from the appropriate sender agreement for the communication channel the communication channel defined must be used in exactly one sender agreement at least the interface name and the sender service must be qualified in the sender agreement ,other fields are optional © SAP AG 2004, JMS Adapter, Dennis Kropp, 4 The vendor-specific JMS driver must be deployed onto the J2EE Engine using the SDM (see AF Administration chapter for more details). 4 JMS adapter : configuration of sender channel Depending on the transport protocol selected, specify the following : JNDI JMS Provider Lookup For Sonic MQ JMS Provider : · · · · · Java class QueueConnectionFactory Java class queue IP address or server name Server port JMS queue JNDI name of QueueConnectionFactory JNDI name of JMS queue Name of JNDI Initial Context Factory Address of JNDI server JNDI users JNDI password with confirmation · · · · · · For WebSphereMQ (MQ Series) JMS Provider JMS Provider Administered Objects via File · · · · · · · · · • File name of serialized object QueueConnectionFactory • File name of serialized object Queue Java class QueueConnectionFactory Java class queue IP address or server name Queue manager name Channel name JMS queue Character set for non-ASCll names Transport/network protocol Target client © SAP AG 2004, JMS Adapter, Dennis Kropp, 5 See the relevant JMS-provider documentation for details about the individual parameters See XI documentation at http://help.sap.com-> XI 3.0 ->Connectivity->JMS adapter, for more information 5 JMS-Adapter – Additional Parameters © SAP AG 2004, JMS Adapter, Dennis Kropp, 6 Set additional parameters (e.g. from JMS 2.0) or replace default settings for a vendor specific adapter or generic provider 6 Example: Integrating WebSphereMQ to XI © SAP AG 2004, JMS Adapter, Dennis Kropp, 7 Pls. see separate OSS-note for JMS-adapter 7 Example: Integrating WebSphereMQ to XI © SAP AG 2004, JMS Adapter, Dennis Kropp, 8 Pls. see separate OSS-note for JMS-adapter 8 Example: Integrating WebSphereMQ from XI © SAP AG 2004, JMS Adapter, Dennis Kropp, 9 9 Example: Integrating WebSphereMQ from XI © SAP AG 2004, JMS Adapter, Dennis Kropp, 10 10 Configure WebSphere (MQ Series) to receive messages from XI • Connect with WebSphere (MQ Series) explorer to the queue manager in order to create a new queue • user must have administrative rights • see WebSphere (MQ Series) documentation for more details © SAP AG 2004, JMS Adapter, Dennis Kropp, 11 11 Example: Integrating SonicMQ from XI • Receiver configuration for a SonicMQ queuing system © SAP AG 2004, JMS Adapter, Dennis Kropp, 12 The server port is defined during SonicMQ install procedure On this port, SonicMQ is listening for incoming messages JMS Queue is defined in SonicMQ Explorer tool 12 Example: Integrating SonicMQ from XI (2) Specify the adapter modules in the module processor : © SAP AG 2004, JMS Adapter, Dennis Kropp, 13 1 localejbs/SAP XI JMS Adapter/ConvertMessageToBinary Call ModuleLocalInterface convert 2 localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService Call ModuleLocalInterface exit Module parameters are predefined with SP4 and therefore it is not necessary to define values manually 13 Configure SonicMQ to receive messages from XI • start the SonicMQ explorer tool • Connect to the message broker in order to create a new queue • user must have administrative rights • connect ID name is a arbitrary name • see SonicMQ documentation for more details © SAP AG 2004, JMS Adapter, Dennis Kropp, 14 Before connecting start the SonicMQ Broker 14 Configure SonicMQ to receive messages from XI (2) • Press “New” to create a new JMS queue © SAP AG 2004, JMS Adapter, Dennis Kropp, 15 Message Broker must be running to receive messages 15 Configure SonicMQ to receive messages from XI (3) New messages can be seen in “Message” tab of Sonic Explorer • • you can use a java application to get the messages from the queue E.g. use demo application provided in the SonicMQ tutorial © SAP AG 2004, JMS Adapter, Dennis Kropp, 16 16 Summary Now you should be able to: explain the basics of the J2EE JMS adapter configure a sender & receiver JMS adapter channel Describe the most important technical aspects of the JMS adapter © SAP AG 2004, JMS Adapter, Dennis Kropp, 18 17