From 4b87f5c7ce3be3eeab3c064b22d1d95b4049afae Mon Sep 17 00:00:00 2001
From: Andrea Cosentino
Date: Mon, 6 Jul 2026 10:32:48 +0200
Subject: [PATCH 1/6] [backport camel-4.14.x] CAMEL-23891: camel-mail - filter
Camel internal headers in MimeMultipartDataFormat unmarshal (#24445)
CAMEL-23891: camel-mail - filter Camel internal headers in MimeMultipartDataFormat unmarshal (#24406)
Signed-off-by: Andrea Cosentino
Co-authored-by: Claude Opus 4.8 (1M context)
---
.../multipart/MimeMultipartDataFormat.java | 18 ++++++++++++++++
.../MimeMultipartDataFormatTest.java | 21 +++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java
index 6827f43cff5db..a4d611dfea443 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java
@@ -50,8 +50,10 @@
import org.apache.camel.attachment.Attachment;
import org.apache.camel.attachment.AttachmentMessage;
import org.apache.camel.attachment.DefaultAttachment;
+import org.apache.camel.spi.HeaderFilterStrategy;
import org.apache.camel.spi.annotations.Dataformat;
import org.apache.camel.support.DefaultDataFormat;
+import org.apache.camel.support.DefaultHeaderFilterStrategy;
import org.apache.camel.support.ExchangeHelper;
import org.apache.camel.support.MessageHelper;
import org.apache.camel.util.IOHelper;
@@ -72,11 +74,21 @@ public class MimeMultipartDataFormat extends DefaultDataFormat {
private String includeHeaders;
private Pattern includeHeadersPattern;
private boolean binaryContent;
+ private final HeaderFilterStrategy headerFilterStrategy = createInboundHeaderFilterStrategy();
public void setBinaryContent(boolean binaryContent) {
this.binaryContent = binaryContent;
}
+ private static HeaderFilterStrategy createInboundHeaderFilterStrategy() {
+ DefaultHeaderFilterStrategy strategy = new DefaultHeaderFilterStrategy();
+ // camel-4.14 DefaultHeaderFilterStrategy does not enable the Camel* in-filter by default (that
+ // default was introduced on a later branch), so configure it explicitly to filter the Camel*
+ // namespace on the inbound path, matching the mail consumer's HeaderFilterStrategy.
+ strategy.setInFilterStartsWith(DefaultHeaderFilterStrategy.CAMEL_FILTER_STARTS_WITH);
+ return strategy;
+ }
+
public void setHeadersInline(boolean headersInline) {
this.headersInline = headersInline;
}
@@ -219,6 +231,12 @@ public Object unmarshal(Exchange exchange, InputStream stream) throws IOExceptio
Object ho = headersEnum.nextElement();
if (ho instanceof Header) {
Header header = (Header) ho;
+ // filter Camel internal headers (Camel*) instead of copying them verbatim from the external
+ // MIME headers, consistent with the inbound HeaderFilterStrategy applied by the mail consumer
+ if (headerFilterStrategy.applyFilterToExternalHeaders(header.getName(), header.getValue(),
+ camelMessage.getExchange())) {
+ continue;
+ }
camelMessage.setHeader(header.getName(), header.getValue());
}
}
diff --git a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
index f36acfed870a8..56ae3d59f2d86 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java
@@ -406,6 +406,27 @@ public void marhsalUnmarshalInlineHeaders() throws IOException {
assertEquals("also there", out.getMessage().getHeader("x-bar"));
}
+ @Test
+ public void unmarshalInlineHeadersFiltersCamelInternalHeaders() {
+ // Camel-internal headers (Camel*, case-insensitive) present in the external MIME headers must not be
+ // copied onto the Camel message; ordinary application headers still pass through. This matches the
+ // inbound HeaderFilterStrategy applied by the mail consumer.
+ String mime = "CamelFoo: blocked\r\n"
+ + "camelBar: blocked\r\n"
+ + "CAMELBaz: blocked\r\n"
+ + "X-Normal: keep-me\r\n"
+ + "Content-Type: text/plain\r\n"
+ + "\r\n"
+ + "Body text";
+ in.setBody(mime);
+ Exchange out = template.send("direct:unmarshalonlyinlineheaders", exchange);
+ assertNotNull(out.getMessage());
+ assertEquals("keep-me", out.getMessage().getHeader("X-Normal"));
+ assertNull(out.getMessage().getHeader("CamelFoo"));
+ assertNull(out.getMessage().getHeader("camelBar"));
+ assertNull(out.getMessage().getHeader("CAMELBaz"));
+ }
+
@Test
public void unmarshalRelated() throws IOException {
in.setBody(new File("src/test/resources/multipart-related.txt"));
From f23aa41f88536ce364b20e34a122bf7e8253fe76 Mon Sep 17 00:00:00 2001
From: Andrea Cosentino
Date: Fri, 29 May 2026 21:58:09 +0200
Subject: [PATCH 2/6] [backport camel-4.14.x] CAMEL-23584: camel-kafka - align
Exchange header constant names with Camel naming convention (#23602)
Backport of #23602 (CAMEL-23584) to camel-4.14.x.
Renames the Exchange header string values in KafkaConstants from the
non-Camel-prefixed "kafka.*" namespace to the project-wide "CamelKafka*"
PascalCase convention. Java field names are unchanged (symbolic references
keep working); routes hard-coding the literal "kafka.*" header strings must
move to the new "CamelKafka*" values. Only the string values were changed on
this branch (4.14.x KafkaConstants differs from main and its structure is
otherwise preserved). Keeps the bundled transforms, the KafkaHeaderDeserializer,
and the camel-tracing / camel-telemetry KafkaSpanDecorator copies in sync, and
regenerates the catalog and endpoint DSL artifacts. The camel-opentelemetry2
test infra, core ImportantHeaderUtils, and important-headers.json do not exist
on this branch. The upgrade-guide entry is added on main (per the backport
upgrade-guide policy).
Tracker: CAMEL-23577
Closes #23632
---
.../camel/catalog/components/kafka.json | 24 ++++-----
.../apache/camel/component/kafka/kafka.json | 24 ++++-----
.../src/main/docs/kafka-component.adoc | 24 ++++-----
.../camel/component/kafka/KafkaConstants.java | 24 ++++-----
.../integration/KafkaConsumerFullIT.java | 2 +-
.../clients/producer/KafkaProducerTest.java | 9 ++--
.../decorators/KafkaSpanDecorator.java | 10 ++--
.../dsl/KafkaEndpointBuilderFactory.java | 49 +++++++++----------
8 files changed, 83 insertions(+), 83 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
index 54d00f649aaed..a8c6cff6902de 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/kafka.json
@@ -141,18 +141,18 @@
"useGlobalSslContextParameters": { "index": 115, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "kafka.PARTITION_KEY": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Explicitly specify the partition", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION_KEY" },
- "kafka.PARTITION": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The partition where the message was stored", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION" },
- "kafka.KEY": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": true, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Producer: The key of the message in order to ensure that all related message goes in the same partition. Consumer: The key of the message if configured", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KEY" },
- "kafka.TOPIC": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic from where the message originated", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TOPIC" },
- "kafka.OVERRIDE_TOPIC": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic to which send the message (override and takes precedence), and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TOPIC" },
- "kafka.OFFSET": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The offset of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OFFSET" },
- "kafka.HEADERS": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.kafka.common.header.Headers", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The record headers", "constantName": "org.apache.camel.component.kafka.KafkaConstants#HEADERS" },
- "kafka.LAST_RECORD_BEFORE_COMMIT": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether or not it's the last record before commit (only available if autoCommitEnable endpoint parameter is false)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_RECORD_BEFORE_COMMIT" },
- "kafka.LAST_POLL_RECORD": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates the last record within the current poll request (only available if autoCommitEnable endpoint parameter is false or allowManualCommit is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_POLL_RECORD" },
- "kafka.TIMESTAMP": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TIMESTAMP" },
- "kafka.OVERRIDE_TIMESTAMP": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ProducerRecord also has an associated timestamp. If the user did provide a timestamp, the producer will stamp the record with the provided timestamp and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TIMESTAMP" },
- "kafka.RECORD_META": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The metadata (only configured if recordMetadata endpoint parameter is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KAFKA_RECORD_META" },
+ "CamelKafkaPartitionKey": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Explicitly specify the partition", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION_KEY" },
+ "CamelKafkaPartition": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The partition where the message was stored", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION" },
+ "CamelKafkaKey": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": true, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Producer: The key of the message in order to ensure that all related message goes in the same partition. Consumer: The key of the message if configured", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KEY" },
+ "CamelKafkaTopic": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic from where the message originated", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TOPIC" },
+ "CamelKafkaOverrideTopic": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic to which send the message (override and takes precedence), and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TOPIC" },
+ "CamelKafkaOffset": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The offset of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OFFSET" },
+ "CamelKafkaHeaders": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.kafka.common.header.Headers", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The record headers", "constantName": "org.apache.camel.component.kafka.KafkaConstants#HEADERS" },
+ "CamelKafkaLastRecordBeforeCommit": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether or not it's the last record before commit (only available if autoCommitEnable endpoint parameter is false)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_RECORD_BEFORE_COMMIT" },
+ "CamelKafkaLastPollRecord": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates the last record within the current poll request (only available if autoCommitEnable endpoint parameter is false or allowManualCommit is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_POLL_RECORD" },
+ "CamelKafkaTimestamp": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TIMESTAMP" },
+ "CamelKafkaOverrideTimestamp": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ProducerRecord also has an associated timestamp. If the user did provide a timestamp, the producer will stamp the record with the provided timestamp and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TIMESTAMP" },
+ "CamelKafkaRecordMeta": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The metadata (only configured if recordMetadata endpoint parameter is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KAFKA_RECORD_META" },
"CamelKafkaManualCommit": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.camel.component.kafka.consumer.KafkaManualCommit", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Can be used for forcing manual offset commit when using Kafka consumer.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#MANUAL_COMMIT" }
},
"properties": {
diff --git a/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json b/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
index 54d00f649aaed..a8c6cff6902de 100644
--- a/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
+++ b/components/camel-kafka/src/generated/resources/META-INF/org/apache/camel/component/kafka/kafka.json
@@ -141,18 +141,18 @@
"useGlobalSslContextParameters": { "index": 115, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "kafka.PARTITION_KEY": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Explicitly specify the partition", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION_KEY" },
- "kafka.PARTITION": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The partition where the message was stored", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION" },
- "kafka.KEY": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": true, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Producer: The key of the message in order to ensure that all related message goes in the same partition. Consumer: The key of the message if configured", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KEY" },
- "kafka.TOPIC": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic from where the message originated", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TOPIC" },
- "kafka.OVERRIDE_TOPIC": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic to which send the message (override and takes precedence), and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TOPIC" },
- "kafka.OFFSET": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The offset of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OFFSET" },
- "kafka.HEADERS": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.kafka.common.header.Headers", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The record headers", "constantName": "org.apache.camel.component.kafka.KafkaConstants#HEADERS" },
- "kafka.LAST_RECORD_BEFORE_COMMIT": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether or not it's the last record before commit (only available if autoCommitEnable endpoint parameter is false)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_RECORD_BEFORE_COMMIT" },
- "kafka.LAST_POLL_RECORD": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates the last record within the current poll request (only available if autoCommitEnable endpoint parameter is false or allowManualCommit is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_POLL_RECORD" },
- "kafka.TIMESTAMP": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TIMESTAMP" },
- "kafka.OVERRIDE_TIMESTAMP": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ProducerRecord also has an associated timestamp. If the user did provide a timestamp, the producer will stamp the record with the provided timestamp and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TIMESTAMP" },
- "kafka.RECORD_META": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The metadata (only configured if recordMetadata endpoint parameter is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KAFKA_RECORD_META" },
+ "CamelKafkaPartitionKey": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Explicitly specify the partition", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION_KEY" },
+ "CamelKafkaPartition": { "index": 1, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The partition where the message was stored", "constantName": "org.apache.camel.component.kafka.KafkaConstants#PARTITION" },
+ "CamelKafkaKey": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": true, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Producer: The key of the message in order to ensure that all related message goes in the same partition. Consumer: The key of the message if configured", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KEY" },
+ "CamelKafkaTopic": { "index": 3, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic from where the message originated", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TOPIC" },
+ "CamelKafkaOverrideTopic": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The topic to which send the message (override and takes precedence), and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TOPIC" },
+ "CamelKafkaOffset": { "index": 5, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The offset of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OFFSET" },
+ "CamelKafkaHeaders": { "index": 6, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.kafka.common.header.Headers", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The record headers", "constantName": "org.apache.camel.component.kafka.KafkaConstants#HEADERS" },
+ "CamelKafkaLastRecordBeforeCommit": { "index": 7, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Whether or not it's the last record before commit (only available if autoCommitEnable endpoint parameter is false)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_RECORD_BEFORE_COMMIT" },
+ "CamelKafkaLastPollRecord": { "index": 8, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates the last record within the current poll request (only available if autoCommitEnable endpoint parameter is false or allowManualCommit is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#LAST_POLL_RECORD" },
+ "CamelKafkaTimestamp": { "index": 9, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The timestamp of the message", "constantName": "org.apache.camel.component.kafka.KafkaConstants#TIMESTAMP" },
+ "CamelKafkaOverrideTimestamp": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The ProducerRecord also has an associated timestamp. If the user did provide a timestamp, the producer will stamp the record with the provided timestamp and the header is not preserved.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#OVERRIDE_TIMESTAMP" },
+ "CamelKafkaRecordMeta": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "List", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The metadata (only configured if recordMetadata endpoint parameter is true)", "constantName": "org.apache.camel.component.kafka.KafkaConstants#KAFKA_RECORD_META" },
"CamelKafkaManualCommit": { "index": 12, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "org.apache.camel.component.kafka.consumer.KafkaManualCommit", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Can be used for forcing manual offset commit when using Kafka consumer.", "constantName": "org.apache.camel.component.kafka.KafkaConstants#MANUAL_COMMIT" }
},
"properties": {
diff --git a/components/camel-kafka/src/main/docs/kafka-component.adoc b/components/camel-kafka/src/main/docs/kafka-component.adoc
index 5ec132be9b348..f3653d6bded29 100644
--- a/components/camel-kafka/src/main/docs/kafka-component.adoc
+++ b/components/camel-kafka/src/main/docs/kafka-component.adoc
@@ -570,10 +570,10 @@ Here is the minimal route you need to read messages from Kafka.
----
from("kafka:test?brokers=localhost:9092")
.log("Message received from Kafka : ${body}")
- .log(" on the topic ${headers[kafka.TOPIC]}")
- .log(" on the partition ${headers[kafka.PARTITION]}")
- .log(" with the offset ${headers[kafka.OFFSET]}")
- .log(" with the key ${headers[kafka.KEY]}")
+ .log(" on the topic ${headers[CamelKafkaTopic]}")
+ .log(" on the partition ${headers[CamelKafkaPartition]}")
+ .log(" with the offset ${headers[CamelKafkaOffset]}")
+ .log(" with the key ${headers[CamelKafkaKey]}")
----
If you need to consume messages from multiple topics, you can use a comma separated list of topic names.
@@ -582,10 +582,10 @@ If you need to consume messages from multiple topics, you can use a comma separa
----
from("kafka:test,test1,test2?brokers=localhost:9092")
.log("Message received from Kafka : ${body}")
- .log(" on the topic ${headers[kafka.TOPIC]}")
- .log(" on the partition ${headers[kafka.PARTITION]}")
- .log(" with the offset ${headers[kafka.OFFSET]}")
- .log(" with the key ${headers[kafka.KEY]}")
+ .log(" on the topic ${headers[CamelKafkaTopic]}")
+ .log(" on the partition ${headers[CamelKafkaPartition]}")
+ .log(" with the offset ${headers[CamelKafkaOffset]}")
+ .log(" with the key ${headers[CamelKafkaKey]}")
----
It's also possible to subscribe to multiple topics giving a pattern as the topic name and using the `topicIsPattern` option.
@@ -594,10 +594,10 @@ It's also possible to subscribe to multiple topics giving a pattern as the topic
----
from("kafka:test.*?brokers=localhost:9092&topicIsPattern=true")
.log("Message received from Kafka : ${body}")
- .log(" on the topic ${headers[kafka.TOPIC]}")
- .log(" on the partition ${headers[kafka.PARTITION]}")
- .log(" with the offset ${headers[kafka.OFFSET]}")
- .log(" with the key ${headers[kafka.KEY]}")
+ .log(" on the topic ${headers[CamelKafkaTopic]}")
+ .log(" on the partition ${headers[CamelKafkaPartition]}")
+ .log(" with the offset ${headers[CamelKafkaOffset]}")
+ .log(" with the key ${headers[CamelKafkaKey]}")
----
When consuming messages from Kafka, you can use your own offset management and not delegate this management to Kafka.
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
index 5fc3e184bda15..9779c22ba62ce 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaConstants.java
@@ -21,38 +21,38 @@
public final class KafkaConstants {
@Metadata(label = "producer", description = "Explicitly specify the partition", javaType = "Integer")
- public static final String PARTITION_KEY = "kafka.PARTITION_KEY";
+ public static final String PARTITION_KEY = "CamelKafkaPartitionKey";
@Metadata(label = "consumer", description = "The partition where the message was stored", javaType = "Integer")
- public static final String PARTITION = "kafka.PARTITION";
+ public static final String PARTITION = "CamelKafkaPartition";
@Metadata(description = "*Producer:* The key of the message in order to ensure that all related message goes in the same partition. "
+
"*Consumer:* The key of the message if configured",
javaType = "Object", required = true)
- public static final String KEY = "kafka.KEY";
+ public static final String KEY = "CamelKafkaKey";
@Metadata(label = "consumer", description = "The topic from where the message originated", javaType = "String")
- public static final String TOPIC = "kafka.TOPIC";
+ public static final String TOPIC = "CamelKafkaTopic";
@Metadata(label = "producer",
description = "The topic to which send the message (override and takes precedence), and the header is not preserved.",
javaType = "String")
- public static final String OVERRIDE_TOPIC = "kafka.OVERRIDE_TOPIC";
+ public static final String OVERRIDE_TOPIC = "CamelKafkaOverrideTopic";
@Metadata(label = "consumer", description = "The offset of the message", javaType = "Long")
- public static final String OFFSET = "kafka.OFFSET";
+ public static final String OFFSET = "CamelKafkaOffset";
@Metadata(label = "consumer", description = "The record headers", javaType = "org.apache.kafka.common.header.Headers")
- public static final String HEADERS = "kafka.HEADERS";
+ public static final String HEADERS = "CamelKafkaHeaders";
@Metadata(label = "consumer",
description = "Whether or not it's the last record before commit (only available if `autoCommitEnable` endpoint parameter is `false`)",
javaType = "Boolean")
- public static final String LAST_RECORD_BEFORE_COMMIT = "kafka.LAST_RECORD_BEFORE_COMMIT";
+ public static final String LAST_RECORD_BEFORE_COMMIT = "CamelKafkaLastRecordBeforeCommit";
@Metadata(label = "consumer", description = "Indicates the last record within the current poll request " +
"(only available if `autoCommitEnable` endpoint parameter is `false` or `allowManualCommit` is `true`)",
javaType = "Boolean")
- public static final String LAST_POLL_RECORD = "kafka.LAST_POLL_RECORD";
+ public static final String LAST_POLL_RECORD = "CamelKafkaLastPollRecord";
@Metadata(label = "consumer", description = "The timestamp of the message", javaType = "Long")
- public static final String TIMESTAMP = "kafka.TIMESTAMP";
+ public static final String TIMESTAMP = "CamelKafkaTimestamp";
@Metadata(label = "producer", description = "The ProducerRecord also has an associated timestamp. " +
"If the user did provide a timestamp, the producer will stamp the record with the provided timestamp and the header is not preserved.",
javaType = "Long")
- public static final String OVERRIDE_TIMESTAMP = "kafka.OVERRIDE_TIMESTAMP";
+ public static final String OVERRIDE_TIMESTAMP = "CamelKafkaOverrideTimestamp";
@Deprecated
public static final String KAFKA_DEFAULT_ENCODER = "kafka.serializer.DefaultEncoder";
@@ -65,7 +65,7 @@ public final class KafkaConstants {
@Metadata(label = "producer",
description = "The metadata (only configured if `recordMetadata` endpoint parameter is `true`)",
javaType = "List")
- public static final String KAFKA_RECORD_META = "kafka.RECORD_META";
+ public static final String KAFKA_RECORD_META = "CamelKafkaRecordMeta";
@Metadata(label = "consumer", description = "Can be used for forcing manual offset commit when using Kafka consumer.",
javaType = "org.apache.camel.component.kafka.consumer.KafkaManualCommit")
public static final String MANUAL_COMMIT = "CamelKafkaManualCommit";
diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerFullIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerFullIT.java
index 0957733834ce6..dad03bf627a41 100644
--- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerFullIT.java
+++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerFullIT.java
@@ -160,7 +160,7 @@ public void kafkaRecordSpecificHeadersAreNotOverwritten() throws InterruptedExce
to.assertIsSatisfied(3000);
Map headers = to.getExchanges().get(0).getIn().getHeaders();
- assertTrue(headers.containsKey(KafkaConstants.TOPIC), "Should receive KafkaEndpoint populated kafka.TOPIC header");
+ assertTrue(headers.containsKey(KafkaConstants.TOPIC), "Should receive KafkaEndpoint populated CamelKafkaTopic header");
assertEquals(TOPIC, headers.get(KafkaConstants.TOPIC), "Topic name received");
}
diff --git a/components/camel-kafka/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java b/components/camel-kafka/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
index 7eadfa4c5a7c0..7156bc194e448 100644
--- a/components/camel-kafka/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
+++ b/components/camel-kafka/src/test/java/org/apache/kafka/clients/producer/KafkaProducerTest.java
@@ -23,6 +23,7 @@
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.component.kafka.KafkaComponent;
+import org.apache.camel.component.kafka.KafkaConstants;
import org.apache.camel.component.kafka.KafkaEndpoint;
import org.apache.camel.component.kafka.KafkaProducer;
import org.apache.camel.impl.DefaultCamelContext;
@@ -57,8 +58,8 @@ public void init() throws Exception {
when(exchange.getIn()).thenReturn(message);
when(exchange.getMessage()).thenReturn(message);
when(exchange.getContext()).thenReturn(context);
- when(message.getHeader("kafka.PARTITION_KEY", Integer.class)).thenReturn(0);
- when(message.getHeader("kafka.KEY")).thenReturn("key");
+ when(message.getHeader(KafkaConstants.PARTITION_KEY, Integer.class)).thenReturn(0);
+ when(message.getHeader(KafkaConstants.KEY)).thenReturn("key");
}
@AfterEach
@@ -68,9 +69,9 @@ public void after() {
@Test
public void testSendOverrideTopic() throws Exception {
- when(message.removeHeader("kafka.OVERRIDE_TOPIC")).thenReturn("overridden-topic");
+ when(message.removeHeader(KafkaConstants.OVERRIDE_TOPIC)).thenReturn("overridden-topic");
camelProducer.process(exchange);
- when(message.removeHeader("kafka.OVERRIDE_TOPIC")).thenReturn(new TextNode("overridden-topic-jackson"));
+ when(message.removeHeader(KafkaConstants.OVERRIDE_TOPIC)).thenReturn(new TextNode("overridden-topic-jackson"));
camelProducer.process(exchange);
List> records = kafkaProducer.history();
assertThat(records.get(0).topic(), Is.is("overridden-topic"));
diff --git a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/KafkaSpanDecorator.java b/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/KafkaSpanDecorator.java
index 2116d316f672f..74fa8f99e97f9 100644
--- a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/KafkaSpanDecorator.java
+++ b/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/KafkaSpanDecorator.java
@@ -30,11 +30,11 @@ public class KafkaSpanDecorator extends AbstractMessagingSpanDecorator {
/**
* Constants copied from {@link org.apache.camel.component.kafka.KafkaConstants}
*/
- protected static final String PARTITION_KEY = "kafka.PARTITION_KEY";
- protected static final String PARTITION = "kafka.PARTITION";
- protected static final String KEY = "kafka.KEY";
- protected static final String OVERRIDE_TOPIC = "kafka.OVERRIDE_TOPIC";
- protected static final String OFFSET = "kafka.OFFSET";
+ protected static final String PARTITION_KEY = "CamelKafkaPartitionKey";
+ protected static final String PARTITION = "CamelKafkaPartition";
+ protected static final String KEY = "CamelKafkaKey";
+ protected static final String OVERRIDE_TOPIC = "CamelKafkaOverrideTopic";
+ protected static final String OFFSET = "CamelKafkaOffset";
@Override
public String getComponent() {
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
index dbea4bb68b02a..5a651048725dd 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KafkaEndpointBuilderFactory.java
@@ -5215,10 +5215,10 @@ public static class KafkaHeaderNameBuilder {
*
* Group: producer
*
- * @return the name of the header {@code kafka.PARTITION_KEY}.
+ * @return the name of the header {@code KafkaPartitionKey}.
*/
public String kafkaPartitionKey() {
- return "kafka.PARTITION_KEY";
+ return "CamelKafkaPartitionKey";
}
/**
* The partition where the message was stored.
@@ -5227,10 +5227,10 @@ public String kafkaPartitionKey() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.PARTITION}.
+ * @return the name of the header {@code KafkaPartition}.
*/
public String kafkaPartition() {
- return "kafka.PARTITION";
+ return "CamelKafkaPartition";
}
/**
* Producer: The key of the message in order to ensure that all related
@@ -5242,10 +5242,10 @@ public String kafkaPartition() {
* Required: true
* Group: common
*
- * @return the name of the header {@code kafka.KEY}.
+ * @return the name of the header {@code KafkaKey}.
*/
public String kafkaKey() {
- return "kafka.KEY";
+ return "CamelKafkaKey";
}
/**
* The topic from where the message originated.
@@ -5254,10 +5254,10 @@ public String kafkaKey() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.TOPIC}.
+ * @return the name of the header {@code KafkaTopic}.
*/
public String kafkaTopic() {
- return "kafka.TOPIC";
+ return "CamelKafkaTopic";
}
/**
* The topic to which send the message (override and takes precedence),
@@ -5267,10 +5267,10 @@ public String kafkaTopic() {
*
* Group: producer
*
- * @return the name of the header {@code kafka.OVERRIDE_TOPIC}.
+ * @return the name of the header {@code KafkaOverrideTopic}.
*/
public String kafkaOverrideTopic() {
- return "kafka.OVERRIDE_TOPIC";
+ return "CamelKafkaOverrideTopic";
}
/**
* The offset of the message.
@@ -5279,10 +5279,10 @@ public String kafkaOverrideTopic() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.OFFSET}.
+ * @return the name of the header {@code KafkaOffset}.
*/
public String kafkaOffset() {
- return "kafka.OFFSET";
+ return "CamelKafkaOffset";
}
/**
* The record headers.
@@ -5291,10 +5291,10 @@ public String kafkaOffset() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.HEADERS}.
+ * @return the name of the header {@code KafkaHeaders}.
*/
public String kafkaHeaders() {
- return "kafka.HEADERS";
+ return "CamelKafkaHeaders";
}
/**
* Whether or not it's the last record before commit (only available if
@@ -5304,11 +5304,10 @@ public String kafkaHeaders() {
*
* Group: consumer
*
- * @return the name of the header {@code
- * kafka.LAST_RECORD_BEFORE_COMMIT}.
+ * @return the name of the header {@code KafkaLastRecordBeforeCommit}.
*/
public String kafkaLastRecordBeforeCommit() {
- return "kafka.LAST_RECORD_BEFORE_COMMIT";
+ return "CamelKafkaLastRecordBeforeCommit";
}
/**
* Indicates the last record within the current poll request (only
@@ -5319,10 +5318,10 @@ public String kafkaLastRecordBeforeCommit() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.LAST_POLL_RECORD}.
+ * @return the name of the header {@code KafkaLastPollRecord}.
*/
public String kafkaLastPollRecord() {
- return "kafka.LAST_POLL_RECORD";
+ return "CamelKafkaLastPollRecord";
}
/**
* The timestamp of the message.
@@ -5331,10 +5330,10 @@ public String kafkaLastPollRecord() {
*
* Group: consumer
*
- * @return the name of the header {@code kafka.TIMESTAMP}.
+ * @return the name of the header {@code KafkaTimestamp}.
*/
public String kafkaTimestamp() {
- return "kafka.TIMESTAMP";
+ return "CamelKafkaTimestamp";
}
/**
* The ProducerRecord also has an associated timestamp. If the user did
@@ -5345,10 +5344,10 @@ public String kafkaTimestamp() {
*
* Group: producer
*
- * @return the name of the header {@code kafka.OVERRIDE_TIMESTAMP}.
+ * @return the name of the header {@code KafkaOverrideTimestamp}.
*/
public String kafkaOverrideTimestamp() {
- return "kafka.OVERRIDE_TIMESTAMP";
+ return "CamelKafkaOverrideTimestamp";
}
/**
* The metadata (only configured if recordMetadata endpoint parameter is
@@ -5358,10 +5357,10 @@ public String kafkaOverrideTimestamp() {
*
* Group: producer
*
- * @return the name of the header {@code kafka.RECORD_META}.
+ * @return the name of the header {@code KafkaRecordMeta}.
*/
public String kafkaRecordMeta() {
- return "kafka.RECORD_META";
+ return "CamelKafkaRecordMeta";
}
/**
* Can be used for forcing manual offset commit when using Kafka
From c74b70d8d917d7b04c85f91739199cf59e40cbb8 Mon Sep 17 00:00:00 2001
From: Andrea Cosentino
Date: Thu, 21 May 2026 10:20:21 +0200
Subject: [PATCH 3/6] CAMEL-23526: camel-cxf - align Exchange header constant
names with Camel naming convention (#23326) (#23376)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* CAMEL-23526: camel-cxf - align Exchange header constant names with Camel naming convention
Rename the Exchange header string values in CxfConstants (camel-cxf-common,
shared by camel-cxf and camel-cxfrs) from operationName / operationNamespace
to CamelCxfOperationName / CamelCxfOperationNamespace. The Java field names
(OPERATION_NAME, OPERATION_NAMESPACE) are unchanged so routes and code that
reference the constants symbolically continue to work without changes; routes
that set the headers by their literal string value must be updated.
Updates the single test that set the headers by literal value, the CxfProducer
javadoc and the component documentation references, adds a 4.21 upgrade-guide
entry, and regenerates the component metadata, catalog, and endpoint DSL.
Consistent with the same alignment applied in CAMEL-23508, CAMEL-23515 and
CAMEL-23506.
Reported by Claude Code on behalf of Andrea Cosentino
* CAMEL-23526: camel-cxf - update cxfrs SimpleConsumer literal operationName usages after header constant rename
The previous commit renamed the CxfConstants.OPERATION_NAME header value to
CamelCxfOperationName. The cxfrs SimpleConsumer dispatch idiom routes on the
operation by its literal header name, so the test/itest routes that used the
old literal value were no longer matched and failed:
- camel-cxf-rest and camel-cxf-spring-rest CxfRsConsumerSimpleBindingTest /
CxfRsConsumerSimpleBindingImplTest: simple("direct:${header.operationName}")
updated to simple("direct:${header.CamelCxfOperationName}").
- camel-itest JettyRecipientListCxfIssueTest: literal "operationName" header
updated to "CamelCxfOperationName".
Also expands the camel-cxf 4.21 upgrade-guide entry with an explicit
before/after for the documented cxfrs SimpleConsumer dispatch idiom, since the
rename changes that public pattern for existing user routes.
Reported by Claude Code on behalf of Andrea Cosentino
* CAMEL-23526: camel-cxf - document cross-transport propagation pattern for the renamed operation header
After the constant rename, CxfConstants.OPERATION_NAME = "CamelCxfOperationName"
is filtered by transport HeaderFilterStrategy (JmsHeaderFilterStrategy,
HttpHeaderFilterStrategy, etc.) at every transport boundary, by design — Camel*
headers are framework-internal and are not propagated over the wire.
For routes that bridge an external transport (JMS, HTTP, ...) into a cxf:
producer and select the SOAP operation from a sender-supplied header, the
documented pattern is to carry the operation in a non-Camel-prefixed
application header and map it to CamelCxfOperationName in the route between
the transport `from` and the cxf: `to`.
- Adds the carrier-header mapping to the JmsToCxfInOutTest route context
(between the JMS `from` and the cxf: `to`) and aligns the test code to send
the operation through the carrier header instead of CxfConstants.OPERATION_NAME.
- Aligns JettyRecipientListCxfIssueTest with the same carrier-header
convention for the cross-HTTP path.
- Expands the 4.21 upgrade-guide entry with an explicit before/after example
for the cross-transport bridge pattern, applicable to JMS, HTTP-based
transports, and any other transport whose default HeaderFilterStrategy
filters Camel*.
Reported by Claude Code on behalf of Andrea Cosentino
---------
Signed-off-by: Andrea Cosentino
---
.../org/apache/camel/catalog/components/cxf.json | 4 ++--
.../org/apache/camel/catalog/components/cxfrs.json | 2 +-
.../component/cxf/common/message/CxfConstants.java | 4 ++--
.../org/apache/camel/component/cxf/jaxrs/cxfrs.json | 2 +-
.../src/main/docs/cxfrs-component.adoc | 2 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 2 +-
.../CxfRsConsumerSimpleBindingTest.java | 2 +-
.../org/apache/camel/component/cxf/jaxws/cxf.json | 4 ++--
.../camel-cxf-soap/src/main/docs/cxf-component.adoc | 2 +-
.../camel/component/cxf/jaxws/CxfProducer.java | 2 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 2 +-
.../CxfRsConsumerSimpleBindingTest.java | 2 +-
.../component/cxf/CxfPayloadProviderRouterTest.java | 6 ++++--
.../endpoint/dsl/CxfEndpointBuilderFactory.java | 12 ++++++------
.../endpoint/dsl/CxfRsEndpointBuilderFactory.java | 6 +++---
.../greeter/JettyRecipientListCxfIssueTest.java | 3 +++
.../camel/itest/greeter/JmsToCxfInOutTest.java | 9 ++++++---
.../itest/greeter/JmsToCxfInOutTest-context.xml | 8 ++++++++
18 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
index 867dc81ba36c0..83a3378876d1e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
@@ -33,8 +33,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
- "operationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The destination override url", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL" },
"ResponseContext": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Map", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response context", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
index 7be5a0518358b..a1e5e5c18c2ee 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
@@ -32,7 +32,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http method to use", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http path", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
diff --git a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
index f7210e2ce1547..8a1b760b13e9f 100644
--- a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
+++ b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
@@ -46,9 +46,9 @@ public final class CxfConstants {
public static final String PROTOCOL_NAME_RES = "res";
@Metadata(description = "The name of the operation.", javaType = "String")
- public static final String OPERATION_NAME = "operationName";
+ public static final String OPERATION_NAME = "CamelCxfOperationName";
@Metadata(description = "The operation namespace.", javaType = "String", applicableFor = SCHEME_CXF)
- public static final String OPERATION_NAMESPACE = "operationNamespace";
+ public static final String OPERATION_NAMESPACE = "CamelCxfOperationNamespace";
public static final String SPRING_CONTEXT_ENDPOINT = "bean:";
@Metadata(description = "The destination override url", javaType = "String", applicableFor = SCHEME_CXF)
public static final String DESTINATION_OVERRIDE_URL = Exchange.DESTINATION_OVERRIDE_URL;
diff --git a/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json b/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
index cc4e0c3d1395a..3c906af543c37 100644
--- a/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
+++ b/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
@@ -32,7 +32,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http method to use", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The http path", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
diff --git a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
index 9042ad7e9111b..af191dd4bd5dd 100644
--- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
@@ -190,7 +190,7 @@ Serviced by the following route:
[source,java]
--------------------------------------------------------------------------------------------
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:newCustomer")
.log("Request: type=${header.type}, active=${header.active}, customerData=${body}");
diff --git a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index becba92d8a579..3aceac0080c5a 100644
--- a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++ b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -68,7 +68,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
@Override
diff --git a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index dd3473c9a2b62..c8c41757b0be6 100644
--- a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++ b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -85,7 +85,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
diff --git a/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json b/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
index 0a044ed52d3a7..701a6761f34fd 100644
--- a/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
+++ b/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
@@ -33,8 +33,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property", "displayName": "Use Global Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Enable usage of global SSL context parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
- "operationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the operation.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationNamespace": { "index": 1, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation namespace.", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE" },
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The destination override url", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL" },
"ResponseContext": { "index": 3, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "Map", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The response context", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "", "group": "common", "label": "", "required": false, "javaType": "javax.security.auth.Subject", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The authentication", "constantName": "org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
diff --git a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
index c646a081b0783..e4d134cd08b13 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
+++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
@@ -438,7 +438,7 @@ As an alternative, you can add a message header for it as demonstrated in https:
You can configure the CXF endpoint with the Spring configuration file
shown below, and you can also embed the endpoint into the `camelContext`
tags. When you are invoking the service endpoint, you can set the
-`operationName` and `operationNamespace` headers to explicitly state
+`CamelCxfOperationName` and `CamelCxfOperationNamespace` headers to explicitly state
which operation you are calling.
[source,xml]
diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
index ca713e0ebe9b5..33b674edecdf7 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
+++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
@@ -408,7 +408,7 @@ private Object[] getParams(CxfEndpoint endpoint, Exchange exchange)
* null:
*
*
- * - Using the in message header "operationName".
+ * - Using the in message header "CamelCxfOperationName".
* - Using the defaultOperationName option value from the CxfEndpoint.
* - Using the first operation which is find from the CxfEndpoint Operations list.
*
diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index becba92d8a579..3aceac0080c5a 100644
--- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -68,7 +68,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
@Override
diff --git a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index 736ba3f15ef89..05b6139980bcf 100644
--- a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++ b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -85,7 +85,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
diff --git a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
index 7b8ada2c688a9..870881e0b9ed6 100644
--- a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
+++ b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
@@ -22,6 +22,7 @@
import javax.xml.namespace.QName;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -68,8 +69,9 @@ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("cxf:bean:routerEndpoint?synchronous=true&dataFormat=PAYLOAD")
- .setHeader("operationNamespace", constant("http://camel.apache.org/cxf/jaxws/dispatch"))
- .setHeader("operationName", constant("Invoke"))
+ .setHeader(CxfConstants.OPERATION_NAMESPACE,
+ constant("http://camel.apache.org/cxf/jaxws/dispatch"))
+ .setHeader(CxfConstants.OPERATION_NAME, constant("Invoke"))
.to("cxf:bean:serviceEndpoint?synchronous=true&dataFormat=PAYLOAD");
}
};
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
index b8cde253b6129..77833a0f1c948 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
@@ -2635,10 +2635,10 @@ public static class CxfHeaderNameBuilder {
*
* Group: common
*
- * @return the name of the header {@code operationName}.
+ * @return the name of the header {@code CxfOperationName}.
*/
- public String operationName() {
- return "operationName";
+ public String cxfOperationName() {
+ return "CamelCxfOperationName";
}
/**
* The operation namespace.
@@ -2647,10 +2647,10 @@ public String operationName() {
*
* Group: common
*
- * @return the name of the header {@code operationNamespace}.
+ * @return the name of the header {@code CxfOperationNamespace}.
*/
- public String operationNamespace() {
- return "operationNamespace";
+ public String cxfOperationNamespace() {
+ return "CamelCxfOperationNamespace";
}
/**
* The destination override url.
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
index 6809d5d46be47..860bc11635c9d 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
@@ -2171,10 +2171,10 @@ public static class CxfRsHeaderNameBuilder {
*
* Group: common
*
- * @return the name of the header {@code operationName}.
+ * @return the name of the header {@code CxfOperationName}.
*/
- public String operationName() {
- return "operationName";
+ public String cxfOperationName() {
+ return "CamelCxfOperationName";
}
/**
* The authentication.
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
index 842582b36b00a..c9fa542aabbb2 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
@@ -57,6 +57,9 @@ void testJettyRecipientListCxf() {
// send a message to jetty
Exchange out = template.request("http://0.0.0.0:{{RecipientListCxfTest.port3}}/myapp", exchange -> {
+ // Use the non-Camel-prefixed carrier header convention so it survives
+ // the HTTP transport boundary; the receiver maps it to the renamed
+ // CxfConstants.OPERATION_NAME value before any cxf: call.
exchange.getIn().setHeader("operationName", "greetMe");
exchange.getIn().setBody(request);
});
diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
index 585bc1060b713..73358bc6b1773 100644
--- a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
+++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
@@ -17,7 +17,6 @@
package org.apache.camel.itest.greeter;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.camel.itest.utils.extensions.JmsServiceExtension;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
@@ -49,12 +48,16 @@ public class JmsToCxfInOutTest {
void testJmsToCxfInOut() {
assertNotNull(template);
- String out = template.requestBodyAndHeader("jms:queue:bridge.cxf", "Willem", CxfConstants.OPERATION_NAME, "greetMe",
+ // The CXF operation header value now begins with "Camel" and is therefore
+ // filtered by JmsHeaderFilterStrategy at the transport boundary. Send the
+ // operation as a non-Camel-prefixed carrier header; the route maps it to
+ // CxfConstants.OPERATION_NAME between the JMS from and the cxf: to.
+ String out = template.requestBodyAndHeader("jms:queue:bridge.cxf", "Willem", "operationName", "greetMe",
String.class);
assertEquals("Hello Willem", out);
// call for the other operation
- out = template.requestBodyAndHeader("jms:queue:bridge.cxf", new Object[0], CxfConstants.OPERATION_NAME, "sayHi",
+ out = template.requestBodyAndHeader("jms:queue:bridge.cxf", new Object[0], "operationName", "sayHi",
String.class);
assertEquals("Bonjour", out);
}
diff --git a/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml b/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
index 72c51505e7a40..e392f778c3bbe 100644
--- a/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
+++ b/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
@@ -68,6 +68,14 @@
+
+
+ ${header.operationName}
+
From beadf09e13a67c67f03f4144255fa7257d4afa4a Mon Sep 17 00:00:00 2001
From: Francois de Parscau
Date: Tue, 15 Sep 2026 15:15:07 +0200
Subject: [PATCH 4/6] fix(DPE-3961): update components version
---
Jenkinsfile.talend | 1 +
components/camel-kafka/pom.xml | 5 +++++
pom.xml | 12 +++++++-----
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/Jenkinsfile.talend b/Jenkinsfile.talend
index 024e660ccf4c1..dc7c3117ab68f 100644
--- a/Jenkinsfile.talend
+++ b/Jenkinsfile.talend
@@ -54,6 +54,7 @@ org.apache.camel:camel-infinispan,\
org.apache.camel:camel-jaxb,\
org.apache.camel:camel-jms,\
org.apache.camel:camel-jsonpath,\
+org.apache.camel:camel-kafka,\
org.apache.camel:camel-knative-http,\
org.apache.camel:camel-kubernetes,\
org.apache.camel:camel-langchain4j-core,\
diff --git a/components/camel-kafka/pom.xml b/components/camel-kafka/pom.xml
index 1a50196392961..4e84650cb041a 100644
--- a/components/camel-kafka/pom.xml
+++ b/components/camel-kafka/pom.xml
@@ -30,6 +30,11 @@
jar
Camel :: Kafka
Camel Kafka support
+ ${revision}
+
+
+ ${camel-kafka.tesb.version}
+
diff --git a/pom.xml b/pom.xml
index ac3e3e8cd7f0b..c2ebb62746137 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,8 +109,8 @@
4.8.10-4.14.7-1
4.8.10-4.14.7-1
4.8.1.20251008
- 4.8.1.20250320
- 4.8.1.20260608
+ 4.8.10-4.14.7-1
+ 4.8.10-4.14.7-1
4.8.1.20260608
4.8.1.20250320
4.1.0.2
@@ -121,7 +121,7 @@
4.8.1.20250320
4.8.1.20250320
4.8.1.20250320
- 4.8.1.20250320
+ 4.8.10-4.14.7-1
4.8.1.20260608
4.8.1.20260608
4.8.1.20250320
@@ -138,17 +138,18 @@
4.8.1.20250901
4.8.1.20250320
4.8.1.20250320
- 4.8.1.20260608
+ 4.8.10-4.14.7-1
4.8.1.20260909
4.8.1.20260909
4.8.1.20260608
4.8.1.20250320
4.8.10-4.14.7-1
4.8.1.20250320
+ 4.8.10-4.14.7-1
4.8.1.20260608
4.8.1.20250320
4.8.1.20260304
- 4.8.1.20260608
+ 4.8.10-4.14.7-1
4.8.1.20260608
4.8.1.20250320
4.8.1.20250320
@@ -376,6 +377,7 @@
${camel-jaxb.tesb.version}
${camel-jms.tesb.version}
${camel-jsonpath.tesb.version}
+ ${camel-kafka.tesb.version}
${camel-knative-http.tesb.version}
${camel-kubernetes.tesb.version}
${camel-leveldb.tesb.version}
From 1d2d827ce1f1a9aae39d6b1afac9d709f5423414 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20de=20Parscau?=
<116000379+f2par0@users.noreply.github.com>
Date: Wed, 16 Sep 2026 09:31:18 +0200
Subject: [PATCH 5/6] Update pom.xml
Co-authored-by: Stefan Tataru
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c2ebb62746137..8bf51051f512b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -167,7 +167,7 @@
4.8.1.20250320
4.8.1.20250320
4.8.1.20251208
- 4.8.1.20250320
+ 4.8.10-4.14.7-1
4.8.1.20250320
4.8.1.20250320
4.8.1.20250320
From 5896d5c3b2744ee9ed59aa6bf7a3c719da3d021c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20de=20Parscau?=
<116000379+f2par0@users.noreply.github.com>
Date: Wed, 16 Sep 2026 09:31:28 +0200
Subject: [PATCH 6/6] Update pom.xml
Co-authored-by: Stefan Tataru
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8bf51051f512b..bc4de2fc267f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,7 @@
4.8.10-4.14.7-1
4.8.10-4.14.7-1
4.8.10-4.14.7-1
- 4.8.1.20251008
+ 4.8.10-4.14.7-1
4.8.10-4.14.7-1
4.8.10-4.14.7-1
4.8.1.20260608