Hi Claus,

I'm still having problems with regards to thread death issues.
I'm working on camel using websphere right now.
If I deploy this application that just writes continuously on the console
every 1 second.
Threads don't die immediately even if I stop the application in the
administration console.
This is the case.

If I Use the direct component and use threads(5) for example,
The application stops if I stop it in the administration console but the
threads don't die properly.
It will still continue to write in the system.out.logs.
Stopping the websphere service stops the threads in this case.

If iuse the activemq component and use concurrentConsumers,
the application doesn't stop if i try to stop it in the administration
console.
Stopping the websphere service doesn't help either, it waits for all of the
threads to finish.

Is there any way that I can specify that when parent thread is killed, all
threads that it spawned 
will be killed as well?

One thing I noticed also is that when the threads are finished procdessing
then no problems occur.
But there are some cases in which we need to stop the application server
regardless if there are threads
processing or not.

If the camel context dies for example, all the threads that it spawned will
be killed as well?

Thanks.


Claus Ibsen wrote:
> 
> Hi
> 
> If you use JMS as a queue then you can use the concurrentConsumers option
> and set it eg to 5 - concurrentConsumers=5
> 
> http://activemq.apache.org/camel/jms.html
> 
> And then you can drop the .thread(5) from the route path. This is the more
> correct way of using concurrency for JMS.
> 
> I am actually not familiar if Camel currently has a tweak where you can
> eg. configure it to terminate threads immediately on route stop. If not
> maybe we should add such a feature. Will have to dig into the code. 
> 
> 
> 
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
> -----Original Message-----
> From: carloc [mailto:[EMAIL PROTECTED] 
> Sent: 5. august 2008 21:31
> To: [email protected]
> Subject: Re: Camel, Websphere, And Long Running Threads
> 
> 
> I think the other processes are oracle processes.
> Anyway I tried using direct instead of activemq component.
> The application can be stopped normally from the console. However the
> threads still remain.
> 
> Is there any setting that I can tweak so that once the threads parent has
> died the other threads will die as well? 
> 
> Looking at it it seems that thread death does not occur even when the web
> application was stopped.
> Here is my route
> 
>       
> from("file://c://ufm//upload?moveNamePrefix=c://ufm//processed//&moveNamePostfix=USED").process(new
> Processor() {
> 
>                       public void process(Exchange exchange) throws Exception 
> {
>                               FileModel fileModel = new FileModel();
>                       
> fileModel.setFileName(exchange.getIn().getHeader("org.apache.camel.file.name").toString());
>                               
> fileModel.setContent(exchange.getIn().getBody(String.class));
>                               exchange.getOut().setBody(fileModel);
>                       }
>                       
>               }).to("direct:carlo");
> 
> from("direct:carlo").thread(5).process(new Processor() {
>                       public void process(Exchange exchange) throws Exception 
> {
>                               FileModel fileModel = (FileModel) 
> exchange.getIn().getBody();
>                               System.out.println(fileModel.getFileName());
>                               System.out.println(fileModel.getContent());
>                               
>                       
>                               while(1==1) {
>                                       System.out.println("aaa");
>                                       try {
>                                               
>                                       } catch(Exception e) {
>                                               e.printStackTrace();
>                                       }
>                               }
>                               
>                               
>                       }
>               });
> 
> This is just for investigation. Also if i use activemq instead of direct.
> The application just doesn't stop.
> -- 
> View this message in context:
> http://www.nabble.com/Camel%2C-Websphere%2C-And-Long-Running-Threads-tp18834455s22882p18838295.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Camel%2C-Websphere%2C-And-Long-Running-Threads-tp18834455s22882p18884984.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to