Skip to Content
Author's profile photo Nitin Mehta

How to Integrate Fuse MQ with SAP PI 7.4 using JMS

Fuse MQ is also known as JBoss A-MQ. It is an open source JMS message broker that is based on Apache ActiveMQ and used in enterprise IT organizations to handle large amounts of data efficiently and reliably.
In this blog I would like to show you that how you can integrate Fuse MQ with SAP PI 7.4. I would show you how you can directly connect to the queues of Fuse MQ using JMS adapter in SAP PI 7.4.   It will cover the step by step procedure from deployment of client jars to the JMS adapter configuration and finally testing the whole configuration.
In this blog I would be showing the configuration for the following version of Fuse MQ and SAP PI
Fuse MQ Version – 5.7.0.
SAP PI Version – 7.4 SP 4
Integration STEPS
  1. Check in PI that following package is installed SAPXI3RDPARTY*. For my example I am referring SAPXI3RDPARTY04_0-20009965.SCAfile. You can choose your file depending on your PI version.
    1. Goto Netweaver Administrator
    2. Goto Configuration -> Infrastructure -> System Information -> Component info Tab
     /wp-content/uploads/2014/12/img1_601265.jpg
If the above package is not available then please download the version which is compatible to your PI release from service marketplace and get it installed in PI with the help of BASIS team.
    2.   Get the jar file from the Fuse MQ vendor. This will be used to establish the client connection by PI with Fuse MQ server. In this example I have used “activemq-all-5.7.0.fuse-71-047.jar”  as the jar file to establish the client connection.
    3.   Deploy this Jar file in PI
    1. Open the SCA file mentioned in the step 1. Open the file (SAPXI3RDPARTY04_0-20009965.SCA) with the help of a ZIP/RAR utility. To do this rename the file with .ZIP extension and unzip it./wp-content/uploads/2014/12/img2_601373.jpg
    2. Open the unzipped folder SAPXI3RDPARTY04_0-20009965. Inside the unzipped folder you will find the folder with name DEPLOYARCHIVES./wp-content/uploads/2014/12/img3_601375.jpg
    3. In the folder DEPLOYARCHIVES you will find the .sda file with name com.sap.aii.adapter.lib.sda/wp-content/uploads/2014/12/img4_601395.jpg
    4. Rename the .sda file with extension .zip. This can be done with the help of Zip/RAR utility/wp-content/uploads/2014/12/img5_601397.jpg
    5. Unzip the com.sap.aii.adapter.lib.zip file. You will see a folder with name “lib”./wp-content/uploads/2014/12/img6_601399.jpg
    6. In the “lib” folder you will already find a jar file with name com.sap.aii.adapter.lib_api.jar . In this lib folder add the Fuse MQ jar.
                In this example it is activemq-all-5.7.0.fuse-71-7.jar
               /wp-content/uploads/2014/12/img7_601415.jpg
          g.     Add the entries in the provider.xml for the jar file which was added. The file can be found in the folder with name “server”
/wp-content/uploads/2014/12/img8_601416.jpg
h.    After doing the above changes in the com.sap.aii.adapter.lib.zip file rename the file back to com.sap.aii.adapter.lib.sda
i.     With the help of Basis team get the com.sap.aii.adapter.lib.sda file deployed on PI. This has to be done using SUM in forcemode.
-/jspm/deployVersionRule = updateAll
                   -/jspm/forceMode = true
          j.   Once the com.sap.aii.adapter.lib.sda file is deployed successfully you will see the newly deployed jar activemq-all-5.7.0.fuse-71-047.jar in the following path.
                         /usr/sap/SID/DVEBMGS10/j2ee/cluster/bin/ext/com.sap.aii.adapter.lib/lib
       
     4.  Configure the Sender Communication Channel
 
         The below channel would be configured to connect to the Queue of Fuse MQ
    1. Create a sender communication Channel and select the adapter as JMS.
    2. In the Transport Protocol select “Access JMS Provider Generically”/wp-content/uploads/2014/12/img9_601417.jpg
    3. Uncheck “Enable Topic Support”
    4. In the advance Tab enter the following parameters. The values entered in the example are for the Jar that is deployed.
      In the example the queue which will be connected is named as SAPPI.TEST/wp-content/uploads/2014/12/img10_601439.jpg
         
