Skip to Content

How to use SAP’s WebAS J2EE’s JMS Queue in Exchange Infrastructure

Do you know that the WebAS J2EE server also contains JMS queues you can use for XI scenarios? And, you don’t have to license MQSeries or SonicMQ.

The queues can be created and configured using the J2EE Visual Adminstrator, and be used in JMS sender and receiver communication channels.

Creating a queue in the Visual Administrator:

  1. Navigate to Server -> Services -> JMS Provider
  2. Click on the “Default” service or create your own
  3. Click on the tab: Queues
  4. Clock on “Create” to create a queue

image

Create/Configure JMS sender and receiver communication channels:

  • JMS Sender Communication Channel:

    image

    Configurations:

    Transport Protocol:  Access JMS Provider with JNDI
    JNDI Lookup Name of QueueConnectionFactor:  jmsfactory/default/QueueConnectionFactory
    JNDI Lookup Name of JMS Queue:  jmsqueues/default/MyTestQueue (This is based on the path of the queue created in Visual Administrator.)
    Name of JNDI Initial Context Factory:  com.sap.engine.services.jndi.InitialContextFactoryImpl

  • JMS Receiver Communication Channel:

    image

    Configurations:

    Transport Protocol:  Access JMS Provider with JNDI
    JNDI Lookup Name of QueueConnectionFactor:  jmsfactory/default/QueueConnectionFactory
    JNDI Lookup Name of JMS Queue:  jmsqueues/default/MyTestQueue (This is based on the path of the queue created in Visual Administrator.)
    Name of JNDI Initial Context Factory:  com.sap.engine.services.jndi.InitialContextFactoryImpl

NOTE:  Unfortunate, there is no tool to view or administer the content of the queue.

To report this post you need to login first.

22 Comments

