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 3701f1614a36af76487aee635feafd05683835ab
Author: Christoph Deppisch <[email protected]>
AuthorDate: Thu Oct 8 09:11:31 2026 +0200

    CAMEL-25333: Address review feedback on camel-openfeature component
    
    Move domainLocks.remove after binding.shutdown so the lock remains valid
    for the full shutdown duration. Change TLS param labels from
    "common,security" to "security" per Camel convention. Add comment
    explaining distinct domain in failure isolation test.
    
    Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
 .../org/apache/camel/catalog/components/openfeature.json          | 8 ++++----
 .../org/apache/camel/component/openfeature/openfeature.json       | 8 ++++----
 .../apache/camel/component/openfeature/OpenFeatureComponent.java  | 2 +-
 .../camel/component/openfeature/OpenFeatureConfiguration.java     | 4 ++--
 .../camel/component/openfeature/OpenFeatureProducerTest.java      | 1 +
 5 files changed, 12 insertions(+), 11 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 fef96a8edd47..af09026c40d0 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
@@ -38,8 +38,8 @@
     "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." }
+    "certPath": { "index": 14, "kind": "property", "displayName": "Cert Path", 
"group": "security", "label": "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": "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" },
@@ -64,7 +64,7 @@
     "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." }
+    "certPath": { "index": 13, "kind": "parameter", "displayName": "Cert 
Path", "group": "security", "label": "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": "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 fef96a8edd47..af09026c40d0 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
@@ -38,8 +38,8 @@
     "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." }
+    "certPath": { "index": 14, "kind": "property", "displayName": "Cert Path", 
"group": "security", "label": "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": "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" },
@@ -64,7 +64,7 @@
     "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." }
+    "certPath": { "index": 13, "kind": "parameter", "displayName": "Cert 
Path", "group": "security", "label": "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": "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 6148ed7c044a..d218c482aeef 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
@@ -182,8 +182,8 @@ public class OpenFeatureComponent extends DefaultComponent {
                 binding.refCount--;
                 if (binding.refCount <= 0) {
                     domainBindings.remove(domain);
-                    domainLocks.remove(domain);
                     binding.shutdown();
+                    domainLocks.remove(domain);
                 }
             }
         }
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 ada7c9c6f4ef..25cb9364a1d9 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,security", defaultValue = "false",
+    @UriParam(label = "security", defaultValue = "false",
               description = "Whether to use TLS for the remote flagd 
connection.")
     private boolean tls;
 
-    @UriParam(label = "common,security",
+    @UriParam(label = "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 fe671b97af5e..5ca26e5ede0a 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,6 +348,7 @@ class OpenFeatureProducerTest extends CamelTestSupport {
                 @Override
                 public void configure() {
                     from("direct:bad-endpoint")
+                            // Distinct domain so the failure exercises the 
provider-lookup path
                             
.to("openfeature:shared-bad?flagKey=enrichment-enabled&provider=#nonexistent");
                 }
             });

Reply via email to