Class MainConfigurationProperties

All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.camel.spi.BootstrapCloseable

@Configurer(bootstrap=true) public class MainConfigurationProperties extends DefaultConfigurationProperties<MainConfigurationProperties> implements org.apache.camel.spi.BootstrapCloseable
Global configuration for Camel Main to configure context name, stream caching and other global configurations.
  • Constructor Details

    • MainConfigurationProperties

      public MainConfigurationProperties()
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • health

      To configure Health Check
    • hasHealthCheckConfiguration

      public boolean hasHealthCheckConfiguration()
      Whether there has been any health check configuration specified
    • lra

      To configure Saga LRA
    • hasLraConfiguration

      public boolean hasLraConfiguration()
      Whether there has been any Saga LRA configuration specified
    • otel

      To configure OpenTelemetry.
    • hasOtelConfiguration

      public boolean hasOtelConfiguration()
      Whether there has been any OpenTelemetry configuration specified
    • metrics

      To configure Micrometer metrics.
    • hasMetricsConfiguration

      public boolean hasMetricsConfiguration()
      Whether there has been any Micrometer metrics configuration specified
    • httpServer

      public HttpServerConfigurationProperties httpServer()
      To configure embedded HTTP server (for standalone applications; not Spring Boot or Quarkus)
    • hasHttpServerConfiguration

      public boolean hasHttpServerConfiguration()
      Whether there has been any embedded HTTP server configuration specified
    • sslConfig

      public SSLConfigurationProperties sslConfig()
      To configure SSL.
    • hasSslConfiguration

      public boolean hasSslConfiguration()
      Whether there has been any SSL configuration specified.
    • debuggerConfig

      public DebuggerConfigurationProperties debuggerConfig()
      To configure Debugger.
    • hasDebuggerConfiguration

      public boolean hasDebuggerConfiguration()
      Whether there has been any Debugger configuration specified.
    • tracerConfig

      public TracerConfigurationProperties tracerConfig()
      To configure Tracer.
    • hasTracerConfiguration

      public boolean hasTracerConfiguration()
      Whether there has been any Tracer configuration specified.
    • routeControllerConfig

      public RouteControllerConfigurationProperties routeControllerConfig()
      To configure Route Controller.
    • hasRouteControllerConfiguration

      public boolean hasRouteControllerConfiguration()
      Whether there has been any Route Controller configuration specified.
    • threadPool

      public ThreadPoolConfigurationProperties threadPool()
      To configure thread pools
    • hasThreadPoolConfiguration

      public boolean hasThreadPoolConfiguration()
      Whether there has been any thread pool configuration specified
    • resilience4j

      public Resilience4jConfigurationProperties resilience4j()
      To configure Circuit Breaker EIP with Resilience4j
    • hasResilience4jConfiguration

      public boolean hasResilience4jConfiguration()
      Whether there has been any Resilience4j EIP configuration specified
    • faultTolerance

      public FaultToleranceConfigurationProperties faultTolerance()
      To configure Circuit Breaker EIP with MicroProfile Fault Tolerance
    • hasFaultToleranceConfiguration

      public boolean hasFaultToleranceConfiguration()
      Whether there has been any MicroProfile Fault Tolerance EIP configuration specified
    • rest

      To configure Rest DSL
    • hasRestConfiguration

      public boolean hasRestConfiguration()
      Whether there has been any rest configuration specified
    • vault

      To configure access to AWS vaults
    • hasVaultConfiguration

      public boolean hasVaultConfiguration()
      Whether there has been any vault configuration specified
    • getProfile

      public String getProfile()
    • setProfile

      public void setProfile(String profile)
      Camel profile to use when running. The dev profile is for development, which enables a set of additional developer focus functionality, tracing, debugging, and gathering additional runtime statistics that are useful during development. However, those additional features has a slight overhead cost, and are not enabled for production profile. The default profile is prod.
    • isAutoConfigurationEnabled

      public boolean isAutoConfigurationEnabled()
    • setAutoConfigurationEnabled

      public void setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
      Whether auto configuration of components, dataformats, languages is enabled or not. When enabled the configuration parameters are loaded from the properties component. You can prefix the parameters in the properties file with: - camel.component.name.option1=value1 - camel.component.name.option2=value2 - camel.dataformat.name.option1=value1 - camel.dataformat.name.option2=value2 - camel.language.name.option1=value1 - camel.language.name.option2=value2 Where name is the name of the component, dataformat or language such as seda,direct,jaxb.

      The auto configuration also works for any options on components that is a complex type (not standard Java type) and there has been an explicit single bean instance registered to the Camel registry via the Registry.bind(String, Object) method or by using the BindToRegistry annotation style.

      This option is default enabled.

    • isAutoConfigurationEnvironmentVariablesEnabled

      public boolean isAutoConfigurationEnvironmentVariablesEnabled()
    • setAutoConfigurationEnvironmentVariablesEnabled

      public void setAutoConfigurationEnvironmentVariablesEnabled(boolean autoConfigurationEnvironmentVariablesEnabled)
      Whether auto configuration should include OS environment variables as well. When enabled this allows to overrule any configuration using an OS environment variable. For example to set a shutdown timeout of 5 seconds: CAMEL_MAIN_SHUTDOWNTIMEOUT=5.

      This option is default enabled.

    • isAutoConfigurationSystemPropertiesEnabled

      public boolean isAutoConfigurationSystemPropertiesEnabled()
    • setAutoConfigurationSystemPropertiesEnabled

      public void setAutoConfigurationSystemPropertiesEnabled(boolean autoConfigurationSystemPropertiesEnabled)
      Whether auto configuration should include JVM system properties as well. When enabled this allows to overrule any configuration using a JVM system property. For example to set a shutdown timeout of 5 seconds: -D camel.main.shutdown-timeout=5.

      Note that JVM system properties take precedence over OS environment variables.

      This option is default enabled.

    • isAutoConfigurationFailFast

      public boolean isAutoConfigurationFailFast()
    • setAutoConfigurationFailFast

      public void setAutoConfigurationFailFast(boolean autoConfigurationFailFast)
      Whether auto configuration should fail fast when configuring one ore more properties fails for whatever reason such as a invalid property name, etc.

      This option is default enabled.

    • isAutoConfigurationLogSummary

      public boolean isAutoConfigurationLogSummary()
    • setAutoConfigurationLogSummary

      public void setAutoConfigurationLogSummary(boolean autoConfigurationLogSummary)
      Whether auto configuration should log a summary with the configured properties.

      This option is default enabled.

    • getBasePackageScan

      public String getBasePackageScan()
    • setBasePackageScan

      public void setBasePackageScan(String basePackageScan)
      Package name to use as base (offset) for classpath scanning of RouteBuilder, TypeConverter, CamelConfiguration classes, and also classes annotated with Converter, or BindToRegistry. If you are using Spring Boot then it is instead recommended to use Spring Boots component scanning and annotate your route builder classes with `@Component`. In other words only use this for Camel Main in standalone mode.
    • isBasePackageScanEnabled

      public boolean isBasePackageScanEnabled()
    • setBasePackageScanEnabled

      public void setBasePackageScanEnabled(boolean basePackageScanEnabled)
      Whether base package scan is enabled.
    • getDurationHitExitCode

      public int getDurationHitExitCode()
    • setDurationHitExitCode

      public void setDurationHitExitCode(int durationHitExitCode)
      Sets the exit code for the application if duration was hit
    • getExtraShutdownTimeout

      public int getExtraShutdownTimeout()
    • setExtraShutdownTimeout

      public void setExtraShutdownTimeout(int extraShutdownTimeout)
      Extra timeout in seconds to graceful shutdown Camel. When Camel is shutting down then Camel first shutdown all the routes (shutdownTimeout). Then additional services is shutdown (extraShutdownTimeout).
    • getConfigurationClasses

      public String getConfigurationClasses()
    • setConfigurationClasses

      public void setConfigurationClasses(String configurations)
      Sets classes names that will be used to configure the camel context as example by providing custom beans through BindToRegistry annotation.
    • addConfiguration

      public void addConfiguration(org.apache.camel.CamelConfiguration configuration)
      Adds configuration object to the known list of configurations objects.
    • addConfiguration

      public void addConfiguration(Class<? extends org.apache.camel.CamelConfiguration> configuration)
      Adds configuration object to the known list of configurations objects.
    • getConfigurations

      public List<org.apache.camel.CamelConfiguration> getConfigurations()
    • setConfigurations

      public void setConfigurations(List<org.apache.camel.CamelConfiguration> configurations)
      Sets the configuration objects used to configure the camel context.
    • getRoutesBuilderClasses

      public String getRoutesBuilderClasses()
    • setRoutesBuilderClasses

      public void setRoutesBuilderClasses(String builders)
      Sets classes names that implement RoutesBuilder.
    • getRoutesBuilders

      public List<org.apache.camel.RoutesBuilder> getRoutesBuilders()
    • setRoutesBuilders

      public void setRoutesBuilders(List<org.apache.camel.RoutesBuilder> routesBuilders)
      Sets the RoutesBuilder instances.
    • addRoutesBuilder

      public void addRoutesBuilder(org.apache.camel.RoutesBuilder routeBuilder)
      Add an additional RoutesBuilder object to the known list of builders.
    • addRoutesBuilder

      public void addRoutesBuilder(Class<?>... routeBuilder)
      Add an additional RoutesBuilder class to the known list of builders.
    • addLambdaRouteBuilder

      public void addLambdaRouteBuilder(org.apache.camel.builder.LambdaRouteBuilder routeBuilder)
      Add an additional LambdaRouteBuilder object to the known list of builders.
    • withProfile

      public MainConfigurationProperties withProfile(String profile)
      Camel profile to use when running. The dev profile is for development, which enables a set of additional developer focus functionality, tracing, debugging, and gathering additional runtime statistics that are useful during development. However, those additional features has a slight overhead cost, and are not enabled for production profile. The default profile is prod.
    • withAutoConfigurationEnabled

      public MainConfigurationProperties withAutoConfigurationEnabled(boolean autoConfigurationEnabled)
      Whether auto configuration of components/dataformats/languages is enabled or not. When enabled the configuration parameters are loaded from the properties component and configured as defaults (similar to spring-boot auto-configuration). You can prefix the parameters in the properties file with: - camel.component.name.option1=value1 - camel.component.name.option2=value2 - camel.dataformat.name.option1=value1 - camel.dataformat.name.option2=value2 - camel.language.name.option1=value1 - camel.language.name.option2=value2 Where name is the name of the component, dataformat or language such as seda,direct,jaxb.

      The auto configuration also works for any options on components that is a complex type (not standard Java type) and there has been an explicit single bean instance registered to the Camel registry via the Registry.bind(String, Object) method or by using the BindToRegistry annotation style.

      This option is default enabled.

    • withAutoConfigurationEnvironmentVariablesEnabled

      public MainConfigurationProperties withAutoConfigurationEnvironmentVariablesEnabled(boolean autoConfigurationEnvironmentVariablesEnabled)
      Whether auto configuration should include OS environment variables as well. When enabled this allows to overrule any configuration using an OS environment variable. For example to set a shutdown timeout of 5 seconds: CAMEL_MAIN_SHUTDOWNTIMEOUT=5.

      This option is default enabled.

    • withAutoConfigurationSystemPropertiesEnabled

      public MainConfigurationProperties withAutoConfigurationSystemPropertiesEnabled(boolean autoConfigurationSystemPropertiesEnabled)
      Whether auto configuration should include JVM system properties as well. When enabled this allows to overrule any configuration using a JVM system property. For example to set a shutdown timeout of 5 seconds: -D camel.main.shutdown-timeout=5.

      Note that JVM system properties take precedence over OS environment variables.

      This option is default enabled.

    • withAutoConfigurationFailFast

      public MainConfigurationProperties withAutoConfigurationFailFast(boolean autoConfigurationFailFast)
      Whether auto configuration should fail fast when configuring one ore more properties fails for whatever reason such as a invalid property name, etc.

      This option is default enabled.

    • withAutoConfigurationLogSummary

      public MainConfigurationProperties withAutoConfigurationLogSummary(boolean autoConfigurationLogSummary)
      Whether auto configuration should log a summary with the configured properties.

      This option is default enabled.

    • withDurationHitExitCode

      public MainConfigurationProperties withDurationHitExitCode(int durationHitExitCode)
      Sets the exit code for the application if duration was hit
    • withExtraShutdownTimeout

      public MainConfigurationProperties withExtraShutdownTimeout(int extraShutdownTimeout)
      Extra timeout in seconds to graceful shutdown Camel. When Camel is shutting down then Camel first shutdown all the routes (shutdownTimeout). Then additional services is shutdown (extraShutdownTimeout).
    • withBasePackageScan

      public MainConfigurationProperties withBasePackageScan(String basePackageScan)
      Package name to use as base (offset) for classpath scanning of RouteBuilder, TypeConverter, CamelConfiguration classes, and also classes annotated with Converter, or BindToRegistry. If you are using Spring Boot then it is instead recommended to use Spring Boots component scanning and annotate your route builder classes with `@Component`. In other words only use this for Camel Main in standalone mode.
    • withBasePackageScanEnabled

      public MainConfigurationProperties withBasePackageScanEnabled(boolean basePackageScanEnabled)
      Whether base package scan is enabled.
    • withConfigurations

      public MainConfigurationProperties withConfigurations(String configurations)
      Adds classes names that will be used to configure the camel context as example by providing custom beans through BindToRegistry annotation.
    • withConfigurations

      public MainConfigurationProperties withConfigurations(Class<? extends org.apache.camel.CamelConfiguration>... configuration)
      Adds a configuration class to the known list of configurations classes.
    • withConfigurations

      public MainConfigurationProperties withConfigurations(List<org.apache.camel.CamelConfiguration> configurations)
      Sets the configuration objects used to configure the camel context.
    • withRoutesBuilderClasses

      public MainConfigurationProperties withRoutesBuilderClasses(String builders)
      Sets classes names that implement RoutesBuilder.
    • withRoutesBuilders

      public MainConfigurationProperties withRoutesBuilders(List<org.apache.camel.RoutesBuilder> builders)
      Sets the RoutesBuilder instances.
    • withAdditionalRoutesBuilder

      public MainConfigurationProperties withAdditionalRoutesBuilder(org.apache.camel.RoutesBuilder builder)
      Add an additional RoutesBuilder object to the known list of builders.
    • withAdditionalRoutesBuilder

      public MainConfigurationProperties withAdditionalRoutesBuilder(Class... builders)
      Add an additional RoutesBuilder class to the known list of builders.
    • withAdditionalLambdaRouteBuilder

      public MainConfigurationProperties withAdditionalLambdaRouteBuilder(org.apache.camel.builder.LambdaRouteBuilder builder)
      Add an additional LambdaRouteBuilder object to the known list of builders.