Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve backwards compatibility of new Message composition #2446

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ private static BiFunction<Throwable, Metadata, CompletionStage<Void>> validateNa

private static Function<Metadata, CompletionStage<Void>> wrapAck(Message<?> message) {
var ackM = message.getAckWithMetadata();
return ackM != EMPTY_ACK ? ackM : validateAck(message.getAck());
return ackM != null ? ackM : validateAck(message.getAck());
}

private static BiFunction<Throwable, Metadata, CompletionStage<Void>> wrapNack(Message<?> message) {
var nackM = message.getNackWithMetadata();
return nackM != EMPTY_NACK ? nackM : validateNack(message.getNack());
return nackM != null ? nackM : validateNack(message.getNack());
}

private static <T> Message<T> newMessage(T payload, Metadata metadata) {
Expand Down Expand Up @@ -502,7 +502,7 @@ default Supplier<CompletionStage<Void>> getAck() {
*/
@Experimental("metadata propagation is a SmallRye-specific feature")
default Function<Metadata, CompletionStage<Void>> getAckWithMetadata() {
return EMPTY_ACK;
return null;
}

/**
Expand All @@ -517,7 +517,7 @@ default Function<Throwable, CompletionStage<Void>> getNack() {
*/
@Experimental("metadata propagation is a SmallRye-specific feature")
default BiFunction<Throwable, Metadata, CompletionStage<Void>> getNackWithMetadata() {
return EMPTY_NACK;
return null;
}

/**
Expand Down
Loading
Loading