Reputation: 453
I am using ReplyingKafkaTemplate to get a synchronous response. When this times out waiting on a response, the entire payload is logged instead of only the metadata, though I have set the option to only log metadata. I am using spring boot 2.6.2, spring-kafka 2.8.1.
What am I missing to get this to only log metadata?
I have tried setting the spring property in application.properties:
spring.kafka.listener.only-log-record-metadata=true
I have tried setting it directly on the beans:
repliesContainer.getContainerProperties().setOnlyLogRecordMetadata(true);
I have tried adding this Customizer class I found here: https://github.com/spring-projects/spring-kafka/issues/1659
@Component
public class Customizer {
Customizer(AbstractKafkaListenerContainerFactory<?, ?, ?> factory) {
factory.getContainerProperties().setOnlyLogRecordMetadata(true);
}
}
Regardless of these attempts, the full payload is still being logged when the reply times out.
Upvotes: 1
Views: 634
Reputation: 174729
ProducerRecord
s are logged directly by the template, not the container (which logs ConsumerRecord
s).
We don't currently have a utility for ProducerRecords
.
I opened an issue https://github.com/spring-projects/spring-kafka/issues/2132
Upvotes: 2