Skip to content

Documentation for setting up dead-letter exchange is inaccurate and/or incomplete #133

@fireproofsocks

Description

@fireproofsocks

If the example from https://hexdocs.pm/broadway_rabbitmq/BroadwayRabbitMQ.Producer.html#module-dead-letter-exchanges is run, it generates errors:

[error] GenServer Rarebit.Pipelines.Inspection.Broadway.Producer_0 terminating
** (stop) exited in: :gen_server.call(#PID<0.492.0>, {:subscribe, {:"basic.consume", 0, "my_queue.dlx", "", false, false, false, false, []}, #PID<0.407.0>}, 70000)
    ** (EXIT) shutdown: {:server_initiated_close, 404, "NOT_FOUND - no queue 'my_queue.dlx' in vhost '/'"}

This appears to be because the the my_queue.dlx is not yet created yet -- this makes sense because the code that creates that queue is in the :after_connect option. The errors appear only on the 1st start; subsequent restarts do not seem to have this issue.

Secondly, the code in the handle_message/3 is incomplete -- it should demonstrate a full working example, e.g.

  def handle_message(_processor, message, _context) do
    Broadway.Message.failed(message, "Error handling message; this should trigger a send to the dead letter queue")
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions