Class MainConfigurationProperties

    • Constructor Detail

      • MainConfigurationProperties

        public MainConfigurationProperties()
    • Method Detail

      • hasHealthCheckConfiguration

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

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

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

        public boolean hasHystrixConfiguration()
        Whether there has been any Hystrix EIP configuration specified
      • hasResilience4jConfiguration

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

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

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

        public boolean hasVaultConfiguration()
        Whether there has been any vault configuration specified
      • 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, and TypeConverter classes. 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.
      • getRoutesCompileDirectory

        public String getRoutesCompileDirectory()
      • setRoutesCompileDirectory

        public void setRoutesCompileDirectory​(String routesCompileDirectory)
        Directory to use for saving runtime compiled Camel routes to class files, when using camel-java-joor-dsl as Java DSL (such as when using Camel K with Java source routes). Camel will compile to in-memory only by default. Specifying this option, allows Camel to persist the compiled class to disk. And when starting the application again the routes are loaded from the pre-compiled class files instead of re-compiling again.
      • isRoutesCompileLoadFirst

        public boolean isRoutesCompileLoadFirst()
      • setRoutesCompileLoadFirst

        public void setRoutesCompileLoadFirst​(boolean routesCompileLoadFirst)
        Whether to load preexisting compiled Camel routes class files, when using camel-java-joor-dsl as Java DSL (such as when using Camel K with Java source routes). If enabled then Camel will look in the routes compile directory if a compiled Java route already exists and load its bytecode instead of runtime compiling from its java source file.
      • 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.
      • 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, and TypeConverter classes. 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.
      • withRoutesCompileDirectory

        public MainConfigurationProperties withRoutesCompileDirectory​(String routeCompileDirectory)
        Directory to use for saving runtime compiled Camel routes to class files, when using camel-java-joor-dsl as Java DSL (such as when using Camel K with Java source routes). Camel will compile to in-memory only by default. Specifying this option, allows Camel to persist the compiled class to disk. And when starting the application again the routes are loaded from the pre-compiled class files instead of re-compiling again.
      • withRoutesCompileLoadFirst

        public MainConfigurationProperties withRoutesCompileLoadFirst​(boolean routesCompileLoadFirst)
        Whether to load preexisting compiled Camel routes class files, when using camel-java-joor-dsl as Java DSL (such as when using Camel K with Java source routes). If enabled then Camel will look in the routes compile directory if a compiled Java route already exists and load its bytecode instead of runtime compiling from its java source file.
      • 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.
      • 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.