...
Code Block | ||
---|---|---|
| ||
<wsdl:definitions xmlns:jms="http://cxf.apache.org/transports/jms" ... <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter"> <soap:binding style="document" transport="http://cxf.apache.org/transports/jms"/> …... </wsdl:binding> <wsdl:service name="JMSGreeterService"> <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort"> <jms:address destinationStyle="queue" jndiConnectionFactoryName="ConnectionFactory" jndiDestinationName="dynamicQueues/test.cxf.jmstransport.queue"> <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/> <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61616"/> </jms:address> </wsdl:port> </wsdl:service> |
CXF clients and servers implemented in java or using Spring configuration magically work for this WSDL (under the hood CXF selects correct JMS Conduit and Destination based on address URL).
Details are described in http://cxf.apache.org/docs/jms-transport.html.
CXF also delivers jms_queue and jms_pubsub examples illustrating using JMS transport with default settings for ActiveMQ.
...
- it doesn't make sense to increase the number of concurrent consumers for a JMS topic. This just leads to concurrent consumption of the same message.
- the concurrentConsumers property and the maxConcurrentConsumers property can be modified at runtime, for example, via JMX.
For the details you can refer following Bruce Snider's blog: http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html.
You can see that Spring provides solution for both mentioned scalability aspects. But how we can use it in CXF?
...
You can see that the endpoint configuration contains the JMSConfigFeature that has a JMSConfiguration property.
JMSConfiguration supports all settings that we have seen in Spring DefaultMessageListenerContainer: cached connection factory with session pool size, number of concurrent consumers, cache level. All settings of JMSConfiguration are described in details in http://cxf.apache.org/docs/using-the-jmsconfigfeature.html.
Using this configuration the server application can be tuned to achieve optimal performance in our target environment.
...
It is possible to achieve scalability of a CXF client and service using Spring JMS functionality and the CXF JMS Configuration Feature.
It is not necessary to write any line of code, just configure and leverage already existing stuff.
Using this feature can have essential invluence on the performance for some environments: in one Prove Of Concept I have improved CXF service throughput on 360% (from 500 to 1800 msg/sec) just using session pool and multithread JMS consumer!
Reference performance numbers for SOAP over JMS are represented in Christian Schneider's article: http://www.liquid-reality.de/pages/viewpage.action?pageId=5865562, so you can easily compare it with own results and make appropriate tunning if necessary.
...