Created
December 17, 2020 14:00
-
-
Save danielkec/c85cbc098b5350671ec99d051e958f2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private AtomicInteger counter = new AtomicInteger(); | |
| @Incoming("from-aq") | |
| @Acknowledgment(Acknowledgment.Strategy.MANUAL) | |
| public CompletionStage<?> fromAq(AqMessage<String> msg) { | |
| System.out.println("Received: " + msg.getPayload()); | |
| if (counter.getAndIncrement() == 5) { | |
| throw new RuntimeException("5th message exception!"); | |
| } | |
| //Acknowledgement/commit is called after the business code | |
| return msg.ack(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment