# File lib/stomp/connection.rb, line 260
    def ack(message_or_ack_id, headers = {})
      raise Stomp::Error::NoCurrentConnection if @closed_check && closed?
      raise Stomp::Error::ProtocolErrorEmptyHeaderKey if headers.has_key?("")
      raise Stomp::Error::ProtocolErrorEmptyHeaderValue if @protocol == Stomp::SPL_10 && headers.has_value?("")
      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 ACK frame MUST include an "id" header matching the "ack" header
          # of the MESSAGE being acknowledged.
          headers[:id] = message_or_ack_id
        when Stomp::SPL_11
          # ACK has two REQUIRED headers: "message-id", which MUST contain a value
          # matching the message-id header of the MESSAGE being acknowledged and
          # "subscription", which MUST be set to match the value of SUBSCRIBE's
          # id header.
          headers['message-id''message-id'] = message_or_ack_id
          raise Stomp::Error::SubscriptionRequiredError unless headers[:subscription]
        else # Stomp::SPL_10
          # ACK has one required header, "message-id", which must contain a value
          # matching the message-id for the MESSAGE being acknowledged.
          headers['message-id''message-id'] = message_or_ack_id
      end
      _headerCheck(headers)
      slog(:on_ack, log_params, headers)
      transmit(Stomp::CMD_ACK, headers)
    end