Giter VIP home page Giter VIP logo

Comments (5)

crash-g avatar crash-g commented on June 11, 2024 1

Alright, thanks for the info, I'll give it a try!

from rusty-celery.

epwalsh avatar epwalsh commented on June 11, 2024 1

Good catch. I am leaning towards option 2 because that seems much simpler. And I think it's perfectly reasonable to treat retrying and acking as separate actions as far as the broker is concerned.

from rusty-celery.

crash-g avatar crash-g commented on June 11, 2024

Hi @epwalsh, I'd like to work at this issue if you can give some pointers on how to get started. Thanks!

from rusty-celery.

epwalsh avatar epwalsh commented on June 11, 2024

Hey @crash-g! Awesome, that would be much appreciated!

So, as rough guide, we need

  • a new method on the CeleryBuilder struct - something like pub fn acks_late(mut self, late: bool) -> Self {...} - and a corresponding field in the Celery struct.
  • Then within Celery::try_handle_delivery we need to modify the behavior if acks_late is false. In particular, if acks_late=false, we need to call self.broker.ack(delivery).await?; right before tracer.trace().await.

There might be some other details I am missing but let me know if you have any questions!

from rusty-celery.

crash-g avatar crash-g commented on June 11, 2024

It looks like a little care is needed to prevent acking a message twice.

The problem is that after processing the message, we call self.broker.retry in case of a recoverable error, and currently amqp broker acks the message when retrying. I see a couple of possible solutions, but feel free to suggest something else entirely:

  1. Modify the ack implementation for amqp to only send the ack once (basically, by keeping track of already acknowledged messages)
  2. Modify the retry implementation for amqp not to send the ack

Of course, I'm assuming that acking twice is an issue: if it is not, then the above considerations do not apply.

from rusty-celery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.