diff --git a/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteConcernException.java b/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteConcernException.java index c592f8fdd..0c9df5bdc 100644 --- a/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteConcernException.java +++ b/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteConcernException.java @@ -21,24 +21,25 @@ import com.mongodb.bulk.WriteConcernError; /** - * The {@linkplain #getMessage() message} {@linkplain Formatter format} is {@code "v=1, code=%d, - * codeName=%s, message=%s, details=%s"}, where {@code details} is JSON produced with {@link - * org.bson.BsonDocument#toJson()}. We may change it in the future, in which case the version - * (marked with {@code v}) will be incremented. + * The {@linkplain #getMessage() message} {@linkplain Formatter format} is {@code "v=2, code=%d, + * codeName=%s, message=%s"}. We may change it in the future, in which case the version (marked with + * {@code v}) will be incremented. + * + *
The {@code details} field (BSON of the failing document, previously emitted in {@code v=1}) is + * intentionally omitted: it carried record-derived content into the DLQ and into DEBUG logs. */ public final class WriteConcernException extends NoStackTraceDlqException { private static final long serialVersionUID = 1L; - private static final int MESSAGE_FORMAT_VERSION = 1; + private static final int MESSAGE_FORMAT_VERSION = 2; public WriteConcernException(final WriteConcernError error) { super( String.format( Locale.ENGLISH, - "v=%d, code=%d, codeName=%s, message=%s, details=%s", + "v=%d, code=%d, codeName=%s, message=%s", MESSAGE_FORMAT_VERSION, error.getCode(), error.getCodeName(), - error.getMessage(), - error.getDetails().toJson())); + error.getMessage())); } } diff --git a/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteException.java b/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteException.java index b028421a4..c8b93893f 100644 --- a/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteException.java +++ b/src/main/java/com/mongodb/kafka/connect/sink/dlq/WriteException.java @@ -21,23 +21,24 @@ import com.mongodb.WriteError; /** - * The {@linkplain #getMessage() message} {@linkplain Formatter format} is {@code "v=1, code=%d, - * message=%s, details=%s"}, where {@code details} is JSON produced with {@link - * org.bson.BsonDocument#toJson()}. We may change it in the future, in which case the version - * (marked with {@code v}) will be incremented. + * The {@linkplain #getMessage() message} {@linkplain Formatter format} is {@code "v=2, code=%d, + * message=%s"}. We may change it in the future, in which case the version (marked with {@code v}) + * will be incremented. + * + *
The {@code details} field (BSON of the failing document, previously emitted in {@code v=1}) is + * intentionally omitted: it carried record-derived content into the DLQ and into DEBUG logs. */ public final class WriteException extends NoStackTraceDlqException { private static final long serialVersionUID = 1L; - private static final int MESSAGE_FORMAT_VERSION = 1; + private static final int MESSAGE_FORMAT_VERSION = 2; public WriteException(final WriteError error) { super( String.format( Locale.ENGLISH, - "v=%d, code=%d, message=%s, details=%s", + "v=%d, code=%d, message=%s", MESSAGE_FORMAT_VERSION, error.getCode(), - error.getMessage(), - error.getDetails().toJson())); + error.getMessage())); } }