Camel Spring Boot

OpenFeature

Evaluate feature flags using the OpenFeature specification with flagd.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-openfeature-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 19 options, which are listed below.

Name Description Default Type

camel.component.openfeature.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.openfeature.cert-path

Path to the TLS certificate for the remote flagd connection.

String

camel.component.openfeature.configuration

Default configuration shared by OpenFeature endpoints. The option is a org.apache.camel.component.openfeature.OpenFeatureConfiguration type.

OpenFeatureConfiguration

camel.component.openfeature.context-from-body

When true, a Map message body is used as the evaluation context. When false (default), the body is not used as context. The CamelOpenFeatureEvaluationContext header is always used regardless of this setting.

false

Boolean

camel.component.openfeature.deadline

Deadline in milliseconds for the remote flagd connection.

500

Integer

camel.component.openfeature.default-value

Default value when flag evaluation fails. When evaluationType is not set, also determines the evaluation type: true or false (case-insensitive) selects boolean evaluation, any other value selects string evaluation.

false

String

camel.component.openfeature.enabled

Whether to enable auto configuration of the openfeature component. This is enabled by default.

Boolean

camel.component.openfeature.evaluation-type

The evaluation type. 'boolean' and 'isEnabled' use boolean evaluation (getBooleanValue). 'variant' uses string evaluation (getStringValue). When not set, the type is inferred from defaultValue. Can also be set as a path parameter in the endpoint URI, which takes precedence.

String

camel.component.openfeature.flag-key

The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header.

String

camel.component.openfeature.flags

A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource.

String

camel.component.openfeature.flags-resource

Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclusive with flags. When provider is also set, the provider takes precedence.

String

camel.component.openfeature.host

Remote flagd service host. When set, the flagd RPC resolver is used.

String

camel.component.openfeature.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.openfeature.port

Remote flagd service port.

8013

Integer

camel.component.openfeature.provider

Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, flagsResource, and host.

String

camel.component.openfeature.result-property

Store the evaluation result in this exchange property, preserving the original message body.

String

camel.component.openfeature.tls

Whether to use TLS for the remote flagd connection.

false

Boolean

camel.language.openfeature.enabled

Whether to enable auto configuration of the openfeature language. This is enabled by default.

Boolean

camel.language.openfeature.language

The name of the language to use.

String