cancel
Showing results for 
Search instead for 
Did you mean: 

Handling JMS Administered Objects

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

sabine_heider
Explorer
0 Kudos

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