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
AMQP Source acknowledges messages too early #97
Comments
It's not a bug, it was a design decision when it was written to keep the scope reasonable. |
Relevant ticket #104 |
I should add that such functionality would be great to have. |
Is this feature going to be worked on? Is there are "best practice" to get around the problem of losing messages? |
It was worked on in #292, but I think it may be stalled. If you would like to pick it up, please ping the original author of that PR and check what is happening. |
I see, i'll check the pr and get in touch with the author, thanks @johanandren. |
Currently the AMQP source sends an acknowledgement back to the RabbitMQ server as soon as it sends the received message to the outlet.
https://github.com/akka/alpakka/blob/master/amqp/src/main/scala/akka/stream/alpakka/amqp/AmqpSourceStage.scala#L126
If anything happens to the message during the flow which would cause the flow to explode then the message will not be re-queued (although other messages that were in the buffer will). It should be possible to reserve the acknowledgement of the message until it has reached the sink. This way there would be no possibility of losing a message due to some non related runtime exception.
I haven't fully thought out how this would deal with invalid messages which could cause repeated exceptions, but it'd be cool to see if acking after the flow had been considered.
The text was updated successfully, but these errors were encountered: