Skip to content

Instantly share code, notes, and snippets.

@danielkec
Last active March 20, 2020 13:36
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/0e2ee04bb60516b46382cf9031c8a66f to your computer and use it in GitHub Desktop.
Save danielkec/0e2ee04bb60516b46382cf9031c8a66f to your computer and use it in GitHub Desktop.
messaging-article-1
@Outgoing("publisher-payload")
public PublisherBuilder<Integer> streamOfMessages() {
return ReactiveStreams.of(1, 2, 3);
}
@Incoming("publisher-payload")
@Outgoing("wrapped-message")
public Message<String> rewrapMessageManually(Message<Integer> message) {
return Message.of(Integer.toString(message.getPayload()));
}
@Incoming("wrapped-message")
public void consumeImplicitlyUnwrappedMessage(String value) {
System.out.println("Consuming message: " + value);
}
> Consuming message: 1
> Consuming message: 2
> Consuming message: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment