Show TOC

Procedure documentationConfiguring the JMS Resources Locate this document in the navigation structure

 

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 packaged in the EAR.

Prerequisites

An EAR project exists.

Procedure

  1. Expand the MDBEAR project. Under META-INF folder there is a jms-resources.xml file. If not, you have to add the Create SAP JMS resources descriptor Project Facet in the EAR project. Choose Properties in the context menu of the EAR project. Choose Project Facets. Select the Create SAP JMS resources descriptor checkbox and choose Apply. Choose OK.

  2. Open the jms-resources.xml file and enter the following:

    1. For Queue destination:

      Syntax Syntax

      1. <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>
      End of the code.
    2. For Topic destination:

      Syntax Syntax

      1. <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>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>
      End of the code.

Result

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