def run(subscribe_opts: {})
      @rabbitmq_connection.start

      subscribe_opts = { block: true, manual_ack: true}.merge(subscribe_opts)
      queue.subscribe(subscribe_opts) do |delivery_info, headers, payload|
        begin
          message = Message.new(payload, headers, delivery_info)
          @statsd_client.increment("#{@queue_name}.started")
          message_consumer.process(message)
          @statsd_client.increment("#{@queue_name}.#{message.status}")
        rescue Exception => e
          @statsd_client.increment("#{@queue_name}.uncaught_exception")
          GovukError.notify(e) if defined?(GovukError)
          @logger.error "Uncaught exception in processor: \n\n #{e.class}: #{e.message}\n\n#{e.backtrace.join("\n")}"
          exit(1) # Ensure rabbitmq requeues outstanding messages
        end
      end
    end
def run(subscribe_opts: {})
      @rabbitmq_connection.start

      subscribe_opts = { block: true, manual_ack: true}.merge(subscribe_opts)
      queue.subscribe(subscribe_opts) do |delivery_info, headers, payload|
        begin
          message = Message.new(payload, headers, delivery_info)
          @statsd_client.increment("#{@queue_name}.started")
          message_consumer.process(message)
          @statsd_client.increment("#{@queue_name}.#{message.status}")
        rescue Exception => e
          @statsd_client.increment("#{@queue_name}.uncaught_exception")
          GovukError.notify(e) if defined?(GovukError)
          @logger.error "Uncaught exception in processor: \n\n #{e.class}: #{e.message}\n\n#{e.backtrace.join("\n")}"
          exit(1) # Ensure rabbitmq requeues outstanding messages
        end
      end
    end
Create a new consumer

 @param queue_name [String] Your queue name. This is specific to your application,
                            and should already exist and have a binding via puppet
 @param processor [Object] An object that responds to `process`
 @param rabbitmq_connection [Object] A Bunny connection object derived from `Bunny.new`
 @param statsd_client [Statsd] An instance of the Statsd class
 @param logger [Object] A Logger object for emitting errors (to stderr by default)