Skip to content

Commit

Permalink
Don't Log Converted Message With Projection
Browse files Browse the repository at this point in the history
`toString()` cannot be invoked on the payload proxy created by
the project factory.
  • Loading branch information
garyrussell committed Mar 22, 2021
1 parent 45bddc8 commit 2d95538
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.kafka.listener.KafkaListenerErrorHandler;
import org.springframework.kafka.listener.ListenerExecutionFailedException;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.kafka.support.converter.ProjectingMessageConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.GenericMessage;

Expand Down Expand Up @@ -79,7 +80,7 @@ public void onMessage(ConsumerRecord<K, V> record, Acknowledgment acknowledgment
else {
message = NULL_MESSAGE;
}
if (logger.isDebugEnabled()) {
if (logger.isDebugEnabled() && !(getMessageConverter() instanceof ProjectingMessageConverter)) {
logger.debug("Processing [" + message + "]");
}
try {
Expand Down

0 comments on commit 2d95538

Please sign in to comment.