Consumers are expected to handle their exceptions.

RabbitMQ Java client consumer dispatch pool will hand all unhandled
exceptions to a separate handler. Langohr doesn't have a way to registering
them
but standard handlers don't do anything beyond logging.

A couple of relevant links:

 * Unhandled Exceptions in http://www.rabbitmq.com/api-guide.html
 *
https://github.com/michaelklishin/langohr/blob/master/src/clojure/langohr/consumers.clj#L113


On Tue, Jan 16, 2018 at 12:42 PM, Magnus Landerblom <mag...@landerblom.se>
wrote:

> Hi,
>
> Trying out Langohr for a project and I'm wondering how I should handle
> exceptions that happens in my handler function.
>
> Example:
> (let [ch (lch/open (...)
>       {queue-name' :queue} (lq/declare ch "" {:exclusive true :auto-delete
> true})
>       handler (fn [ch {:keys [routing-key delivery-tag]} ^bytes payload]
>                   (throw (RuntimeException. "Some error")))]
>     (lq/bind ch queue-name' "amq.topic" {:routing-key ".........."})
>     (lc/subscribe ch queue-name' handler {:block true :auto-ack false})))
>
> What has happened to me a couple of times is that the code that runs
> inside the handler fails and an exception is thrown but it never shows up
> in the terminal.
> It looks like its catched somewhere and never printed.
> Can I get it printed or do I have to wrap the code in a try-catch and
> handle ack/nack for my self there?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "clojure-rabbitmq" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure-rabbitmq+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
MK

Staff Software Engineer, Pivotal/RabbitMQ

-- 
You received this message because you are subscribed to the Google Groups 
"clojure-rabbitmq" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure-rabbitmq+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to