Skip to content

Enable the tracing on the reply of a ReplyingKafkaTemplate #3808

@frosiere

Description

@frosiere

Spring Kafka supports observation and, more specifically, tracing on Kafka templates and Kafka listeners, but tracing is not supported on the reply of a ReplyingKafkaTemplate.

As the ReplyingKafkaTemplate consumes the replies using a batch listener, it should be possible to reconstruct the tracing context (traceId and baggages) for each record when iterating over these records. This can be done by starting an observation for each record (see ReplyingKafkaTemplate#onMessage), similar as it's done in KafkaMessageListenerContainer#doInvokeRecordListener.

If we agree on this request, I could help by filing a PR.

Any help or suggestions to avoid having to handle it manually for each reply would be more than welcome.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions