Show TOC

Configuring the JMS ResourcesLocate this document in the navigation structure

Prerequisites

An EAR project exists.

Context

In this step you configure the jms-resources.xml where you declare the connection factories and destinations needed by the application. The jms-resources.xml is included in the EAR.

Deploying the EAR results in an automatic deployment of all JMS resources defined by the jms-resources.xml file. The XML file is packed in the EAR.

Procedure

  1. Expand the MDBEAR project. Under EarContent\META-INF folder, there is a jms-resources.xml file. If not, you have to add the Create SAP JMS resources descriptor facet in the EAR project. To do this:
    1. Choose Properties in the context menu of the EAR project.

    2. In the properties dialog, choose Project Facets .

    3. Select the Create SAP JMS resources descriptor checkbox, choose Apply , then choose OK .

  2. Open the jms-resources.xml file and enter the following:
    1. For “Queue” destination:

                              <jms-resources>
              <connection-factory>
                      <name>MyVeryNewFactory</name><!-- You give the name of the Connection Factory -->
                      <sap-local-factory-type>
                              <type>javax.jms.XAQueueConnectionFactory</type>
                              <virtual-provider>default</virtual-provider>
                      </sap-local-factory-type>
              </connection-factory>
              <destination>
                      <name>MyVeryNewQueue</name><!-- Specify the Destination -->
                      <type>javax.jms.Queue</type>
                      <sap-local-destination-type>
                              <virtual-provider>default</virtual-provider>
                      </sap-local-destination-type>
              </destination>
      </jms-resources>
                           
    2. For “Topic” destination:

                              <jms-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="jms-resources.xsd">
              <connection-factory>
                      <name>MyVeryNewFactory</name><!-- You give the name of the Connection Factory -->
                      <sap-local-factory-type>
                              <type>javax.jms.XAQueueConnectionFactory</type>
                              <virtual-provider>default</virtual-provider>
                      </sap-local-factory-type>
              </connection-factory>
              <destination>
                      <name>MyVeryNewTopic</name><!-- Specify the Destination -->
                      <type>javax.jms.Topic</type>
                      <sap-local-destination-type>
                              <virtual-provider>default</virtual-provider>
                      </sap-local-destination-type>
              </destination>
      </jms-resources>
                           
  3. Save your work.

Results

You have configured the JMS resources in the jms-resources.xml .

Next Step

Deploying the EAR