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

Ack consumed messages only after receiving ack for produced messages #23

Open
laaksma opened this issue Oct 31, 2018 · 1 comment
Open

Comments

@laaksma
Copy link
Contributor

laaksma commented Oct 31, 2018

There is a one to one relationship between consumed Pulsar messages and produced Pulsar messages. One message of input results in one message of output. Currently when we use sendAsync for the producer, we return immediately and then ack the original message to the Pulsar broker. This way, if the sending fails, we have already acked the original message and are unable to reprocess it.

Correct solution could be something along the lines of:

producer.newMessage()
               .sendAsync()
               .thenCompose((msg) -> consumer.acknowledgeAsync(inMsg))
               .thenRun(() -> log.info("Message produced"));

@paasovaara
Copy link

this might be a stack-wide issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants