Comments (7)
I was curious on this topic - e.g. for Kafka, when should we commit the offset so that producer can keep going? Also where to replay the message?
Edit: I realized this is for rabbitmq producer, not broadway
from broadway_rabbitmq.
I don't really know with Kafka as I don't have experience with it :/
from broadway_rabbitmq.
@whatyouhide I think this funtionality would be exclusive to RabbitMQ. RabbitMQ can ackcnowledge the message early on and then put "an empty acknowledger" for the message going forward, so I will move this issue to the RabbitMQ project.
Also, regarding RabbitMQ, I think we should have "multiple ack modes" and allow the user to choose. On start you would do something llike:
ack: :confirm | :confirm_on_receive | :nothing,
nack: :reject_with_requeue | :reject | :confirm | :nothing | ...
But you can also change those modes on the fly. This allows you to control what happens in case of exceptions (the one you set at the module level) and also what happens when you explicitly call fail
.
from broadway_rabbitmq.
@josevalim okay, let me get it right so I can help with the implementation. You can really do one of three things if you want to ack messages:
- have
no_ack
set totrue
, meaning that RabbitMQ will consider the message acked once it believes it has been delivered to a consumer. I believe we probably want to support this option. - ack at any point of the pipeline: when the message arrives, or during processing, or after processing but before batching, or in between two operation done in the processing, and so on. Maybe we should provide a way to ack the message explicitly and provide something like
ack: :manual
when configuring the producer so that we can use the no-op acknowledger in that case. - have Broadway ack automatically at the end of the pipeline unless the message is failed explicitly.
I am not a fan of the :confirm
-based names since in RabbitMQ confirms are something else. Thoughts? How would we explicitly ack the message in your opinion?
from broadway_rabbitmq.
Right, the idea is that we will have two configs (ack | nack) but those values will be copied as default values to the acknowledge data. You will be able to change those values on a message on the fly at any moment. My suggestions for values for ack/nack were just suggestions, I am not familiar with the best names for RabbitMQ, so whatever you propose.
ack at any point of the pipeline
This needs to be a Broadway feature, I would probably work/discuss it separately
have Broadway ack automatically at the end of the pipeline
This will be possible once we implement this issue. The idea is that you can do something like:
message
|> configure_ack(nack: :nothing)
|> failed("explicitly fail due to x")
Let's have a meeting where we can discuss it once I am back home.
from broadway_rabbitmq.
@josevalim sounds good. Ping me tomorrow (Monday) or the day after and we can talk about this :)
from broadway_rabbitmq.
Closing this since we implemented ack_immediately
(dashbitco/broadway#108) and configure_ack
(dashbitco/broadway#109) in Broadway. I've opened #40 to track implementation of the configure/3
callback in the RabbitMQ producer.
from broadway_rabbitmq.
Related Issues (20)
- Crash supervisor after killing Broadway process HOT 1
- econnrefused when deploying elixir project with broadway HOT 3
- ACK timeout kills connection without getting restarted HOT 4
- Ability to retrieve the AMQP Channel used by the Producer HOT 3
- Any plan for new version release? HOT 2
- Allow use of nimble_options 0.4.0 in broadway_rabbitmq HOT 2
- Retrieving additional information from AMQP.Queue.declare HOT 2
- AMQP 1.0 support HOT 7
- Allow usage of connection/channel pool HOT 6
- Update nimble options requirement HOT 1
- publish new version
- Broadway.prepare_messages/2 callback always receives exactly one message HOT 16
- Pass in an established connection HOT 11
- Proposal: require users to specify `:on_failure` HOT 1
- Questions about supported versions of the AMQP protocol HOT 2
- AMQP 2.0 HOT 3
- Multiple producers is an anti-pattern, right? HOT 12
- Working dead letter example HOT 1
- producers keep failing with declare: [no_wait: true] HOT 5
- :message_count is not honoured as metadata option. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from broadway_rabbitmq.