You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "peter.argalas" <pe...@zuno.eu> on 2011/04/08 16:43:53 UTC

Camel context shutdown after route (with smpp) initialization failure

Hi,

in my project I use 3 routes (each route connects to one SMSC using
camel-smpp).

Problem is that if one SMSC is down, smpp connection cannot be created so
respective route cannot be started and this lead to camel shutdown.

Is there any option how to ignore routes (remove them from context), that
could not be started and start camel without them?

Or is it possible to start route with camel-smpp  component and in case
connection to SMSC cannot be created trigger reconnecting process?

Log:

Disconnected from: smpp://*****@smpp1.infobip.com:8888
Apache Camel 2.7.0 (CamelContext:camelContext) is shutting down
Starting to graceful shutdown 0 routes (timeout 300 seconds)


--
View this message in context: http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4291032.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel context shutdown after route (with smpp) initialization failure

Posted by "ben.oday" <be...@initekconsulting.com>.
you should be able to set noAutoStartup() on the routes and then use a
separate process to try to start them later


peter.argalas wrote:
> 
> Is there any option how to ignore routes (remove them from context), that
> could not be started and start camel without them?
> 


-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4291301.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel context shutdown after route (with smpp) initialization failure

Posted by "peter.argalas" <pe...@zuno.eu>.
Created CAMEL-3853.

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4295714.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel context shutdown after route (with smpp) initialization failure

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can log a JIRA ticket to add a feature to that component so it can
lazy create the connection.
http://camel.apache.org/support

Something like we have in camel-mina with the lazySessionCreation option
http://camel.apache.org/mina

Then it would only try to connect on-demand. And you should be able to
startup Camel.


On Mon, Apr 11, 2011 at 9:40 AM, peter.argalas <pe...@zuno.eu> wrote:
> Hi,
>
> thank you for your advice. Unfortunately it does not helped (or I am doing
> something wrong).
>
> I tried it but with no success.
>
> My current configuration is:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> But as I can see in log it always tries to connect to SMSC in
> infobip1Context (set not to start automatically) and connection failure
> results to camel shutdown. It does not continue to create next context
> infobip3Context.
>
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
> infobip1Context) is starting
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
> infobip1Context) is starting
> SpringCamelContext   INFO  JMX enabled. Using ManagedManagementStrategy.
> SpringCamelContext   INFO  JMX enabled. Using ManagedManagementStrategy.
> SpringCamelContext   INFO  Cannot start routes as CamelContext has been
> configured with autoStartup=false
> SpringCamelContext   INFO  Cannot start routes as CamelContext has been
> configured with autoStartup=false
> SmppProducer         INFO  Disconnected from:
> smpp://zuno_dev@smpp1.infobip.com:8888
> SmppProducer         INFO  Disconnected from:
> smpp://zuno_dev@smpp1.infobip.com:8888
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:infobip1Context)
> is shutting down
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:infobip1Context)
> is shutting down
> aultShutdownStrategy INFO  Starting to graceful shutdown 0 routes (timeout
> 300 seconds)
> aultShutdownStrategy INFO  Starting to graceful shutdown 0 routes (timeout
> 300 seconds)
> aultShutdownStrategy INFO  Graceful shutdown of 0 routes completed in 0
> seconds
> aultShutdownStrategy INFO  Graceful shutdown of 0 routes completed in 0
> seconds
> ltInflightRepository INFO  Shutting down with no inflight exchanges.
> ltInflightRepository INFO  Shutting down with no inflight exchanges.
> SpringCamelContext   INFO  Uptime: 1.328 seconds
> SpringCamelContext   INFO  Uptime: 1.328 seconds
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
> infobip1Context) is shutdown in 0.078 seconds
> SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
> infobip1Context) is shutdown in 0.078 seconds
>
>
> Any advise?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4295356.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel context shutdown after route (with smpp) initialization failure

Posted by "peter.argalas" <pe...@zuno.eu>.
Hi,

thank you for your advice. Unfortunately it does not helped (or I am doing
something wrong).

I tried it but with no success.

My current configuration is: 

        
                
                    
                        
                            
                        
                
                
                    
                        
                
        
        
                
                    
                        
                            
                        
                
                
                    
                        
                
        

But as I can see in log it always tries to connect to SMSC in
infobip1Context (set not to start automatically) and connection failure
results to camel shutdown. It does not continue to create next context
infobip3Context.

SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
infobip1Context) is starting
SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
infobip1Context) is starting
SpringCamelContext   INFO  JMX enabled. Using ManagedManagementStrategy.
SpringCamelContext   INFO  JMX enabled. Using ManagedManagementStrategy.
SpringCamelContext   INFO  Cannot start routes as CamelContext has been
configured with autoStartup=false
SpringCamelContext   INFO  Cannot start routes as CamelContext has been
configured with autoStartup=false
SmppProducer         INFO  Disconnected from:
smpp://zuno_dev@smpp1.infobip.com:8888
SmppProducer         INFO  Disconnected from:
smpp://zuno_dev@smpp1.infobip.com:8888
SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:infobip1Context)
is shutting down
SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:infobip1Context)
is shutting down
aultShutdownStrategy INFO  Starting to graceful shutdown 0 routes (timeout
300 seconds)
aultShutdownStrategy INFO  Starting to graceful shutdown 0 routes (timeout
300 seconds)
aultShutdownStrategy INFO  Graceful shutdown of 0 routes completed in 0
seconds
aultShutdownStrategy INFO  Graceful shutdown of 0 routes completed in 0
seconds
ltInflightRepository INFO  Shutting down with no inflight exchanges.
ltInflightRepository INFO  Shutting down with no inflight exchanges.
SpringCamelContext   INFO  Uptime: 1.328 seconds
SpringCamelContext   INFO  Uptime: 1.328 seconds
SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
infobip1Context) is shutdown in 0.078 seconds
SpringCamelContext   INFO  Apache Camel 2.7.0 (CamelContext:
infobip1Context) is shutdown in 0.078 seconds


Any advise?

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4295356.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel context shutdown after route (with smpp) initialization failure

Posted by Christian Müller <ch...@gmail.com>.
Hello Peter!

The SmppConsumer is started by default if Camel starts and he must be able
to connect the SMSC. The SmppProducer will create the connection to the
SMSC, when the first exchange arrives by default.
As Ben suggested, you can set the autostart option to false
'context.setAutoStartup(Boolean.FALSE);' and start it by yourself at a later
time (and handle the ConnectException).

The reconnection behavior only kicks in, if the SmppConsumer or SmppProducer
lose the connection to the SMSC.

Regards,
Christian

On Fri, Apr 8, 2011 at 4:43 PM, peter.argalas <pe...@zuno.eu> wrote:

> Hi,
>
> in my project I use 3 routes (each route connects to one SMSC using
> camel-smpp).
>
> Problem is that if one SMSC is down, smpp connection cannot be created so
> respective route cannot be started and this lead to camel shutdown.
>
> Is there any option how to ignore routes (remove them from context), that
> could not be started and start camel without them?
>
> Or is it possible to start route with camel-smpp  component and in case
> connection to SMSC cannot be created trigger reconnecting process?
>
> Log:
>
> Disconnected from: smpp://*****@smpp1.infobip.com:8888
> Apache Camel 2.7.0 (CamelContext:camelContext) is shutting down
> Starting to graceful shutdown 0 routes (timeout 300 seconds)
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-context-shutdown-after-route-with-smpp-initialization-failure-tp4291032p4291032.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>