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
The issue #2134 introduced a way to set arbitrary information using the info property of the KafkaListener annotation. This info is then added as a header on the ConsumerRecord.
When using a batch listener, this header is not added on the records.
The internal headers are currently added in KafkaMessageListenerContainer#internalHeaders but this method is only called for single record listeners (see KafkaMessageListenerContainer#checkEarlyIntercept).
Batches are handled in KafkaMessageListenerContainer#invokeBatchListener. So, the interceptor could be called after having iterated on the list of records to allow adding the info header.
The text was updated successfully, but these errors were encountered:
The issue #2134 introduced a way to set arbitrary information using the info property of the KafkaListener annotation. This info is then added as a header on the ConsumerRecord.
When using a batch listener, this header is not added on the records.
Based on the documentation (https://docs.spring.io/spring-kafka/docs/current/reference/html/#li-header), the header is only available in the record interceptor but it would certainly make sense to also have it in when using a batch interceptor.
The internal headers are currently added in KafkaMessageListenerContainer#internalHeaders but this method is only called for single record listeners (see KafkaMessageListenerContainer#checkEarlyIntercept).
Batches are handled in KafkaMessageListenerContainer#invokeBatchListener. So, the interceptor could be called after having iterated on the list of records to allow adding the info header.
The text was updated successfully, but these errors were encountered: