From 1563206eb6ccc2d7ab3b223252ed42c772b53440 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Fri, 22 May 2026 12:35:45 +0200 Subject: [PATCH 1/2] CAMEL-23590: camel-milo - align Exchange header constant names with Camel naming convention Renames the MiloConstants.HEADER_AWAIT header string value from "await" (which is outside the Camel namespace and therefore not filtered by the default HeaderFilterStrategy) to "CamelMiloAwait", following the convention used across the rest of the Camel component catalog and matching the pattern established in CAMEL-23526 (camel-cxf), CAMEL-23522 (camel-mail), CAMEL-23461 (camel-aws-bedrock), CAMEL-23532 (camel-vertx-websocket / camel-atmosphere-websocket / camel-iggy), and CAMEL-23576 (camel-jira). The Java field name is unchanged so routes referencing the constant symbolically continue to work; routes using the literal string value must be updated (documented in the 4.21 upgrade guide). MiloConstants.HEADER_NODE_IDS was already Camel-prefixed (CamelMiloNodeIds) and is unchanged. Updates the two tests (WriteClientTest, CallClientTest) that set the header by its literal value. The generated Endpoint DSL header accessor await() on MiloClientHeaderNameBuilder has been renamed to miloAwait(). Tracker: CAMEL-23577 Reported by Claude Code on behalf of Andrea Cosentino Signed-off-by: Andrea Cosentino --- .../camel/catalog/components/milo-client.json | 2 +- .../component/milo/client/milo-client.json | 2 +- .../camel/component/milo/MiloConstants.java | 2 +- .../camel/component/milo/WriteClientTest.java | 2 +- .../component/milo/call/CallClientTest.java | 2 +- .../pages/camel-4x-upgrade-guide-4_21.adoc | 26 +++++++++++++++++++ .../dsl/MiloClientEndpointBuilderFactory.java | 6 ++--- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/milo-client.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/milo-client.json index 35300ea3b634b..73e3dabb3dd9d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/milo-client.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/milo-client.json @@ -53,7 +53,7 @@ }, "headers": { "CamelMiloNodeIds": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The node ids.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_NODE_IDS" }, - "await": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The await setting for writes.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_AWAIT" } + "CamelMiloAwait": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The await setting for writes.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_AWAIT" } }, "properties": { "endpointUri": { "index": 0, "kind": "path", "displayName": "Endpoint Uri", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OPC UA server endpoint" }, diff --git a/components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/client/milo-client.json b/components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/client/milo-client.json index 35300ea3b634b..73e3dabb3dd9d 100644 --- a/components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/client/milo-client.json +++ b/components/camel-milo/src/generated/resources/META-INF/org/apache/camel/component/milo/client/milo-client.json @@ -53,7 +53,7 @@ }, "headers": { "CamelMiloNodeIds": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The node ids.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_NODE_IDS" }, - "await": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The await setting for writes.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_AWAIT" } + "CamelMiloAwait": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The await setting for writes.", "constantName": "org.apache.camel.component.milo.MiloConstants#HEADER_AWAIT" } }, "properties": { "endpointUri": { "index": 0, "kind": "path", "displayName": "Endpoint Uri", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The OPC UA server endpoint" }, diff --git a/components/camel-milo/src/main/java/org/apache/camel/component/milo/MiloConstants.java b/components/camel-milo/src/main/java/org/apache/camel/component/milo/MiloConstants.java index 96ac5618b8604..b4c11dc57e246 100644 --- a/components/camel-milo/src/main/java/org/apache/camel/component/milo/MiloConstants.java +++ b/components/camel-milo/src/main/java/org/apache/camel/component/milo/MiloConstants.java @@ -29,7 +29,7 @@ public final class MiloConstants { public static final String HEADER_NODE_IDS = "CamelMiloNodeIds"; @Metadata(label = "producer", description = "The \"await\" setting for writes.", javaType = "Boolean", applicableFor = SCHEME_CLIENT) - public static final String HEADER_AWAIT = "await"; + public static final String HEADER_AWAIT = "CamelMiloAwait"; private MiloConstants() { diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java index b4cfeab955811..e225a6bb253e5 100644 --- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java +++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/WriteClientTest.java @@ -171,6 +171,6 @@ public void testWrite3() throws Exception { private static void sendValue(final ProducerTemplate producerTemplate, final Variant variant) { // we always write synchronously since we do need the message order - producerTemplate.sendBodyAndHeader(variant, "await", true); + producerTemplate.sendBodyAndHeader(variant, "CamelMiloAwait", true); } } diff --git a/components/camel-milo/src/test/java/org/apache/camel/component/milo/call/CallClientTest.java b/components/camel-milo/src/test/java/org/apache/camel/component/milo/call/CallClientTest.java index 90c4846cd7529..5e5ff94b3916b 100644 --- a/components/camel-milo/src/test/java/org/apache/camel/component/milo/call/CallClientTest.java +++ b/components/camel-milo/src/test/java/org/apache/camel/component/milo/call/CallClientTest.java @@ -208,6 +208,6 @@ public void testCall1() { private static void doCall(final ProducerTemplate producerTemplate, final Object input) { // we always write synchronously since we do need the message order - producerTemplate.sendBodyAndHeader(input, "await", true); + producerTemplate.sendBodyAndHeader(input, "CamelMiloAwait", true); } } diff --git a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc index db2adbf4800f5..4104b7dc77d5a 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_21.adoc @@ -1320,6 +1320,32 @@ As a consequence, the generated Endpoint DSL header accessors on `MailHeaderNameBuilder` have been renamed: `copyTo()` -> `mailCopyTo()`, `moveTo()` -> `mailMoveTo()`, and `delete()` -> `mailDelete()`. +=== camel-milo - potential breaking change + +The `MiloConstants.HEADER_AWAIT` constant, which controls whether milo-client +writes are awaited, used the header value `await` — outside the `Camel` +namespace and therefore not filtered by the default `HeaderFilterStrategy`. It +has been renamed to follow the Camel naming convention. The Java field name is +unchanged; only the header string value has changed: + +[options="header"] +|=== +| Constant | Previous value | New value +| `MiloConstants.HEADER_AWAIT` | `await` | `CamelMiloAwait` +|=== + +`MiloConstants.HEADER_NODE_IDS` was already `Camel`-prefixed +(`CamelMiloNodeIds`) and is unchanged. + +Routes that reference the constant symbolically (for example +`setHeader(MiloConstants.HEADER_AWAIT, ...)`) continue to work without changes. +Routes that set the header by its literal string value (for example +`setHeader("await", ...)`) must be updated to use the new value +(`setHeader("CamelMiloAwait", ...)`). + +As a consequence, the generated Endpoint DSL header accessor `await()` on +`MiloClientHeaderNameBuilder` has been renamed to `miloAwait()`. + === Jackson dataformat documentation pages renamed The Jackson 2.x and Jackson 3.x lines ship the same dataformat names (`jackson`, `jacksonXml`, diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MiloClientEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MiloClientEndpointBuilderFactory.java index 355c7d48dc95e..2db17c5273820 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MiloClientEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/MiloClientEndpointBuilderFactory.java @@ -2351,10 +2351,10 @@ public String miloNodeIds() { * * Group: producer * - * @return the name of the header {@code await}. + * @return the name of the header {@code MiloAwait}. */ - public String await() { - return "await"; + public String miloAwait() { + return "CamelMiloAwait"; } } static MiloClientEndpointBuilder endpointBuilder(String componentName, String path) { From 460930a2a2b8c41a5463b5c8f50e80745deba990 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Sun, 24 May 2026 12:26:27 +0200 Subject: [PATCH 2/2] CAMEL-23590: address review - update milo-client doc example to new header value Updates the route example in components/camel-milo/src/main/docs/milo-client-component.adoc that quoted the old literal header value "await" to use the new "CamelMiloAwait" value introduced by this PR. Addresses Guillaume Nodet's review on #23474. Reported by Claude Code on behalf of Andrea Cosentino Signed-off-by: Andrea Cosentino --- components/camel-milo/src/main/docs/milo-client-component.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/camel-milo/src/main/docs/milo-client-component.adoc b/components/camel-milo/src/main/docs/milo-client-component.adoc index 6b4ac33047dd1..6bfd1319d01c6 100644 --- a/components/camel-milo/src/main/docs/milo-client-component.adoc +++ b/components/camel-milo/src/main/docs/milo-client-component.adoc @@ -136,7 +136,7 @@ Example: ---- from("direct:start") .setHeader("CamelMiloNodeIds", constant(Arrays.asList("nsu=urn:org:apache:camel;s=myitem1"))) - .setHeader("await", constant(true)) // await: parameter "defaultAwaitWrites" + .setHeader("CamelMiloAwait", constant(true)) // CamelMiloAwait: parameter "defaultAwaitWrites" .enrich("milo-client:opc.tcp://localhost:4334", new AggregationStrategy() { @Override