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

AMQP Source acknowledges messages too early #97

Closed
irishshagua opened this issue Nov 29, 2016 · 6 comments
Closed

AMQP Source acknowledges messages too early #97

irishshagua opened this issue Nov 29, 2016 · 6 comments
Milestone

Comments

@irishshagua
Copy link
Contributor

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.

@drewhk drewhk added the bug label Nov 30, 2016
@johanandren
Copy link
Member

It's not a bug, it was a design decision when it was written to keep the scope reasonable.

@johanandren
Copy link
Member

Relevant ticket #104

@johanandren
Copy link
Member

I should add that such functionality would be great to have.

@kennedyoliveira
Copy link

Is this feature going to be worked on? Is there are "best practice" to get around the problem of losing messages?

@johanandren
Copy link
Member

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.

@kennedyoliveira
Copy link

I see, i'll check the pr and get in touch with the author, thanks @johanandren.

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

No branches or pull requests

4 participants