You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by co...@apache.org on 2008/02/21 11:51:00 UTC

[CONF] Apache Tuscany: SCA Java binding.jms (page edited)

SCA Java binding.jms (TUSCANY) edited by ant
      Page: http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.jms
   Changes: http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=57033&originalVersion=5&revisedVersion=6






Content:
---------------------------------------------------------------------

{section:border=false}
{column:width=15%}
{include: SCA Java Subproject Menu}
{include: Java SCA Menu New}
{column}
{column:width=85%}

h3. <binding.jms>

The Tuscany Java SCA runtime supports the Java Messaging Service using the <binding.jms> SCDL extension. New JMS based service endpoints can be provided using a <binding.jms> element within a SCA <service>, existing JMS queues can be accessed using a <binding.jms> element within a SCA <reference>.

The JMS binding is one of the SCA extensions which is being formalized in the OASIS Open Composite Services Architecture with a published [specifications |http://www.oasis-opencsa.org/sca-bindings] document.


h4. Using the JMS binding

The simplest way to use the JMS binding is to use the URI syntax to configure the binding, for example:
{code}<binding.jms uri="jms:RequestQueue"/>{code}
This tells the binding to use a JMS destination named "RequestQueue", with all the other configuration options using default values. When used in a SCA reference for RPC style request a temporary replyTo queue will be used.   


h4. Using the JMS binding


h3. Binding Operation

<binding.jms> 

h3. Some examples:

h4. HelloWorld

The helloworld-jms sample demonstrates basic RPC style operations over JMS. The sample has one component exposing a JMS service on a queue name 'RequestQueue' and another component which invokes the service by sending JMS messages to that queue. The .composite file for this is shown below, see the sample README for full details.

{code}
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           targetNamespace="http://sample"
           xmlns:sample="http://sample"
           name="HelloWorld">

    <component name="HelloWorldClient">
        <implementation.java class="helloworld.HelloWorldClient"/>
        <reference name="helloWorldService">
            <interface.java interface="helloworld.HelloWorldService"/>
            <binding.jms uri="jms:RequestQueue"/>
        </reference>
    </component>

    <component name="HelloWorldServiceComponent">
        <implementation.java class="helloworld.HelloWorldServiceImpl" />
	<service name="HelloWorldService">
            <interface.java interface="helloworld.HelloWorldService"/>
            <binding.jms uri="jms:RequestQueue"/>
        </service>
    </component>

</composite>
{code}

h4. JMS binding schema

The complete JMS binding SCDL schema has the following format:

{code}
<binding.jms correlationScheme="string"?
             initialContextFactory="xs:anyURI"?
             jndiURL="xs:anyURI"?
             requestConnection="QName"?
             responseConnection="QName"?
             operationProperties="QName"?
             ... >

   <destination name="xs:anyURI" type="string"? create="string"?>
      <property name="NMTOKEN" type="NMTOKEN">*
   </destination>?

   <connectionFactory name="xs:anyURI" create="string"?>
      <property name="NMTOKEN" type="NMTOKEN">*
   </connectionFactory>?

   <activationSpec name="xs:anyURI" create="string"?>
      <property name="NMTOKEN" type="NMTOKEN">*
   </activationSpec>?

   <response>
      <destination name="xs:anyURI" type="string"? create="string"?>
         <property name="NMTOKEN" type="NMTOKEN">*
      </destination>?
      <connectionFactory name="xs:anyURI" create="string"?>
         <property name="NMTOKEN" type="NMTOKEN">*
      </connectionFactory>?
      <activationSpec name="xs:anyURI" create="string"?>
         <property name="NMTOKEN" type="NMTOKEN">*
      </activationSpec>?
   </response>?

   <resourceAdapter name="NMTOKEN">?
      <property name="NMTOKEN" type="NMTOKEN">*
   </resourceAdapter>?

   <headers JMSType="string"?
            JMSCorrelationId="string"?
            JMSDeliveryMode="string"?
            JMSTimeToLive="int"?
            JMSPriority="string"?>
      <property name="NMTOKEN" type="NMTOKEN">*
   </headers>?

   <operationProperties name="string" nativeOperation="string"?>
      <property name="NMTOKEN" type="NMTOKEN">*
      <headers JMSType="string"?
               JMSCorrelationId="string"?
               JMSDeliveryMode="string"?
               JMSTimeToLive="int"?
               JMSPriority="string"?>
         <property name="NMTOKEN" type="NMTOKEN">*
      </headers>?
   </operationProperties>*

</binding.jms>
{code}

(?) See the [JMS Binding Specification 1.0|http://www.osoa.org/download/attachments/35/SCA_JMSBinding_V100.pdf?version=2] for full details of each of these configuration options.

Not all these elements are supported by Tuscany. Specifically, the <activationSpec> and <resourceAdapter> elements are not supported as Tuscany does not use JCA or MDBs for its JMS support. Additionally, support for the requestConnection, responseConnection, and operationProperties attributes has not yet been implemented but this should get done in the future.
{column}
{section}

---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences
   http://cwiki.apache.org/confluence/users/viewnotifications.action

If you think it was sent incorrectly contact one of the administrators
   http://cwiki.apache.org/confluence/administrators.action

If you want more information on Confluence, or have a bug to report see
   http://www.atlassian.com/software/confluence



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org