Skip to content

Kafka - Inspecting outgoing kafka messages. #2300

Answered by ozangunalp
MintInfusion asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to propagate HTTP headers the best option is to use OutgoingInterceptor and add OutgoingKafkaRecordMetadata to your outgoing message.

In Quarkus we recommend using ContextLocals to propagate contextual information between HTTP and RM producer channels.

You can write a ServerRequestFilter to inject headers to be propagated to the ContextLocals and retrieve them in your OutgoingInterceptor. In normal use cases, the context is preserved.

I'll write a section with examples about this in the Quarkus Kafka guide.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ozangunalp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #2290 on September 28, 2023 09:17.