def unserialize(queue, message, options = {})
      begin
        received_at = Time.now.to_f
        packet = @serializer.method(:load).arity.abs > 1 ? @serializer.load(message, queue) : @serializer.load(message)
        if options.key?(packet.class)
          unless options[:no_log] && logger.level != :debug
            re = "RE-" if packet.respond_to?(:tries) && !packet.tries.empty?
            packet.received_at = received_at if packet.respond_to?(:received_at)
            log_filter = options[packet.class] unless logger.level == :debug
            logger.info("#{re}RECV #{@alias} #{packet.to_s(log_filter, :recv_version)} #{options[:log_data]}")
          end
          packet
        else
          category = options[:category] + " " if options[:category]
          logger.error("Received invalid #{category}packet type from queue #{queue} on broker #{@alias}: #{packet.class}\n" + caller.join("\n"))
          nil
        end
      rescue StandardError => e
        # TODO Taking advantage of Serializer knowledge here even though out of scope
        trace, track = case e.class.name.sub(/^.*::/, "")
        when "SerializationError"  then [:caller, e.to_s !~ /MissingCertificate|MissingPrivateKey|InvalidSignature/]
        when "ConnectivityFailure" then [:caller, false]
        else                            [:trace, true]
        end
        logger.exception("Failed unserializing message from queue #{queue.inspect} on broker #{@alias}", e, trace)
        @exception_stats.track("receive", e) if track
        @options[:exception_on_receive_callback].call(message, e) if @options[:exception_on_receive_callback]
        update_non_delivery_stats("receive failure", e)
        nil
      end
    end
def unserialize(queue, message, options = {})
      begin
        received_at = Time.now.to_f
        packet = @serializer.method(:load).arity.abs > 1 ? @serializer.load(message, queue) : @serializer.load(message)
        if options.key?(packet.class)
          unless options[:no_log] && logger.level != :debug
            re = "RE-" if packet.respond_to?(:tries) && !packet.tries.empty?
            packet.received_at = received_at if packet.respond_to?(:received_at)
            log_filter = options[packet.class] unless logger.level == :debug
            logger.info("#{re}RECV #{@alias} #{packet.to_s(log_filter, :recv_version)} #{options[:log_data]}")
          end
          packet
        else
          category = options[:category] + " " if options[:category]
          logger.error("Received invalid #{category}packet type from queue #{queue} on broker #{@alias}: #{packet.class}\n" + caller.join("\n"))
          nil
        end
      rescue StandardError => e
        # TODO Taking advantage of Serializer knowledge here even though out of scope
        trace, track = case e.class.name.sub(/^.*::/, "")
        when "SerializationError"  then [:caller, e.to_s !~ /MissingCertificate|MissingPrivateKey|InvalidSignature/]
        when "ConnectivityFailure" then [:caller, false]
        else                            [:trace, true]
        end
        logger.exception("Failed unserializing message from queue #{queue.inspect} on broker #{@alias}", e, trace)
        @exception_stats.track("receive", e) if track
        @options[:exception_on_receive_callback].call(message, e) if @options[:exception_on_receive_callback]
        update_non_delivery_stats("receive failure", e)
        nil
      end
    end
Unserialize message, check that it is an acceptable type, and log it

 === Parameters
 queue(String):: Name of queue
 message(String):: Serialized packet
 options(Hash):: Subscribe options
   (packet class)(Array(Symbol)):: Filters to be applied in to_s when logging packet to :info,
     only packet classes specified are accepted, others are not processed but are logged with error
   :category(String):: Packet category description to be used in error messages
   :log_data(String):: Additional data to display at end of log entry
   :no_log(Boolean):: Disable receive logging unless debug level

 === Return
 (Packet|nil):: Unserialized packet or nil if not of right type or if there is an exception