camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Is it Camel Bug?
Date Mon, 29 Jul 2013 06:31:08 GMT
Hi

I can give you some explain about the default-workqueue thread pool.

Thread[default-workqueue-1,5,default-workqueue]

As camel-cxf producer is using the async invocation by default, the default-workqueue is used
for handle the request in other thread, when the camel context is stopped, it doesn't shutdown
the default-workqueue. It's bug of camel-cxf, I just fill a JIRA[1] for it.

You should work around it by setting the option of synchronous to be true in camel-cxf endpoint
uri.

[1]https://issues.apache.org/jira/browse/CAMEL-6585

Willem  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Monday, July 29, 2013 at 1:41 PM, SyedBhai wrote:

> Hello everyone.
> Please. Try to understand my problem.
> Lets forget about web application or standalone application or tomcat.
>  
> The problem is very simple. I have a WSDL based webservice. I want to
> invoke this service using Camel and get the results.
>  
> The code for doing this is here.
>  
> public class Run {
>  
> public static void main(String str[]) {
> try {
> CamelContext cc = new DefaultCamelContext();
> cc.addRoutes(new RouteBuilder() {
> public void configure() {
> from("direct:start1").
>  
> to("cxf://http://localhost:8080/JAXWS1/MyInterfaceImpl?serviceClass=com.syed.MyInterface&serviceName={http://syed.com/}MyInterfaceImplService&portName={http://syed.com/}MyInterfaceImplPort");
 
> }
> });
>  
> cc.start();
> ProducerTemplate t = cc.createProducerTemplate();
> int annsal = t.requestBody("direct:start1", 10000,
> Integer.class);
> System.out.println("annsal:" + annsal);
> t.stop();
> cc.stop();  
> } catch (Exception i) {
> i.printStackTrace();
> }
> }
> }
>  
> When I run the above program I am able to get the results. But the
> program is still running. Even though I shutdown template first followed by
> context the program is still running.
>  
> I wanted to print the list of threads that are running. The list of
> threads is available in my first message.
>  
> With this I concluded there is a bug in camel. Camel is creating some
> threads and not stopping them. Or the bug could be with utilities used by
> camel such as CXF, etc.
>  
> I have similar piece of code in my web application. Because the
> standalone program is not terminating my thread in web application is also
> not terminating.
>  
> Can you guys just help me how to gracefully shut down the camel in the
> above piece of code.
>  
> Please do not suggest System.exit(). That will not help me.
>  
> Thanks,
> Syed.
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736391.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message