I recently looking for more information on RPC/encoded style came across two old but very good and simple articles so thought of bookmarking here via my Blog.
web-services-interoperability-between-j2ee-and-net-part-1
IBM-library-ws-whichwsdl
I have referenced the second one many times. It is very simple and handy to understand different between different SOAP message types.
Wednesday, March 25, 2009
Thursday, August 21, 2008
Spring jmsTemplate threading issue
I recently encounter a problem while working on some Servicemix bug and it turned out that Servicemix jms provider is using spring-jms jmsTemplate and when there are multiple threads trying to do send receive (receiveSelected() to be precise) some of the messages are dropped.
While doing further investigation I found that multiple threads are using the same instance of spring-jms jmsTemplate that is created by the jms provider and this was causing some threading issue so thing to remember is to make the calls to jmsTemplate.receiveSelected() (atleast this one) synchronized.
UPDATE: I was too quick to diagnose the problem as jmsTemplate issue. With more drill down I was able to reproduce the problem with pure jmsTemplate and ActiveMQ combination and looks like a ActiveMQ issue than spring-jms. My friend Gary is getting it fixed in ActiveMQ currently.
While doing further investigation I found that multiple threads are using the same instance of spring-jms jmsTemplate that is created by the jms provider and this was causing some threading issue so thing to remember is to make the calls to jmsTemplate.receiveSelected() (atleast this one) synchronized.
UPDATE: I was too quick to diagnose the problem as jmsTemplate issue. With more drill down I was able to reproduce the problem with pure jmsTemplate and ActiveMQ combination and looks like a ActiveMQ issue than spring-jms. My friend Gary is getting it fixed in ActiveMQ currently.
Labels:
JMS Transport,
Servicemix,
spring-jms
Friday, August 15, 2008
Monday, August 11, 2008
Changes to Apache CXF JMS transport to allow jmsDestination name
Recently Apache CXF JMS transport is modified in order to allow use of jmsDestinationName and jmsReplyDestinationName. Till now CXF JMS only allowed using jndi destination names to lookup queue/destination and was not able to use jms destination names to create queues/topics.
Here is the diff of the schema change to specify the jmsDestinationName and jmsReplyDestinationName.
Example jms:address looks like this:
This will allow CXF consumer and services to use the real queue names (where JMS provider will allow the creation of the queues) as opposed to use jndi lookup.
Here is the diff of the schema change to specify the jmsDestinationName and jmsReplyDestinationName.
Example jms:address looks like this:
<jms:address jndiconnectionfactoryname="ConnectionFactory"
jmsdestinationname="dynamicQueues/routertest.SOAPService6Q.text"
jmsreplydestinationname="dynamicQueues/SoapService6.reply.queue">
<jms:jmsnamingproperty name="java.naming.factory.initial"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
<jms:jmsnamingproperty name="java.naming.provider.url"
value="tcp://localhost:61500"/>
</jms:address>
This will allow CXF consumer and services to use the real queue names (where JMS provider will allow the creation of the queues) as opposed to use jndi lookup.
Labels:
Apache,
APACHE CXF,
JMS Transport
handy tip on how to increase jetty HttpClient threadpool size in ServiceMix 3.2.2
I was recently working on some jetty related issue in Servicemix 3.2 and got Servicemix people to update servicemix-http component to have configurable jetty httpClient thread pool size. Before I forget it I wanted to make a note of it so adding this entry.
In Servicemix 3.2.2 and onwards jetty HttpClient threadpool can be configured using following entry in component.properties file.
servicemix-http.jettyClientThreadPoolSize=33
Also, you can configure Servicemix to use Jetty httpClient per httpProvider (by default a single client is shared among all httpProviderEndpoints) by adding
servicemix-http.jettyHttpClientPerProvider=true
Also from ServiceMix 3.2.2 onwards Jetty HttpClient uses nio channel selector implementation of jetty. (previously it was using socket connector which was blocking I/O and was causing thread locking in thread pool in some stress conditions)
In Servicemix 3.2.2 and onwards jetty HttpClient threadpool can be configured using following entry in component.properties file.
servicemix-http.jettyClientThreadPoolSize=33
Also, you can configure Servicemix to use Jetty httpClient per httpProvider (by default a single client is shared among all httpProviderEndpoints) by adding
servicemix-http.jettyHttpClientPerProvider=true
Also from ServiceMix 3.2.2 onwards Jetty HttpClient uses nio channel selector implementation of jetty. (previously it was using socket connector which was blocking I/O and was causing thread locking in thread pool in some stress conditions)
Labels:
Apache,
Jetty,
Servicemix
Friday, August 1, 2008
Friday, June 6, 2008
Running CXF jms_queue sample in Tomcat
Recently, I wanted run Apache CXF jms_queue sample in tomcat and came across some problems setting up stuff so want to note the things that I had to do for it.
1. need to create the spring.xml and web.xml descriptor for deploying the jms_queue server inside Tomcat.
2. Need to add CXF and ActiveMQ jars to the container classpath. I haven't tried yet to bundle these inside the application war file that is next on my list.
3. Build the sample, create war file and deploy it to tomcat by copying it to webapp directory of the container.
4. start jms broker (I user ant task from the sample that starts embedded broker).
5. Start tomcat container. This will deploy the copied war and start the CXF jms_queue service.
6. run the client from the commandline against the service deployed into Tomcat.
Looks simple isn't it? But I had to spend 1 day figuring out how to make this work.
glitch 1: Service creation wasn't finding WSDL for my service. Reason: WSDL was bundled under WEB-INF/wsdl directory which is not on classpath so I have changed the build.xml to put it under WEB-INF/classes directory.
glitch 2: Wanted to enable logging by adding logging.properties file but wasn't able to find it on classpath. Reason: same as glitch 1 and solved when added it to WEB-INF/classes folder.
I am attaching tar file of my sample directory for future reference here.
EDIT: I couldn't find the way to upload the tar file so I am editing the post to remind me to post the changes in my next post. Not so good but can't help.
EDIT:
Here is how web.xml looks like:

And my spring.xml looks like this:

Finally here is the link to zip file that has the full example.
1. need to create the spring.xml and web.xml descriptor for deploying the jms_queue server inside Tomcat.
2. Need to add CXF and ActiveMQ jars to the container classpath. I haven't tried yet to bundle these inside the application war file that is next on my list.
3. Build the sample, create war file and deploy it to tomcat by copying it to webapp directory of the container.
4. start jms broker (I user ant task from the sample that starts embedded broker).
5. Start tomcat container. This will deploy the copied war and start the CXF jms_queue service.
6. run the client from the commandline against the service deployed into Tomcat.
Looks simple isn't it? But I had to spend 1 day figuring out how to make this work.
glitch 1: Service creation wasn't finding WSDL for my service. Reason: WSDL was bundled under WEB-INF/wsdl directory which is not on classpath so I have changed the build.xml to put it under WEB-INF/classes directory.
glitch 2: Wanted to enable logging by adding logging.properties file but wasn't able to find it on classpath. Reason: same as glitch 1 and solved when added it to WEB-INF/classes folder.
I am attaching tar file of my sample directory for future reference here.
EDIT: I couldn't find the way to upload the tar file so I am editing the post to remind me to post the changes in my next post. Not so good but can't help.
EDIT:
Here is how web.xml looks like:

And my spring.xml looks like this:

Finally here is the link to zip file that has the full example.
Labels:
Apache,
APACHE CXF,
JMS Transport,
TOMCAT
Subscribe to:
Posts (Atom)