Commit 05f10a4
GH-3880: Doc for default
Fixes: #3880
Add an documentation on how to correctly inject headers in default `@KafkaHandler`.
Because of arguments resolution limitations in Spring Messaging, the `@Header` cannot be used on the default `@KafkaHandler`.
Instead the more general `@Headers Map<String, Object>` has to be used.
To satisfy default `@KafkaHandler` method expectations (usually `Object payload`), the `HandlerAdapter` injects a payload into `providedArgs`.
The type of that payload may clash with expected type of the `@Header` argument.
See `InvocableHandlerMethod.getMethodArgumentValues()` for details how params are resolved.
Signed-off-by: Sanghyeok An <[email protected]>
Co-authored-by: Artem Bilan <[email protected]>@KafkaHandler limitations1 parent dd30085 commit 05f10a4
File tree
1 file changed
+22
-0
lines changed- spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages
1 file changed
+22
-0
lines changedLines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
0 commit comments