# File lib/stomp/connection.rb, line 298
    def nack(message_or_ack_id, headers = {})
      raise Stomp::Error::NoCurrentConnection if @closed_check && closed?
      raise Stomp::Error::UnsupportedProtocolError if @protocol == Stomp::SPL_10
      raise Stomp::Error::ProtocolErrorEmptyHeaderKey if headers.has_key?("")
      raise Stomp::Error::MessageIDRequiredError if message_or_ack_id.nil? || message_or_ack_id == ""
      headers = headers.symbolize_keys
      case @protocol
        when Stomp::SPL_12
          # The NACK frame MUST include an id header matching the ack header
          # of the MESSAGE being acknowledged.
          headers[:id] = message_or_ack_id
        else # Stomp::SPL_11 only
          # NACK has two REQUIRED headers: message-id, which MUST contain a value
          # matching the message-id for the MESSAGE being acknowledged and
          # subscription, which MUST be set to match the value of the subscription's
          # id header.
          headers['message-id''message-id'] = message_or_ack_id
          raise Stomp::Error::SubscriptionRequiredError unless headers[:subscription]
      end
      _headerCheck(headers)
      slog(:on_nack, log_params, headers)
      transmit(Stomp::CMD_NACK, headers)
    end