Skip to content

Commit

Permalink
Added getAck and getNack methods in SolaceIncomingChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
SravanThotakura05 committed Jan 29, 2024
1 parent fc36d56 commit 537cd3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import java.util.concurrent.CompletionStage;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

import org.eclipse.microprofile.reactive.messaging.Metadata;

Expand Down Expand Up @@ -82,6 +84,16 @@ public Metadata getMetadata() {
return metadata;
}

@Override
public Supplier<CompletionStage<Void>> getAck() {
return this::ack;
}

@Override
public Function<Throwable, CompletionStage<Void>> getNack() {
return this::nack;
}

@Override
public CompletionStage<Void> ack() {
this.unacknowledgedMessageTracker.decrement();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Message<?> consumeAndPublishToDynamicTopic(SolaceInboundMessage<?> p) {
.setApplicationMessageId("test")
.setDynamicDestination("hello/foobar/" + p.getMessage().getApplicationMessageId())
.createPubSubOutboundMetadata();
return p.addMetadata(outboundMetadata).withAck(() -> p.ack());
return p.addMetadata(outboundMetadata);
}

}

0 comments on commit 537cd3b

Please sign in to comment.