Skip to content

Commit

Permalink
enhance the message rejected log with information to identify the mes…
Browse files Browse the repository at this point in the history
…sage that was rejected

Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Sep 8, 2021
1 parent 2e09be3 commit 44df6b0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.eclipse.ditto.connectivity.api.ExternalMessage;
import org.eclipse.ditto.connectivity.service.messaging.AcknowledgeableMessage;
import org.eclipse.ditto.connectivity.service.messaging.monitoring.ConnectionMonitor;
import org.eclipse.ditto.connectivity.service.messaging.monitoring.logs.InfoProviderFactory;

import akka.kafka.ConsumerMessage;

Expand Down Expand Up @@ -49,10 +50,10 @@ final class KafkaAcknowledgableMessage {
},
shouldRedeliver -> {
if (shouldRedeliver) {
ackMonitor.exception("Message was rejected and redelivery is requested.");
ackMonitor.exception(message, "Message was rejected and redelivery is requested.");
acknowledgementFuture.completeExceptionally(MessageRejectedException.getInstance());
} else {
ackMonitor.exception("Message was rejected and no redelivery is requested.");
ackMonitor.exception(message, "Message was rejected and no redelivery is requested.");
acknowledgementFuture.complete(committableOffset);
}
});
Expand Down

0 comments on commit 44df6b0

Please sign in to comment.