You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gnana <m....@gmail.com> on 2017/02/16 23:06:34 UTC

Camel JPA Thread Hung

Hi All,I have created one route which has JPA component to poll the records
from DB periodically. it is working good. I hope each route has one worker
thread. if DB is down or any N/W issue for minute, route is not working as
expected. application is running.( it is not polling records from DB even
after DB or N/W is up ). I think worker thread got hung and route is not
working. please anybody help me to fix this issue.How to avoid this worker
thread hung ?How to restart the worker thread once N/W or DB is up ?    



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA Thread Hung

Posted by Gnana <m....@gmail.com>.
SimpleRegistry registry = new SimpleRegistry(); 
registry.put("datasource",myDataSourceObj);
CamelContext context = new DefaultCamelContext(registry); 
context.addRoutes(new myRouteBuilder()); 

from URI=
"uri="jpa://br.rafaeltuelho.model.Customer?consumer.namedQuery=Customer.findAll&amp;consumer.delay=30000&amp;consumeDelete=true"



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001p5795199.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA Thread Hung

Posted by Gnana <m....@gmail.com>.
<from
uri="jpa://br.rafaeltuelho.model.Customer?consumer.namedQuery=Customer.findAll&amp;consumer.delay=30000&amp;consumeDelete=true"
/>
    <log message="-&gt; [List content]: ${body}"/>



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001p5794044.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA Thread Hung

Posted by Marcel Lanz <ma...@n-1.ch>.
Hi

could you provide the route you defined with the parameters defined?

Marcel

> On 17 Feb 2017, at 00:06, Gnana <m....@gmail.com> wrote:
> 
> Hi All,I have created one route which has JPA component to poll the records
> from DB periodically. it is working good. I hope each route has one worker
> thread. if DB is down or any N/W issue for minute, route is not working as
> expected. application is running.( it is not polling records from DB even
> after DB or N/W is up ). I think worker thread got hung and route is not
> working. please anybody help me to fix this issue.How to avoid this worker
> thread hung ?How to restart the worker thread once N/W or DB is up ?    
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel JPA Thread Hung

Posted by Gnana <m....@gmail.com>.
SimpleRegistry registry = new SimpleRegistry(); 
registry.put("datasource",myDataSourceObj);
CamelContext context = new DefaultCamelContext(registry); 
context.addRoutes(new myRouteBuilder()); 

from URI=
"uri="jpa://br.rafaeltuelho.model.Customer?consumer.namedQuery=Customer.findAll&amp;consumer.delay=30000&amp;consumeDelete=true"



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001p5795200.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel JPA Thread Hung

Posted by Claus Ibsen <cl...@gmail.com>.
I would start look at your jdbc driver and connection pooling how that
is configured to have a way of "heal" broken connections

On Fri, Feb 17, 2017 at 12:06 AM, Gnana <m....@gmail.com> wrote:
> Hi All,I have created one route which has JPA component to poll the records
> from DB periodically. it is working good. I hope each route has one worker
> thread. if DB is down or any N/W issue for minute, route is not working as
> expected. application is running.( it is not polling records from DB even
> after DB or N/W is up ). I think worker thread got hung and route is not
> working. please anybody help me to fix this issue.How to avoid this worker
> thread hung ?How to restart the worker thread once N/W or DB is up ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-JPA-Thread-Hung-tp5794001.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2