You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-9801: Kafka: generate ID & TIMESTAMP headers by default
Fixes: #9801
Spring Integration Apache Kafka inbound channel adapters have always produced
messages without `ID` & `TIMESTAMP` headers.
See `MessagingMessageConverter` used over there by default.
However, for consistency with the rest of Spring Integration channel adapters,
it would be better to have Kafka-specific behave same way.
* Configure default `MessagingMessageConverter` in the `KafkaMessageSource` & `KafkaMessageDrivenChannelAdapter`
for generating `ID` & `TIMESTAMP` headers.
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/main/java/org/springframework/integration/kafka/inbound/KafkaMessageDrivenChannelAdapter.java
+5-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2015-2023 the original author or authors.
2
+
* Copyright 2015-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -133,6 +133,9 @@ public KafkaMessageDrivenChannelAdapter(AbstractMessageListenerContainer<K, V> m
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/main/java/org/springframework/integration/kafka/inbound/KafkaMessageSource.java
+8-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2018-2024 the original author or authors.
2
+
* Copyright 2018-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -256,10 +256,15 @@ public KafkaMessageSource(ConsumerFactory<K, V> consumerFactory,
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageDrivenAdapterTests.java
+9-7
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2016-2024 the original author or authors.
2
+
* Copyright 2016-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/test/java/org/springframework/integration/kafka/inbound/MessageSourceTests.java
+3-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2018-2024 the original author or authors.
2
+
* Copyright 2018-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: src/reference/antora/modules/ROOT/pages/whats-new.adoc
+12-5
Original file line number
Diff line number
Diff line change
@@ -27,27 +27,34 @@ The `AbstractCorrelatingMessageHandler` does not throw an `IllegalArgumentExcept
27
27
Instead, such a collection is wrapped into a single reply message.
28
28
See xref:aggregator.adoc[Aggregator] for more information.
29
29
30
-
[[x6.4-correlation-changes]]
30
+
[[x6.5-correlation-changes]]
31
31
== The `discardIndividuallyOnExpiry` Option For Correlation Handlers
32
32
33
33
The aggregator and resequencer can now discard the whole expired group as a single message via setting `discardIndividuallyOnExpiry` to `false`.
34
34
See xref:aggregator.adoc#releasestrategy[ReleaseStrategy] for more information.
35
35
36
-
[[x6.4-message-store-with-locks]]
36
+
[[x6.5-message-store-with-locks]]
37
37
== The `LockRegistry` in the `MessageStore`
38
38
39
39
The `AbstractMessageGroupStore` now can be configured with a `LockRegistry` to perform series of persistent operation atomically.
40
40
See xref:message-store.adoc#use-lock-registry[Use LockRegistry] for more information.
41
41
42
-
[[x6.4-observation-changes]]
42
+
[[x6.5-observation-changes]]
43
43
== Micrometer Observation Changes
44
44
45
45
The `SourcePollingChannelAdapter` endpoint now starts a `CONSUMER` kind observation for the received message.
46
46
The `MessageReceiverContext` now distinguishes between `handler`, `message-source` and `message-producer` values for the `spring.integration.type` low cardinality tag.
47
47
See xref:metrics.adoc#micrometer-observation[Micrometer Observation] for more information.
48
48
49
-
[[x6.4-mqtt-changes]]
49
+
[[x6.5-mqtt-changes]]
50
50
== Optional Paho MQTT Dependencies
51
51
52
52
The `org.eclipse.paho:org.eclipse.paho.client.mqttv3` dependency for `spring-integration-mqtt` is now also optional as `org.eclipse.paho:org.eclipse.paho.mqttv5.client` always was.
53
-
See xref:mqtt.adoc[MQTT Support] for more information.
53
+
See xref:mqtt.adoc[MQTT Support] for more information.
54
+
55
+
[[x6.5-kafka-changes]]
56
+
== Apache Kafka support Changes
57
+
58
+
The `KafkaMessageSource` and `KafkaMessageDrivenChannelAdapter` now generate `MessageHeaders.ID` and `MessageHeaders.TIMESTAMP` headers by default as the rest of Spring Integration channel adapters.
59
+
The behavior can be restored to the previous with injection of the `MessagingMessageConverter` with default settings.
60
+
See xref:kafka.adoc[Apache Kafka Support] for more information.
0 commit comments