Help regarding catching exceptions and catch-all handle_info in GenServer?

Hey, I’ve been playing around with conduit last couple of hours and have a few questions/suggestions…

#1 I think adding the message publishing example to conduit_amqp and conduit READMEs would be very helpful. I couldn’t find it any of the docs, but would have expected it under the publisher examples. Instead it is here: https://github.com/conduitframework/conduit_amqp_example

import Conduit.Message
alias Conduit.Message
alias ConduitSqsExampleQueue.Broker
message = put_body(%Message{}, %{"my" => "message"})
Broker.publish(:message, message)

#2 I tried to use the generator mix conduit.gen.broker --adapter amqp. Added the config, added it to my application supervision tree, attempted to start the application and received:

** (Mix) Could not start application pingerly: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: :broker_2
    ** (EXIT) shutdown: failed to start child: MyApp.Broker2.Adapter
        ** (EXIT) shutdown: failed to start child: MyApp.Broker2.Adapter.PubSub
            ** (EXIT) already started: #PID<0.829.0>

Note: this is if I attempt to run it with original broker. What is the suggested way to run multiple brokers? I’m still fairly new to Elixir (6 months) and still wrapping my head around the processes, so unsure why two separate brokers are using the same PID.

I have managed to setup an equivalent of what I had using amqp and a GenServer (and poolboy which I reverted due to timeouts) and I do much prefer conduit. I force-dropped some connections and it handled that well, and didn’t have a problem running through the number of messages I’m dealing with at the moment. Any suggestions on how to make the initial start-up resilient to lack of connection (deferred retry)?

Would just like to get those unnecessary publisher connections sorted now.

If you can throw insight on any of the above I’d be very grateful.

2 Likes