dashbitco/broadway_rabbitmq

An unhandled case clause

Closed this issue · 5 comments

Library version 0.3.0
erlang 21.3.6
elixir 1.8.1

** (CaseClauseError) no case clause matching: {:error, :unknown_host}
    (broadway_rabbitmq) lib/broadway_rabbitmq/producer.ex:278: BroadwayRabbitMQ.Producer.connect/1
    (broadway_rabbitmq) lib/broadway_rabbitmq/producer.ex:187: BroadwayRabbitMQ.Producer.handle_info/2
    (broadway) lib/broadway/producer.ex:103: Broadway.Producer.handle_info/2
    (gen_stage) lib/gen_stage.ex:2082: GenStage.noreply_callback/3
    (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

An unknown host currently causes an exception in the Producer code.

I would expect this code to bubble up the error to my application code.

@isaacsanders is the producer being restarted?

It is.

It's not that big of a problem, and because this is AFAIK rather nascent, I don't mind this just being a wontfix.

Ok, so it is behaving as expected. :) You can alos conffigure the max_restarts / max_shutdown if you want a more abrupt shutdown.

Btw, the alterrnative here is to fail to connect on init, but thjis means a small hiccup will forbid you from sstarting your app.