Skip to content

Instantly share code, notes, and snippets.

@danielkec
Created March 20, 2020 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkec/2a745304a8453d84629e5cdbcf5664f8 to your computer and use it in GitHub Desktop.
Save danielkec/2a745304a8453d84629e5cdbcf5664f8 to your computer and use it in GitHub Desktop.
@Outgoing("test-channel")
public Publisher<Message<String>> produceMessage() {
return ReactiveStreams.of(Message.of("test-data", () -> {
System.out.println("Message acked!");
return CompletableFuture.completedStage(null);
})).buildRs();
}
@Incoming("test-channel")
@Acknowledgment(Acknowledgment.Strategy.POST_PROCESSING)
public void receiveMessage(String msg) {
System.out.println("Received payload:" + msg);
}
> Received payload: test-data
> Message acked!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment