Skip to Content
author's profile photo Former Member
Former Member

Handling JMS Administered Objects

Hallo

I'am looking for some infos about the handling of administered objects in the JMS environment of the WebAS 6.40. The online docu (http://help.sap.com/saphelp_nw04/helpdata/en/21/82a9058fa8de46b1ba7522289345b2/frameset.htm) only mention that this would be possible but I found no information how to do.

Especially I'am interessted in creating and removing destination-objects (JMS Queues/Topics) in a programmatically way.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 30, 2004 at 02:55 PM

    Hi Markus

    WebAS 6.40 doesn't offer an administration API to create administered objects, but it allows you to deploy them together with a J2EE application. Have a look at http://help.sap.com/saphelp_erp2004/helpdata/en/44/976986db254d16b2afae73f0edd8b1/frameset.htm

    The JMS connector service provides an additional abstraction layer between the JMS provider and the application.

    You have to create two files, jms-factories.xml and jms-destinations.xml. Place them within the META-INF folder of the EAR project. Here is an example of these files:

    jms-factories.xml:

      <jms-factories>
        <application-name>
          TestEAR
        </application-name>
        <connection-factory>
          <factory-name>
            QueueConnFactory
          </factory-name>
          <context-factory-type>
            <link-factory-name>
              jmsfactory/default/XAQueueConnectionFactory
            </link-factory-name>
            <initial-context-factory>
              com.sap.engine.services.jndi.InitialContextFactoryImpl
            </initial-context-factory>
            <provider-url>
            </provider-url>
            <security-principal>
            </security-principal>
            <security-credentials>
            </security-credentials>
          </context-factory-type>
        </connection-factory>
      </jms-factories>
    

    jms-destinations.xml:

      <jms-destinations>
        <application-name>
          TestEAR
        </application-name>
        <destination>
          <connection-factory>
            QueueConnFactory
          </connection-factory>
          <destination-name>
            myQueue
          </destination-name>
        </destination>
      </jms-destinations>
    

    Use the same names you define here (factory-name and destination-name) in the ejb-j2ee-engine.xml file to map the resource-ref and resource-env-ref to physical connection factories and destinations, respectively.

    Technically, each administered object consists of two objects: one in the JMS provider, and another one in the JMS connector. You actually don't have to be aware of this, but I want to point you to one pitfall: The connection factory you define in the jms-factories.xml must point to an existing(!) connection factory object in the JMS provider layer (tag link-factory-name) - and this object cannot be created programatically in WebAS 6.40. However, WebAS 6.40 comes with a set of predefined connection factories which you can use (depending on the type you need):

    jmsfactory/default/XAQueueConnectionFactory

    jmsfactory/default/XATopicConnectionFactory

    jmsfactory/default/QueueConnectionFactory

    jmsfactory/default/TopicConnectionFactory

    Note: With transacted MDB's, you have to choose the XA types of the connection factories instead of the "regular" ones.

    Hope that helps.

    Regards,

    Sabine

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.