From 9bfc8803ea5bcb7f7c7345a3b0050a30acbbdd3d Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Fri, 6 Dec 2019 14:44:02 -0500 Subject: [PATCH] SendTo Doc Polishing - explicitly mention the needed reply template. --- src/reference/asciidoc/kafka.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/reference/asciidoc/kafka.adoc b/src/reference/asciidoc/kafka.adoc index e0e7aecd..381c53f2 100644 --- a/src/reference/asciidoc/kafka.adoc +++ b/src/reference/asciidoc/kafka.adoc @@ -1595,6 +1595,10 @@ public class MultiListenerSendTo { ---- ==== +IMPORTANT: In order to support `@SendTo`, the listener container factory must be provided with a `KafkaTemplate` (in its `replyTemplate` property), which is used to send the reply. +This should be a `KafkaTemplate` and not a `ReplyingKafkaTemplate` which is used on the client-side for request/reply processing. +When using Spring Boot, boot will auto-configure the template into the factory; when configuring your own factory, it must be set as shown in the examples below. + Starting with version 2.2, you can add a `ReplyHeadersConfigurer` to the listener container factory. This is consulted to determine which headers you want to set in the reply message. The following example shows how to add a `ReplyHeadersConfigurer`: