lib/brown/agent/amqp/class_methods.rb in brown-2.2.2.25.g85ddf08 vs lib/brown/agent/amqp/class_methods.rb in brown-2.2.2.27.gbc378e8

- old
+ new

@@ -107,10 +107,16 @@ # # @param predeclared [Boolean] indicates that the necessary queues and # bindings are already in place, and thus no declarations should be # made to the AMQP broker. # + # @param reject_on_error [Boolean] by default, if an uncaught exception + # is raised during message handling, an error will be logged and the + # listener will not process any new messages. However, if + # `reject_on_error: true`, then instead the message will be rejected, and + # processing will continue + # # @param blk [Proc] is called every time a message is received from # the queue, and an instance of {Brown::Agent::AMQPMessage} will # be passed as the sole argument. # # @yieldparam message [Brown::Agent::AMQPMessage] is passed to `blk` @@ -121,10 +127,11 @@ concurrency: 1, autoparse: false, allowed_classes: nil, routing_key: nil, predeclared: false, + reject_on_error: false, &blk ) exchange_list = (Array === exchange_name ? exchange_name : [exchange_name]).map(&:to_s) if queue_name.nil? @@ -140,8 +147,9 @@ autoparse: autoparse, allowed_classes: allowed_classes, routing_key: routing_key, callback: blk, predeclared: predeclared, + reject_on_error: reject_on_error, } end end