Skip to main content

Using Configuration to configure basic endpoint

In addition to using the WSDL file to specify the connection information for a JMS endpoint, you can also supply it in the endpoint's XML configuration. The information in the configuration file will override the information in the endpoint's WSDL file.

You configure a JMS endpoint using one of the following configuration elements:

  • jms:conduit : The jms:conduit element contains the configuration for a consumer endpoint. It has one attribute, name , whose value takes the form

    {WSDLNamespace}WSDLPortName.jms-conduit
  • jms:destination : The jms:destination element contains the configuration for a provider endpoint. It has one attribute, name , whose value takes the form

    {WSDLNamespace}WSDLPortName.jms-destination

    .

JMS connection information is specified by adding a jms:address child to the base configuration element. The jms:address element used in the configuration file is identical to the one used in the WSDL file. Its attributes are listed in the address element's attribute table . Like the jms:address element in the WSDL file, the jms:address configuration element also has a jms:JMSNamingProperties child element that is used to specify additional information used to connect to a JNDI provider.

Addressing Information in a Configuration File

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:ct="http://cxf.apache.org/configuration/types"
   xmlns:jms="http://cxf.apache.org/transports/jms"
   xsi:schemaLocation="
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://cxf.apache.org/jaxws 
      http://cxf.apache.org/schemas/jaxws.xsd
      http://cxf.apache.org/transports/jms 
      http://cxf.apache.org/schemas/configuration/jms.xsd">
   <jms:conduit 
      name="{http://cxf.apache.org/jms_endpt}HelloJMSPort.jms-conduit">
      <jms:address destinationStyle="queue"
         jndiConnectionFactoryName="myConnectionFactory"
         jndiDestinationName="myDestination"
         jndiReplyDestinationName="myReplyDestination"
         connectionUserName="testUser"
         connectionPassword="testPassword">
         <jms:JMSNamingProperty name="java.naming.factory.initial"
            value="org.apache.cxf.transport.jms.MyInitialContextFactory"/>
         <jms:JMSNamingProperty name="java.naming.provider.url"
            value="tcp://localhost:61616"/>
      </jms:address>
   </jms:conduit>
</beans>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!