def process_message(consumer_class, delivery_info, properties, message)
      message = JSON.parse(message, symbolize_names: true)

      message_id = message.fetch(:message_id)
      produced_at = message.fetch(:produced_at)
      payload = message.fetch(:payload)

      logger.info "Processing message #{message_id} via #{consumer_class}, produced at #{produced_at}"
      set_process_name(consumer_class, message_id)

      consumer = consumer_class.new(delivery_info, logger)
      @consumer_instances << consumer

      instrumentation_options = {
        consumer_class: consumer_class.to_s,
        queue_name: consumer_class.queue_name,
        message_id: message_id,
        produced_at: produced_at,
      }
      ActiveSupport::Notifications.instrument('consume_message.songkick_queue', instrumentation_options) do
        begin
          consumer.process(payload)
        ensure
          @consumer_instances.delete(consumer)
        end
      end
    rescue Object => exception
      logger.error(exception)
      channel.reject(delivery_info.delivery_tag, config.requeue_rejected_messages)
    else
      channel.ack(delivery_info.delivery_tag, false)
    ensure
      set_process_name
    end
def process_message(consumer_class, delivery_info, properties, message)
      message = JSON.parse(message, symbolize_names: true)

      message_id = message.fetch(:message_id)
      produced_at = message.fetch(:produced_at)
      payload = message.fetch(:payload)

      logger.info "Processing message #{message_id} via #{consumer_class}, produced at #{produced_at}"
      set_process_name(consumer_class, message_id)

      consumer = consumer_class.new(delivery_info, logger)
      @consumer_instances << consumer

      instrumentation_options = {
        consumer_class: consumer_class.to_s,
        queue_name: consumer_class.queue_name,
        message_id: message_id,
        produced_at: produced_at,
      }
      ActiveSupport::Notifications.instrument('consume_message.songkick_queue', instrumentation_options) do
        begin
          consumer.process(payload)
        ensure
          @consumer_instances.delete(consumer)
        end
      end
    rescue Object => exception
      logger.error(exception)
      channel.reject(delivery_info.delivery_tag, config.requeue_rejected_messages)
    else
      channel.ack(delivery_info.delivery_tag, false)
    ensure
      set_process_name
    end
Handle receipt of a subscribed message

 @param consumer_class [Class] that was subscribed to
 @param delivery_info [Bunny::DeliveryInfo]
 @param properties [Bunny::MessageProperties]
 @param message [String] to deserialize