+

Search Tips   |   Advanced Search

Invoking operations using JMS user property operation selection

We can invoke an operation using JMS user property operation selection.

  • Configure the JMS binding for the SCA application.

    The JMS user property operation selection is a predefined operation selector that determines the target operation from the value of a given JMS user property. We can define the name of the JMS user property using the propertyName attribute of the operationSelector.jmsUserProp element. To specify the JMS user property operation selection, add the following operation selection element to the composite definition file:

    OSOA

      {http://tuscany.apache.org/xmlns/sca/1.0}operationSelector.jmsUserProp

    OASIS

      {http://tuscany.apache.org/xmlns/sca/1.1}operationSelector.jmsUserProp

    Specify a JMS user property operation selection on an SCA service interface and on an SCA reference.

    1. In a composite definition file, specify a JMS user property operation selection on an SCA service interface.

      On the service side, the jmsUserProp operation selection uses the value of the given JMS user property to determine the target operation. For example:

      <binding.jms>
       ...
          <ts:operationSelector.jmsUserProp propertyName="jmsTestUserProp"/>
      ...
      </binding.jms>

      The operation selector requires set a JMS user property to the target operation name. If the property is not set or there is no matching operation, the operation selector does not default to any other value, unlike the default JMS binding operation selector.

    2. In a composite definition file, specify a JMS user property operation selection on an SCA reference.

      When using the JMS user operation selector on the service side, the reference side or service side callback must set the matching JMS user property. In the service-side example, the operation selector uses the value of the jmsTestUserProp to determine the target operation. We can set this property for the reference or callback side by specifying one or more header properties in the operationProperties element; for example:

      <operationProperties name="proxyMethodName">
        <headers>
          <property name="jmsTestUserProp">remoteMethodName</property>
        </headers>
      </operationProperties> 

      In the example, a call to the proxyMethodName on the reference side sets the jmsTestUserProp user property to remoteMethodName. The proxyMethodName target operation is set to remoteMethodName when the service-side operation selector is configured as in the previous section.


    Results

    You have configured a JMS user property operation selection.


    What to do next

    Deploy and test the operation selection in the SCA application.


    Related tasks

  • Configure the SCA JMS binding
  • Invoking operations using JMS binding operation selection

  • Service Component Architecture specifications and APIs