JMS
Current user guide describes some ways to use it http://tuscany.apache.org/sca-java-bindingjms.html
Typical usage patterns and message types
message transformation
multiple providers
multiple clients/hosts
RPC between SCA components
Basic RPC style operations between SCA components using the JMS binding.
Code Block |
---|
<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="helloWorldRef"> <binding.jms uri="jms:HelloWorldService"/> </reference> </component> <component name="HelloWorldServiceComponent"> <implementation.java class="helloworld.HelloWorldServiceImpl" /> <service name="HelloWorldService"> <binding.jms /> </service> </component> </composite> |
One component exposes a JMS service on a queue named 'HelloWorldService' (based on the service name). Another component invokes the service by sending JMS messages to that queue (based on the configuration in the binding.uri). With this configuration messages are marshalled into JMS messages as XML text messgages. After processing at the service a temporary destination is used for the response message. Again the response messages are marshalled into JMS messages as XML text messgages. Exceptions?
The sample helloworld-jms shows this scenario working in full.
Links to JIRA
Link to ML discussions
Asynchronous messages
Fire and forget
Pub sub messages
XML/Text based messages
Service has JAXB interface
Java serialized objects
Service has POJO interface
SOAP over JMS
Is this binding.jms, binding.ws or both
Message transformation
Multiple Message Types
Callbacks and conversations
Referencing external JMS providers
Servicing external JMS providers
Alternative JMS providers?
Policy
Binding Type
The JMS binding has native support for some intents.
Code Block |
---|
<bindingType type="binding.jms" alwaysProvides="jms" mayProvide="atLeastOnce atMostOnce ordered conversation"/> |
atLeastOnce
atMostOnce
ordered
conversation
priority
Following example given in spec
Code Block |
---|
<policySet name="JMSPolicy" provides="priority" appliesTo="binding.jms"> <intentMap provides="priority" default="medium"> <qualifier name="high"> <headers JMSPriority="9"/> </qualifier> <qualifier name="medium"> <headers JMSPriority="4"/> </qualifier> <qualifier name="low"> <headers JMSPriority="0"/> </qualifier> </intentMap> </policySet> |
Code Block |
---|
<reference name="StockQuoteService" requires="priority.high log"> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.jms> <destination name="StockQuoteServiceQueue"/> <connectionFactory name="StockQuoteServiceQCF"/> </binding.jms> |