You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Simon Alexander (Jira)" <ji...@apache.org> on 2024/10/04 15:45:00 UTC
[jira] [Created] (CAMEL-21319) Supervising routecontroller doesn't play nicely with SMPP if the SMS-C is down on route startup
Simon Alexander created CAMEL-21319:
---------------------------------------
Summary: Supervising routecontroller doesn't play nicely with SMPP if the SMS-C is down on route startup
Key: CAMEL-21319
URL: https://issues.apache.org/jira/browse/CAMEL-21319
Project: Camel
Issue Type: Bug
Components: camel-smpp
Affects Versions: 4.4.1
Reporter: Simon Alexander
Say I have two routes in a RouteBuilder:
{code:java}
public class SimpleTestRouteBuilder extends RouteBuilder
{
@Override
public void configure() throws Exception
{
from("timer:/foo?repeatCount=20")
.to("smpp://localhost:2775");
from("timer:/foo2?repeatCount=20")
.to("smpp://localhost:2776");
}
}{code}
(in practice you would populate your message body - and read from an MQ Queue or whatever)
When I start the application up, if either route can't connect to its producer, then the application will shut down - fine.
SupervisingRouteController ([See Docs|https://camel.apache.org/manual/route-controller.html#_supervisingroutecontroller]) is intended to overcome this limitation - "This controller is able to retry starting failing routes".
So I then configure my application.yaml to use this:
{code:java}
camel:
routecontroller:
enabled: true
backoffDelay: 5000
backoffMaxAttempts: 17280
initialDelay: 1000
threadPoolSize: 2
unhealthyOnExhausted: false
unhealthyOnRestarting: false
includeRoutes: "*" {code}
However, if the first SMS-C is not running, the application won't start! It just shuts down after an attempt to start the route.
Some digging showed me that the "warmup" that the camel context does starts the processors (i.e. calling startup in SmppProducer.java to open the connection to the SMS-C) before the SupervisingRouteController kicks in and takes over control of the route.
In my mind, this shouldn't happen. If the Producer can't connect, it should either retry until it can (or at least that should be a configurable option); or the SRC should be able to take control (by not starting the endpoint on warmup, but rather on route startup).
Additionally, and weirdly, with my example above, if the _second_ SMS-C (on port 2776) is down, but the one on port 2775 is {_}up{_}, then the application behaves exactly as I would expect – the SRC takes over and retries the second route until the connection is available again. It's almost like Camel is only warming up the first route? But I'm not 100% sure on that point.
Anyway, the DefaultSupervisingRouteController code is working as intended - it only kicks in after warmup. But the camel-smpp code isn't allowing it to do its job because the warmup kills the application too soon.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)