This is an automated email from the ASF dual-hosted git repository. christophd pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 103c8c3a29d560cb763a6efa4c2143f3cceddef0 Author: Christoph Deppisch <[email protected]> AuthorDate: Wed Oct 7 20:20:02 2026 +0200 CAMEL-25333: Address review feedback on camel-openfeature component Per-domain locking replaces global synchronized on acquireOrRegister and unregisterEndpoint so independent domains register in parallel. Idempotent DomainBinding.shutdown via AtomicBoolean prevents double-shutdown race between doStop and unregisterEndpoint. Test uses a distinct domain for the bad endpoint so the failure path is actually exercised. TLS params use label "common,security" per Camel convention. Co-Authored-By: Claude Opus 4.6 <[email protected]> --- .../camel/catalog/components/openfeature.json | 58 ++++++++-------- .../camel/component/openfeature/openfeature.json | 58 ++++++++-------- .../openfeature/OpenFeatureComponent.java | 79 +++++++++++++--------- .../openfeature/OpenFeatureConfiguration.java | 4 +- .../openfeature/OpenFeatureProducerTest.java | 2 +- .../dsl/OpenfeatureComponentBuilderFactory.java | 68 +++++++++---------- .../dsl/OpenFeatureEndpointBuilderFactory.java | 62 ++++++++--------- 7 files changed, 172 insertions(+), 159 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openfeature.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openfeature.json index 5fb820910de7..fef96a8edd47 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openfeature.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/openfeature.json @@ -24,22 +24,22 @@ "remote": true }, "componentProperties": { - "certPath": { "index": 0, "kind": "property", "displayName": "Cert Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, - "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Default configuration shared by OpenFeature endpoints." }, - "contextFromBody": { "index": 2, "kind": "property", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When false [...] - "deadline": { "index": 3, "kind": "property", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, - "defaultValue": { "index": 4, "kind": "property", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not set [...] - "evaluationType": { "index": 5, "kind": "property", "displayName": "Evaluation Type", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The evaluation type. 'boolean' and 'isEnabled' u [...] - "flagKey": { "index": 6, "kind": "property", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, - "flags": { "index": 7, "kind": "property", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, - "flagsResource": { "index": 8, "kind": "property", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclusi [...] - "host": { "index": 9, "kind": "property", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, - "port": { "index": 10, "kind": "property", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, - "provider": { "index": 11, "kind": "property", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fla [...] - "tls": { "index": 12, "kind": "property", "displayName": "Tls", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." }, - "lazyStartProducer": { "index": 13, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 fai [...] - "resultProperty": { "index": 14, "kind": "property", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message b [...] - "autowiredEnabled": { "index": 15, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 [...] + "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Default configuration shared by OpenFeature endpoints." }, + "contextFromBody": { "index": 1, "kind": "property", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When false [...] + "deadline": { "index": 2, "kind": "property", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, + "defaultValue": { "index": 3, "kind": "property", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not set [...] + "evaluationType": { "index": 4, "kind": "property", "displayName": "Evaluation Type", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The evaluation type. 'boolean' and 'isEnabled' u [...] + "flagKey": { "index": 5, "kind": "property", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, + "flags": { "index": 6, "kind": "property", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, + "flagsResource": { "index": 7, "kind": "property", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclusi [...] + "host": { "index": 8, "kind": "property", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, + "port": { "index": 9, "kind": "property", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, + "provider": { "index": 10, "kind": "property", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fla [...] + "lazyStartProducer": { "index": 11, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 fai [...] + "resultProperty": { "index": 12, "kind": "property", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message b [...] + "autowiredEnabled": { "index": 13, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 [...] + "certPath": { "index": 14, "kind": "property", "displayName": "Cert Path", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, + "tls": { "index": 15, "kind": "property", "displayName": "Tls", "group": "security", "label": "common,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." } }, "headers": { "CamelOpenFeatureFlagKey": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Overrides the configured flag key for this message.", "constantName": "org.apache.camel.component.openfeature.OpenFeatureConstants#FLAG_KEY" }, @@ -53,18 +53,18 @@ "properties": { "domain": { "index": 0, "kind": "path", "displayName": "Domain", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OpenFeature domain to bind the provider to." }, "evaluationType": { "index": 1, "kind": "path", "displayName": "Evaluation Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "description": "The evaluation type. 'boolean' and 'isEnabled' use boolean evaluation (getBooleanValue). 'variant' uses string evaluation (getStringValue). When not set, the type is inferred from defa [...] - "certPath": { "index": 2, "kind": "parameter", "displayName": "Cert Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, - "contextFromBody": { "index": 3, "kind": "parameter", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When fals [...] - "deadline": { "index": 4, "kind": "parameter", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, - "defaultValue": { "index": 5, "kind": "parameter", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not se [...] - "flagKey": { "index": 6, "kind": "parameter", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, - "flags": { "index": 7, "kind": "parameter", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, - "flagsResource": { "index": 8, "kind": "parameter", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclus [...] - "host": { "index": 9, "kind": "parameter", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, - "port": { "index": 10, "kind": "parameter", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, - "provider": { "index": 11, "kind": "parameter", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fl [...] - "tls": { "index": 12, "kind": "parameter", "displayName": "Tls", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." }, - "resultProperty": { "index": 13, "kind": "parameter", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message [...] - "lazyStartProducer": { "index": 14, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produ [...] + "contextFromBody": { "index": 2, "kind": "parameter", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When fals [...] + "deadline": { "index": 3, "kind": "parameter", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, + "defaultValue": { "index": 4, "kind": "parameter", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not se [...] + "flagKey": { "index": 5, "kind": "parameter", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, + "flags": { "index": 6, "kind": "parameter", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, + "flagsResource": { "index": 7, "kind": "parameter", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclus [...] + "host": { "index": 8, "kind": "parameter", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, + "port": { "index": 9, "kind": "parameter", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, + "provider": { "index": 10, "kind": "parameter", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fl [...] + "resultProperty": { "index": 11, "kind": "parameter", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message [...] + "lazyStartProducer": { "index": 12, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produ [...] + "certPath": { "index": 13, "kind": "parameter", "displayName": "Cert Path", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, + "tls": { "index": 14, "kind": "parameter", "displayName": "Tls", "group": "security", "label": "common,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." } } } diff --git a/components/camel-openfeature/src/generated/resources/META-INF/org/apache/camel/component/openfeature/openfeature.json b/components/camel-openfeature/src/generated/resources/META-INF/org/apache/camel/component/openfeature/openfeature.json index 5fb820910de7..fef96a8edd47 100644 --- a/components/camel-openfeature/src/generated/resources/META-INF/org/apache/camel/component/openfeature/openfeature.json +++ b/components/camel-openfeature/src/generated/resources/META-INF/org/apache/camel/component/openfeature/openfeature.json @@ -24,22 +24,22 @@ "remote": true }, "componentProperties": { - "certPath": { "index": 0, "kind": "property", "displayName": "Cert Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, - "configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Default configuration shared by OpenFeature endpoints." }, - "contextFromBody": { "index": 2, "kind": "property", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When false [...] - "deadline": { "index": 3, "kind": "property", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, - "defaultValue": { "index": 4, "kind": "property", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not set [...] - "evaluationType": { "index": 5, "kind": "property", "displayName": "Evaluation Type", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The evaluation type. 'boolean' and 'isEnabled' u [...] - "flagKey": { "index": 6, "kind": "property", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, - "flags": { "index": 7, "kind": "property", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, - "flagsResource": { "index": 8, "kind": "property", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclusi [...] - "host": { "index": 9, "kind": "property", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, - "port": { "index": 10, "kind": "property", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, - "provider": { "index": 11, "kind": "property", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fla [...] - "tls": { "index": 12, "kind": "property", "displayName": "Tls", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." }, - "lazyStartProducer": { "index": 13, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 fai [...] - "resultProperty": { "index": 14, "kind": "property", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message b [...] - "autowiredEnabled": { "index": 15, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 [...] + "configuration": { "index": 0, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Default configuration shared by OpenFeature endpoints." }, + "contextFromBody": { "index": 1, "kind": "property", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When false [...] + "deadline": { "index": 2, "kind": "property", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, + "defaultValue": { "index": 3, "kind": "property", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not set [...] + "evaluationType": { "index": 4, "kind": "property", "displayName": "Evaluation Type", "group": "common", "label": "common", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The evaluation type. 'boolean' and 'isEnabled' u [...] + "flagKey": { "index": 5, "kind": "property", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, + "flags": { "index": 6, "kind": "property", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, + "flagsResource": { "index": 7, "kind": "property", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclusi [...] + "host": { "index": 8, "kind": "property", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, + "port": { "index": 9, "kind": "property", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, + "provider": { "index": 10, "kind": "property", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fla [...] + "lazyStartProducer": { "index": 11, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 fai [...] + "resultProperty": { "index": 12, "kind": "property", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message b [...] + "autowiredEnabled": { "index": 13, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "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 [...] + "certPath": { "index": 14, "kind": "property", "displayName": "Cert Path", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, + "tls": { "index": 15, "kind": "property", "displayName": "Tls", "group": "security", "label": "common,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." } }, "headers": { "CamelOpenFeatureFlagKey": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Overrides the configured flag key for this message.", "constantName": "org.apache.camel.component.openfeature.OpenFeatureConstants#FLAG_KEY" }, @@ -53,18 +53,18 @@ "properties": { "domain": { "index": 0, "kind": "path", "displayName": "Domain", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OpenFeature domain to bind the provider to." }, "evaluationType": { "index": 1, "kind": "path", "displayName": "Evaluation Type", "group": "producer", "label": "", "required": false, "type": "enum", "javaType": "java.lang.String", "enum": [ "boolean", "variant", "isEnabled" ], "deprecated": false, "autowired": false, "secret": false, "description": "The evaluation type. 'boolean' and 'isEnabled' use boolean evaluation (getBooleanValue). 'variant' uses string evaluation (getStringValue). When not set, the type is inferred from defa [...] - "certPath": { "index": 2, "kind": "parameter", "displayName": "Cert Path", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, - "contextFromBody": { "index": 3, "kind": "parameter", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When fals [...] - "deadline": { "index": 4, "kind": "parameter", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, - "defaultValue": { "index": 5, "kind": "parameter", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not se [...] - "flagKey": { "index": 6, "kind": "parameter", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, - "flags": { "index": 7, "kind": "parameter", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, - "flagsResource": { "index": 8, "kind": "parameter", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclus [...] - "host": { "index": 9, "kind": "parameter", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, - "port": { "index": 10, "kind": "parameter", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, - "provider": { "index": 11, "kind": "parameter", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fl [...] - "tls": { "index": 12, "kind": "parameter", "displayName": "Tls", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." }, - "resultProperty": { "index": 13, "kind": "parameter", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message [...] - "lazyStartProducer": { "index": 14, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produ [...] + "contextFromBody": { "index": 2, "kind": "parameter", "displayName": "Context From Body", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "When true, a Map message body is used as the evaluation context. When fals [...] + "deadline": { "index": 3, "kind": "parameter", "displayName": "Deadline", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Deadline in milliseconds for the remote flagd connection." }, + "defaultValue": { "index": 4, "kind": "parameter", "displayName": "Default Value", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Default value when flag evaluation fails. When evaluationType is not se [...] + "flagKey": { "index": 5, "kind": "parameter", "displayName": "Flag Key", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "The feature flag key to evaluate. Can be overridden per message via the CamelOpenFeatureFlagKey header." }, + "flags": { "index": 6, "kind": "parameter", "displayName": "Flags", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "A JSON object defining feature flags in flagd format (inline). Mutually exclusive with flagsResource." }, + "flagsResource": { "index": 7, "kind": "parameter", "displayName": "Flags Resource", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Camel resource URI pointing to a feature flag definition file in flagd format. Mutually exclus [...] + "host": { "index": 8, "kind": "parameter", "displayName": "Host", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service host. When set, the flagd RPC resolver is used." }, + "port": { "index": 9, "kind": "parameter", "displayName": "Port", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 8013, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Remote flagd service port." }, + "provider": { "index": 10, "kind": "parameter", "displayName": "Provider", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Bean reference to a custom FeatureProvider (e.g. #myProvider). When set, takes precedence over flags, fl [...] + "resultProperty": { "index": 11, "kind": "parameter", "displayName": "Result Property", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Store the evaluation result in this exchange property, preserving the original message [...] + "lazyStartProducer": { "index": 12, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "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 produ [...] + "certPath": { "index": 13, "kind": "parameter", "displayName": "Cert Path", "group": "security", "label": "common,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Path to the TLS certificate for the remote flagd connection." }, + "tls": { "index": 14, "kind": "parameter", "displayName": "Tls", "group": "security", "label": "common,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.openfeature.OpenFeatureConfiguration", "configurationField": "configuration", "description": "Whether to use TLS for the remote flagd connection." } } } diff --git a/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureComponent.java b/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureComponent.java index 17dca80e65c4..6148ed7c044a 100644 --- a/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureComponent.java +++ b/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureComponent.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.nio.file.Files; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; import dev.openfeature.sdk.Client; import dev.openfeature.sdk.FeatureProvider; @@ -42,12 +43,14 @@ public class OpenFeatureComponent extends DefaultComponent { private volatile OpenFeatureAPI api; private final Map<String, DomainBinding> domainBindings = new ConcurrentHashMap<>(); + private final ConcurrentHashMap<String, Object> domainLocks = new ConcurrentHashMap<>(); private static class DomainBinding { final FeatureProvider provider; final boolean owned; int refCount; File tempFlagFile; + private final AtomicBoolean shutdownCalled = new AtomicBoolean(); DomainBinding(FeatureProvider provider, boolean owned) { this.provider = provider; @@ -56,6 +59,9 @@ public class OpenFeatureComponent extends DefaultComponent { } void shutdown() { + if (!shutdownCalled.compareAndSet(false, true)) { + return; + } if (owned) { try { provider.shutdown(); @@ -132,46 +138,53 @@ public class OpenFeatureComponent extends DefaultComponent { super.doStop(); } - synchronized Client acquireOrRegister(String domain, ProviderSupplier providerSupplier) throws Exception { - DomainBinding existing = domainBindings.get(domain); - if (existing != null) { - existing.refCount++; - return api.getClient(domain); - } + Client acquireOrRegister(String domain, ProviderSupplier providerSupplier) throws Exception { + Object lock = domainLocks.computeIfAbsent(domain, k -> new Object()); + synchronized (lock) { + DomainBinding existing = domainBindings.get(domain); + if (existing != null) { + existing.refCount++; + return api.getClient(domain); + } - ProviderRegistration reg = providerSupplier.get(); - try { - api.setProviderAndWait(domain, reg.provider); - } catch (Exception e) { - if (reg.owned) { - try { - reg.provider.shutdown(); - } catch (Exception suppressed) { - e.addSuppressed(suppressed); + ProviderRegistration reg = providerSupplier.get(); + try { + api.setProviderAndWait(domain, reg.provider); + } catch (Exception e) { + if (reg.owned) { + try { + reg.provider.shutdown(); + } catch (Exception suppressed) { + e.addSuppressed(suppressed); + } } - } - if (reg.tempFlagFile != null) { - try { - Files.deleteIfExists(reg.tempFlagFile.toPath()); - } catch (IOException suppressed) { - e.addSuppressed(suppressed); + if (reg.tempFlagFile != null) { + try { + Files.deleteIfExists(reg.tempFlagFile.toPath()); + } catch (IOException suppressed) { + e.addSuppressed(suppressed); + } } + throw e; } - throw e; + DomainBinding binding = new DomainBinding(reg.provider, reg.owned); + binding.tempFlagFile = reg.tempFlagFile; + domainBindings.put(domain, binding); + return api.getClient(domain); } - DomainBinding binding = new DomainBinding(reg.provider, reg.owned); - binding.tempFlagFile = reg.tempFlagFile; - domainBindings.put(domain, binding); - return api.getClient(domain); } - synchronized void unregisterEndpoint(String domain) { - DomainBinding binding = domainBindings.get(domain); - if (binding != null) { - binding.refCount--; - if (binding.refCount <= 0) { - domainBindings.remove(domain); - binding.shutdown(); + void unregisterEndpoint(String domain) { + Object lock = domainLocks.computeIfAbsent(domain, k -> new Object()); + synchronized (lock) { + DomainBinding binding = domainBindings.get(domain); + if (binding != null) { + binding.refCount--; + if (binding.refCount <= 0) { + domainBindings.remove(domain); + domainLocks.remove(domain); + binding.shutdown(); + } } } } diff --git a/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureConfiguration.java b/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureConfiguration.java index 9b3a32acd73b..ada7c9c6f4ef 100644 --- a/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureConfiguration.java +++ b/components/camel-openfeature/src/main/java/org/apache/camel/component/openfeature/OpenFeatureConfiguration.java @@ -49,11 +49,11 @@ public class OpenFeatureConfiguration implements Cloneable { @UriParam(label = "common", defaultValue = "8013", description = "Remote flagd service port.") private int port = 8013; - @UriParam(label = "common", defaultValue = "false", + @UriParam(label = "common,security", defaultValue = "false", description = "Whether to use TLS for the remote flagd connection.") private boolean tls; - @UriParam(label = "common", + @UriParam(label = "common,security", description = "Path to the TLS certificate for the remote flagd connection.") private String certPath; diff --git a/components/camel-openfeature/src/test/java/org/apache/camel/component/openfeature/OpenFeatureProducerTest.java b/components/camel-openfeature/src/test/java/org/apache/camel/component/openfeature/OpenFeatureProducerTest.java index aa2d71d0b745..fe671b97af5e 100644 --- a/components/camel-openfeature/src/test/java/org/apache/camel/component/openfeature/OpenFeatureProducerTest.java +++ b/components/camel-openfeature/src/test/java/org/apache/camel/component/openfeature/OpenFeatureProducerTest.java @@ -348,7 +348,7 @@ class OpenFeatureProducerTest extends CamelTestSupport { @Override public void configure() { from("direct:bad-endpoint") - .to("openfeature:shared?flagKey=enrichment-enabled&provider=#nonexistent"); + .to("openfeature:shared-bad?flagKey=enrichment-enabled&provider=#nonexistent"); } }); } catch (Exception e) { diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OpenfeatureComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OpenfeatureComponentBuilderFactory.java index 73530e0410c6..62707c0905c5 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OpenfeatureComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/OpenfeatureComponentBuilderFactory.java @@ -50,21 +50,6 @@ public interface OpenfeatureComponentBuilderFactory { */ interface OpenfeatureComponentBuilder extends ComponentBuilder<OpenFeatureComponent> { - /** - * Path to the TLS certificate for the remote flagd connection. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - * - * @param certPath the value to set - * @return the dsl builder - */ - default OpenfeatureComponentBuilder certPath(java.lang.String certPath) { - doSetProperty("certPath", certPath); - return this; - } - /** * Default configuration shared by OpenFeature endpoints. * @@ -254,23 +239,6 @@ public interface OpenfeatureComponentBuilderFactory { } - /** - * Whether to use TLS for the remote flagd connection. - * - * The option is a: <code>boolean</code> type. - * - * Default: false - * Group: common - * - * @param tls the value to set - * @return the dsl builder - */ - default OpenfeatureComponentBuilder tls(boolean tls) { - doSetProperty("tls", tls); - return this; - } - - /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to @@ -332,6 +300,38 @@ public interface OpenfeatureComponentBuilderFactory { doSetProperty("autowiredEnabled", autowiredEnabled); return this; } + + /** + * Path to the TLS certificate for the remote flagd connection. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param certPath the value to set + * @return the dsl builder + */ + default OpenfeatureComponentBuilder certPath(java.lang.String certPath) { + doSetProperty("certPath", certPath); + return this; + } + + + /** + * Whether to use TLS for the remote flagd connection. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: security + * + * @param tls the value to set + * @return the dsl builder + */ + default OpenfeatureComponentBuilder tls(boolean tls) { + doSetProperty("tls", tls); + return this; + } } class OpenfeatureComponentBuilderImpl @@ -353,7 +353,6 @@ public interface OpenfeatureComponentBuilderFactory { String name, Object value) { switch (name) { - case "certPath": getOrCreateConfiguration((OpenFeatureComponent) component).setCertPath((java.lang.String) value); return true; case "configuration": ((OpenFeatureComponent) component).setConfiguration((org.apache.camel.component.openfeature.OpenFeatureConfiguration) value); return true; case "contextFromBody": getOrCreateConfiguration((OpenFeatureComponent) component).setContextFromBody((boolean) value); return true; case "deadline": getOrCreateConfiguration((OpenFeatureComponent) component).setDeadline((int) value); return true; @@ -365,10 +364,11 @@ public interface OpenfeatureComponentBuilderFactory { case "host": getOrCreateConfiguration((OpenFeatureComponent) component).setHost((java.lang.String) value); return true; case "port": getOrCreateConfiguration((OpenFeatureComponent) component).setPort((int) value); return true; case "provider": getOrCreateConfiguration((OpenFeatureComponent) component).setProvider((java.lang.String) value); return true; - case "tls": getOrCreateConfiguration((OpenFeatureComponent) component).setTls((boolean) value); return true; case "lazyStartProducer": ((OpenFeatureComponent) component).setLazyStartProducer((boolean) value); return true; case "resultProperty": getOrCreateConfiguration((OpenFeatureComponent) component).setResultProperty((java.lang.String) value); return true; case "autowiredEnabled": ((OpenFeatureComponent) component).setAutowiredEnabled((boolean) value); return true; + case "certPath": getOrCreateConfiguration((OpenFeatureComponent) component).setCertPath((java.lang.String) value); return true; + case "tls": getOrCreateConfiguration((OpenFeatureComponent) component).setTls((boolean) value); return true; default: return false; } } diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenFeatureEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenFeatureEndpointBuilderFactory.java index 80adf22f0f3a..95b3d318e1ca 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenFeatureEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/OpenFeatureEndpointBuilderFactory.java @@ -44,20 +44,6 @@ public interface OpenFeatureEndpointBuilderFactory { return (AdvancedOpenFeatureEndpointBuilder) this; } - /** - * Path to the TLS certificate for the remote flagd connection. - * - * The option is a: <code>java.lang.String</code> type. - * - * Group: common - * - * @param certPath the value to set - * @return the dsl builder - */ - default OpenFeatureEndpointBuilder certPath(String certPath) { - doSetProperty("certPath", certPath); - return this; - } /** * When true, a Map message body is used as the evaluation context. When * false (default), the body is not used as context. The @@ -248,48 +234,62 @@ public interface OpenFeatureEndpointBuilderFactory { return this; } /** - * Whether to use TLS for the remote flagd connection. + * Store the evaluation result in this exchange property, preserving the + * original message body. * - * The option is a: <code>boolean</code> type. + * The option is a: <code>java.lang.String</code> type. * - * Default: false - * Group: common + * Group: producer * - * @param tls the value to set + * @param resultProperty the value to set * @return the dsl builder */ - default OpenFeatureEndpointBuilder tls(boolean tls) { - doSetProperty("tls", tls); + default OpenFeatureEndpointBuilder resultProperty(String resultProperty) { + doSetProperty("resultProperty", resultProperty); + return this; + } + /** + * Path to the TLS certificate for the remote flagd connection. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param certPath the value to set + * @return the dsl builder + */ + default OpenFeatureEndpointBuilder certPath(String certPath) { + doSetProperty("certPath", certPath); return this; } /** * Whether to use TLS for the remote flagd connection. * - * The option will be converted to a <code>boolean</code> type. + * The option is a: <code>boolean</code> type. * * Default: false - * Group: common + * Group: security * * @param tls the value to set * @return the dsl builder */ - default OpenFeatureEndpointBuilder tls(String tls) { + default OpenFeatureEndpointBuilder tls(boolean tls) { doSetProperty("tls", tls); return this; } /** - * Store the evaluation result in this exchange property, preserving the - * original message body. + * Whether to use TLS for the remote flagd connection. * - * The option is a: <code>java.lang.String</code> type. + * The option will be converted to a <code>boolean</code> type. * - * Group: producer + * Default: false + * Group: security * - * @param resultProperty the value to set + * @param tls the value to set * @return the dsl builder */ - default OpenFeatureEndpointBuilder resultProperty(String resultProperty) { - doSetProperty("resultProperty", resultProperty); + default OpenFeatureEndpointBuilder tls(String tls) { + doSetProperty("tls", tls); return this; } }
