mattmartian
Broadway: Trying to send a message back to the queue it came from in handle_failed/2
Hey there, in case of any error in my processing of a message, i want to send it back to the SQS queue once more with a flag so that i can send it to a dead letter queue if it fails again, however i dont see my batchers inspect and i just get a stacktrace in my iex. Im purposely raising an exception so that it triggers the callback for testing. I unfortunately cant send my stacktrace but its just essentially the error test that i am raising in another function that handles the message process
Marked As Solved
benwilson512
Hey @mattmartian, welcome! The message is not acknowledged to SQS until it succeeds, so you don’t need to return it to the queue. It won’t be removed from the queue unless Broadway acknowledges it as successful. For dead letter queueing, you can simply configure your SQS queue to move items to a dead letter queue after a certain number of failures.
Also Liked
benwilson512
That is correct! Do note that any database records you’ve written to that point are not automagically removed unless it fails inside of a transaction, so if you are doing side effect stuff like that you’ll want to make it idempotent or remove them in handle_failed
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









