Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop SCA composites > Specify bindings in an SCA environment > Configure the SCA JMS binding


Invoke operations using JMS user property operation selection

We can invoke an operation using JMS user property operation selection.
Configure the JMS binding for your 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:

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

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


Procedure

  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 that you 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 your SCA application.
Configure the SCA JMS binding
Invoke operations using JMS binding operation selection


Related


Service Component Architecture specifications and APIs

+

Search Tips   |   Advanced Search