You must be Logged on to comment or reply to a post.

  1. Matthias Zeller
    Hello William,
    interesting information. Adobe Flex/Flash application UIs can communicate in real-time with a backend using JMS, via Adobe Flex Data Services. I was actually wondering if SAP supports JMS and your posting provides some valuable information. By using XI, JMS and Adobe Flex it would be possible to push SAP backend data in realtime to the enduser using a browser (e.g. for notifications or real-time charting).

    Cheers,

    Matthias

    (0) 
    1. Peter Peshev
      Hi Matthias,

      It is mandatory for every J2EE 1.3 compatible server to include a JMS 1.0 implementation. Thus it is supported in Netweaver 2004 and Netweaver 2004s. You can use the JMS API from a standalone client, JSP, EJB, or indirectly via XI.

      In SAP NetWeaver Application Server, Java EE 5 Edition, the supported JMS version is 1.1.

      Best Regards
      Peter

      (0) 
  2. Bhavesh Kantilal
    William,
    First of all a very useful blog. I have always wondered if this was possible and this blog just answered a lot of my questions.

    Is it required that some drivers be installed for the JMS adapter to access the WebAS JMS service like we do for any other JMS service like MQ and so on?

    Regards,
    Bhavesh

    (0) 
  3. C. Manthey
    Thanks for this interessting blog! Do you know if it is also possible to create remote queues on the WebAs and have a sender channel deliver it to an MQ Queue Manager?

    Kind regards,
    Christian

    (0) 
    1. William Li Post author
      As far as I know, this cannot be done.

      However, using XI, you can create a JMS receiver communication channel in the Integration Directory, where the MQ configurations can be entered.

      Regards,
      Bill

      (0) 
    1. William Li Post author
      Hi,
      Acutally any scenario where you have a need to use a queue can use this.  Your design and configuration are identical as developing any other scenario in XI.  The only difference is the configuration of the JMS communication channel, which an example one is available from the blog.

      However, if you wish to access the J2EE JMS queue without using XI, an external java program will have to be written.

      Regards,
      Bill

      (0) 
  4. reshma s
    Hi William,

    Thanks for this wonderful blog. I am actually trying to implement the same in our architecture as a solution. I would like to know some more information regarding the persistence of the messages in these queues and is there a workaround to find out a way (may be an indirect way) to monitor these queues….

    Thanks for your help.

    Regards,
    Reshma

    (0) 
    1. William Li Post author
      Hi Reshma,
      I am sure there is a way to monitor/administer these J2EE JMS queues.  More likely, an J2EE application will have to be written.  Unfortunately, I do not know how?

      Maybe you can post an SDN question in the “Platform and Operatins” forum.

      Regards,
      Bill

      (0) 
      1. reshma s
        Hi Bill,

        I would surely. I have got another doubt… There must be some jars that needs to be installed which are required to implement these WAS JMS queues..If we are using these queues to send messages from a third party J2ee application, What would be these jar files…?
        Please let me know.

        Regards,
        Reshma

        (0) 
      2. Amrish Joshi
        Thanks Bill … another gr8 one on your list.Pls keep sharing info like this.

        I was wondering, if XI can pull the data from JNDI queues from other servers (IBM WPS )using this adapter configuration ? In order to support that:
        1. Do you need to install external driver ? ( I would assume , answer is No)
        2. To connect to external server’s queue Do I still need to create local queue at XI box using Visual admin as suggested by you in this blog.
        3. Are all parameters going to be the same as in adapter config. as they are mentioned in this blog ?

        Your help is much appreciated !!!

        Amrish.

        (0) 
        1. William Li Post author
          Hi Amrish,
          Are you using IBM’s MQSeries also.  There is a special dropdown for MQ in the JMS comm chan configuration.  External drivers will be required.  No local queue is required.

          Using other vendor’s queue manager not contained in the JMS adapter configuration, some testing (or playing around) will be required providing the external queue is JMS compliant.  No external drivers will be required.

          In all cases, you will not need a local queue.

          Regards,
          Bill

          (0) 
  5. Jian Yang
    Hi Bill,

      Thanks for this Blog. I’m trying it out myself with a simple scenario from File -> XI -> JMS.

      I created a JMS queue on my local J2EE as you instructed with Administrator id. Then I configured the whole IR and ID. Send one message over and I got the following error message in JMS receiver adapter basically saying that couldn’t authenticate the user. The user I used in JMS receiver CC is Administrator as well and I’m pretty sure the password I entered was the right one. Am I missing anything? I didn’t enter user id/password for the JMS queue user in receiver CC.

      Any help is greatly appreciated. Thanks,

    (0) 
    1. Jian Yang
      Hi, Bill,

        I found out that there is no security defined for the default JMS instance. After I defined the basic authentication for it in Security Provider service, I got pass the authentication problem.

        However, I got another error saying that nameNotFoundException complaining not being able to find the queue name I defined.

        So I changed my JMS receiver CC to use one of SAP delivered demo queue, then it worked.

        Is there any other step I need to do after I create my own queue? Thanks,

      (0) 
    1. William Li Post author
      Hi,
      MS’s MSMQ does not support JMS.

      It is probably possible if there is a JMS-MSMQ bridge, you can use the JMS API to access MSMQ.

      Regards,
      Bill

      (0) 
  6. Jason Scott
    Just wondering why you would want to introduce WebAS JMS queues into your integration scenario if you are already using XI (which is inherintly a queueing mechanism). It would seem to me that you are simply introducing another middleware component for no benefit.

    I can understand the reason you would want XI to communicate to other JMS Providers such as WebsphereMQ if your organisation already has this in place, but why would you design an integration scenario with XI and the WebAS JMS queues on the XI box?

    Wouldn’t it be better to communicate with other applications via soap or another adapter?

    From what I have read there are no monitoring capabilities built into WebAS for the JMS queues – so wouldn’t that make it NOT an enterprise capable solution?

    Anyone able to enlighten me..?

    Thx,
    Jason.

    (0) 
  7. Patrick Jones
    Hi Bill

    Would like to know, if there is similar documentation on how this can be created in PI 7.1 nwa.

    Also, for the created Queue are they any monitoring capabilities we can explore in PI 7.1.

    Monitoring such as, Queue statistics: no.of messages sent, received and the no.Queues up & running.

    Thank you,
    Patirck

    (0) 

Leave a Reply