Parameter Value
JMS.QueueConnectionFactoryImpl.classname org.apache.activemq.ActiveMQConnectionFactory
JMS.QueueConnectionFactoryImpl.constructor java.lang.String tcp://<hostname>:<port>
JMS.QueueImpl.classname org.apache.activemq.command.ActiveMQQueue
JMS.QueueImpl.constructor java.lang.String SAPPI.TEST
e.  Save and activate the channel
     4. Test the connection
    1. Goto the Communication Channel Monitoring and search for the channel. On successful connection you will see the status as successful./wp-content/uploads/2014/12/img11_601441.jpg
    2. On Fuse MQ server after successful poll the number of message will become 0/wp-content/uploads/2014/12/img12_601458.jpg
6. Common Errors that can be faced
      1. Error:- Cannot construct connection factory using constructor: ConstructorInvocationException:
        Error executing constructor invocation: {ConstructorInvocation {className=org.apache.activemq.ActiveMQConnectionFactory,
        invokeParams=[{InvokeParameter{className=null,type=java.lang.String,value=tcp://<hostname>:<port>}]
        }: java.lang.reflect.InvocationTargetException
Reason:- This error can be seen if the deployment is not successful or the client jar for making connection with Fuse MQ is not correct.
Solution:- Check with the provider of the Fuse MQ if you are using the correct version of the Jar. If the Jar is correct then check with the Basis team that the deployment is correct. Also check at Fuse MQ server that it is receiving hits from the PI system
     b. Error :- com.sap.aii.adapter.jms.api.connector.ConnectorException: Error creating message consumer: javax.jms.JMSException: You cannot  create a durable subscriber without specifying a unique clientID on a Connection
     Reason:- The error comes when the option “Enable Topic Support” is checked under source tab and JMS adapter try to establish a durable      connection without providing a Client ID as an additional parameter. 
     Solution:Uncheck the option “Enable Topic Support” on the source tab. Check this option only when you wish to establish a durable      connection with the topic. If you are connecting with the topic then it is mandatory to provide the ClientID parameter in the advance settings.
Important Note : The deployment of the .sda files after the update should be done using the SUM tool. This will prevent the overwriting of your changes if some upgrade is done on PI

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sandhya Tai
      Sandhya Tai

      Hi Nitin,

      We are trying to connect oracle fusion server from SAP PI 7.3.1 using JMS adapter.

      Followed the steps with deploying the fusion jar file in PI and configured JMS sender channel with required parameters (Ex: Connection factory and Queue class names)using related fusion jar. Getting the expected error which you mentioned in the blog that is cannot construct connection factory using constructor.

      Scenario: JMS to File

      Now, my doubt is... will this blog applicable to my requirement??

      Regards,

      Sandhya

      Author's profile photo Nitin Mehta
      Nitin Mehta
      Blog Post Author

      Hi Sandhya,

      Yes the blog can be used for your scenario.If you are getting a similar error then its evident that the deployment is not successful or the client jar is not correct.

      Also the connection factory and the client name parameter value depend on client jar.

      Which version of PI system are you using ?

      Are you recieving hits on  the oracle server from PI system ?

      Regards

      Nitin

      Author's profile photo Sandhya Tai
      Sandhya Tai

      Hi Nitin,

      Thanks for your reply.

      Below are the details.

      Which version of PI system are you using ? ---- PI 7.3.1

      Are you recieving hits on  the oracle server from PI system ?---- Not receiving hits to Fusion server.


      jars which we deplyed: wlclient.jar and wljmsclient.jar

      Error which I am facing:

      27072016_JMS error.PNG

      JMS sender channel configurations:

      Configs.png

      Please provide your inputs.

      Regards,

      Sandhya.

      Author's profile photo Nitin Mehta
      Nitin Mehta
      Blog Post Author

      Hi Sandhya,

      Sorry for the delay in responding. Wanted to know that did you check that the Jars are deployed correctly. If the deployment is successful then you should be able to see the Jars in the SDA file and the XML entry should be also updated.

      Secondly I doubt about the parameter values that you have used for the below parameters.

      JMS.QueueConnectionFactoryImpl.classname

      JMS.QueueImpl.classname

      JMS.QueueConnectionFactoryImpl.constructor

      Just open the jars and see that the classes are bundled with the name which you use.

      With the mentioned values were you able to make a call via a local Java program ? This is to test that the parameters and the Jar files are correct to invoke the call.

      Parameter values also differs with the server(where JMS service is running) version

      Regards

      Nitin