Re: camel-quartz failed camel route creation when database is unreachable

2016-12-20 Thread Rachid KRAIEM
Hello,

Yes, it's my message

Cordialement,

*Rachid KRAIEM*




2016-12-20 17:45 GMT+01:00 Rachid KRAIEM [via Camel] <
ml-node+s465427n5791747...@n5.nabble.com>:

> Hi,
>
> Given the best practice is not to change the APIs, can you raise a JIRA
> that contain this solution and include him in the next release of
> camel-quartz ?
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-
> route-creation-when-database-is-unreachable-tp5789552p5791747.html
> To unsubscribe from camel-quartz failed camel route creation when database
> is unreachable, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-route-creation-when-database-is-unreachable-tp5789552p5791749.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel-quartz failed camel route creation when database is unreachable

2016-12-20 Thread Rachid KRAIEM
Hi,

Given the best practice is not to change the APIs, can you raise a JIRA that
contain this solution and include him in the next release of camel-quartz ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-route-creation-when-database-is-unreachable-tp5789552p5791747.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-quartz failed camel route creation when database is unreachable

2016-11-07 Thread Rachid KRAIEM
Thanks Claus,

Can you raise a JIRA that contain this solution ?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-route-creation-when-database-is-unreachable-tp5789552p5789852.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-quartz failed camel route creation when database is unreachable

2016-11-07 Thread Claus Ibsen
Yes there is no re-connection or the likes when starting a quartz route.

You can do as you did with your own custom component.

Its a bit tricky to do re-connection as it would entail a background
thread keep running and trying to startup the route until its
succesful, and then you need ways to configure how often it should
try, and whatnot.

Camel 3.x will introduce async startup of routes and as well a way of
configuring retry strategies etc. that would work generic for all
routes/consumers.


On Tue, Nov 1, 2016 at 11:49 AM, Rachid KRAIEM  wrote:
> Hi Everyone:
>
> My bundle osgi installed into karaf container 4.0.7, that use
> camel-quartz2-2.17.3 In camelContext I have many routes such as "myRoute",
> it call a job quatrz (using camel-quartz2) configured in postgresql
> database:
>
> 
> Camel route
> 
>
>
>   xmlns="http://camel.apache.org/schema/blueprint";>
>
> 
> 
> uri="quartz2://statGroup/startupTimer?cron={{stat.purge.wan.volume.daily.dc}}"
> />
> 
> 
>
>  
>
> 
> Bean quartz2
> 
>
>   class="org.apache.camel.component.quartz2.QuartzComponent">
>  value="file:etc/stat_quartz.cfg" />
>  
>
> 
> quartz2 configuration : stat_quartz.cfg
> 
>
>
> #
> # Configure Main Scheduler Properties
> #
> org.quartz.scheduler.instanceName=Scheduler
> org.quartz.scheduler.instanceId=AUTO
> org.quartz.scheduler.skipUpdateCheck=true
> org.quartz.scheduler.jobFactory.class=org.quartz.simpl.SimpleJobFactory
> #
> # Configure ThreadPool
> #
> org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
> org.quartz.threadPool.threadCount=10
> #
> # Configure JobStore
> #
> org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
> org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
> org.quartz.jobStore.dataSource=statQuartzDS
> org.quartz.jobStore.tablePrefix=stat_qrtz_
> org.quartz.jobStore.isClustered=true
> org.quartz.jobStore.clusterCheckinInterval=2
> org.quartz.jobStore.useProperties=false
> #
> # Configure Datasources
> #
> org.quartz.dataSource.statQuartzDS.jndiURL=osgi:service/statQuartzDS
>
>
> 
> Problem
> 
>
>
> My issue is when I try to starting the karaf container and postgresql is
> stopped, I have the log problem below and the camelContext "myCamelContext"
> will be shutdown.
>
>
> 2016-10-14 17:21:40,201 | ERROR | FelixStartLevel  | BlueprintCamelContext
> | 80 - org.apache.camel.camel-blueprint - 2.17.3 | Error occurred during
> starting Camel: CamelContext(statisticsContext) due Failed to create route
> myRoute: Route(myRoute)[[From[quartz2://stat... because of Failed to resolve
> endpoint:
> quartz2://statGroup/startupTimer?trigger.repeatCount=0&trigger.repeatInterval=1
> due to: Failed to obtain DB connection from data source 'statQuartzDS':
> java.sql.SQLException: Could not retrieve datasource via JNDI url
> 'osgi:service/statQuartzDS' java.sql.SQLException: Unable to acquire a new
> connection from the pool
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> myRoute: Route(myRoute)[[From[quartz2://stat... because of Failed to resolve
> endpoint:
> quartz2://statGroup/startupTimer?trigger.repeatCount=0&trigger.repeatInterval=1
> due to: Failed to obtain DB connection from data source 'statQuartzDS':
> java.sql.SQLException: Could not retrieve datasource via JNDI url
> 'osgi:service/statQuartzDS' java.sql.SQLException: Unable to acquire a new
> connection from the pool
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:201)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:974)[83:or

Re: camel-quartz failed camel route creation when database is unreachable

2016-11-07 Thread souciance
I cannot comment on the code for starting the route when the database is
unavailable but why  not add some default properties to use when the
database is not available. Then you catch the exception and use those
properties instead.



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-route-creation-when-database-is-unreachable-tp5789552p5789827.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-quartz failed camel route creation when database is unreachable

2016-11-07 Thread Rachid KRAIEM
Hi Everyone,

Can you validate this proposal



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-quartz-failed-camel-route-creation-when-database-is-unreachable-tp5789552p5789822.html
Sent from the Camel - Users mailing list archive at Nabble.com.