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
Resolvesspring-attic/spring-cloud-stream-binder-kafka#928
Kafka has a longer default send timeout; this means a send could be successful long
after Spring has timed out the send.
**I will backport to the 3.3.x extension after merge**
* Use setSendTimeout; make it final.
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/main/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandler.java
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/test/java/org/springframework/integration/kafka/config/xml/KafkaOutboundGatewayParserTests-context.xml
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/test/java/org/springframework/integration/kafka/config/xml/KafkaOutboundGatewayParserTests.java
Copy file name to clipboardExpand all lines: spring-integration-kafka/src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java
Copy file name to clipboardExpand all lines: src/reference/asciidoc/kafka.adoc
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,10 @@ Flushing after sending several messages might be useful if you are using the `li
73
73
By default, the expression looks for a `Boolean` value in the `KafkaIntegrationHeaders.FLUSH` header (`kafka_flush`).
74
74
The flush will occur if the value is `true` and not if it's `false` or the header is absent.
75
75
76
+
Starting with version 5.4, the `KafkaProducerMessageHandler` `sendTimeoutExpression` default has changed from 10 seconds to the `delivery.timeout.ms` Kafka producer property `+ 5000` so that the actual Kafka error after a timeout is propagated to the application, instead of a timeout generated by this framework.
77
+
This has been changed for consistency because you may get unexpected behavior (Spring may timeout the send, while it is actually, eventually, successful).
78
+
IMPORTANT: That timeout is 120 seconds by default so you may wish to reduce it to get more timely failures.
79
+
76
80
==== Java Configuration
77
81
78
82
The following example shows how to configure the Kafka outbound channel adapter with Java:
@@ -425,6 +429,10 @@ If your code invokes the gateway behind a synchronous https://docs.spring.io/spr
425
429
IMPORTANT: The gateway does not accept requests until the reply container has been assigned its topics and partitions.
426
430
It is suggested that you add a `ConsumerRebalanceListener` to the template's reply container properties and wait for the `onPartitionsAssigned` call before sending messages to the gateway.
427
431
432
+
Starting with version 5.4, the `KafkaProducerMessageHandler` `sendTimeoutExpression` default has changed from 10 seconds to the `delivery.timeout.ms` Kafka producer property `+ 5000` so that the actual Kafka error after a timeout is propagated to the application, instead of a timeout generated by this framework.
433
+
This has been changed for consistency because you may get unexpected behavior (Spring may timeout the send, while it is actually, eventually, successful).
434
+
IMPORTANT: That timeout is 120 seconds by default so you may wish to reduce it to get more timely failures.
435
+
428
436
==== Java Configuration
429
437
430
438
The following example shows how to configure a gateway with Java:
Copy file name to clipboardExpand all lines: src/reference/asciidoc/whats-new.adoc
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ If you are interested in more details, see the Issue Tracker tickets that were r
20
20
The standalone https://projects.spring.io/spring-integration-kafka/[Spring Integration Kafka] project has been merged as a `spring-integration-kafka` module to this project.
21
21
See <<./kafka.adoc#kafka,Spring for Apache Kafka Support>> for more information.
22
22
23
+
The `KafkaProducerMessageHandler` `sendTimeoutExpression` default has changed.
24
+
See <<./kafka.adoc#kafka-outbound,Kafka Outbound Channel Adapter>> for more information.
25
+
23
26
==== R2DBC Channel Adapters
24
27
25
28
The Channel Adapters for R2DBC database interaction have been introduced.
0 commit comments