Interface StartupCondition
public interface StartupCondition
Pluggable gate evaluated repeatedly before
CamelContext finishes starting, allowing startup
to be paused until an external prerequisite is satisfied.
Camel polls each registered StartupCondition during the startup sequence. If canContinue(CamelContext) returns
false, startup waits and retries. If the condition is never satisfied within the configured timeout the
context aborts startup. Multiple conditions can be registered; all must be satisfied for startup to proceed.
Typical use cases include waiting for a readiness probe to pass, a required file or directory to appear, an
environment variable to be set, or a remote service to become reachable.- Since:
- 4.9
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanContinue(CamelContext camelContext) Checks if the condition is accepteddefault @Nullable StringOptional logging message to log if condition was not meet.default StringgetName()The name of condition used for logging purposes.default @Nullable StringOptional logging message to log before waiting for the condition
-
Method Details
-
getName
The name of condition used for logging purposes. -
getWaitMessage
Optional logging message to log before waiting for the condition -
getFailureMessage
Optional logging message to log if condition was not meet. -
canContinue
Checks if the condition is accepted- Parameters:
camelContext- the Camel context (is not fully initialized)- Returns:
- true to continue, false to stop and fail.
- Throws:
Exception
-