Handles the ACK command: Acknowledges receipt of a message.
191009
def ack(self, frame):
        
        if not frame.message_id:
            raise ProtocolError("No message-id specified for ACK command.")
        self.engine.queue_manager.ack(self.engine.connection, frame)
1333189
protected void ack(TransactionAttempt tx, DrpcRequestInfo requestInfo)
    {
        if (logger.isDebugEnabled() == true)
        {
            String logFormat = "Transaction succeeded. TransactionAttempt={0}, DrpcRequestInfo={1}";
            logger.debug(MessageFormat.format(logFormat, tx, requestInfo));
        }

        try
        {
            this.fetchHelper.ack(requestInfo.getRequestId(), "Succeeded");
        }
        catch (TException ex)
        {
            String logFormat = "Success notify failed. TransactionAttempt={0}, DrpcRequestInfo={1}";
            logger.warn(MessageFormat.format(logFormat, tx, requestInfo));
        }
    }
709227
def handle_message(self, client_conn, msg):
        
        # log messages received so that no one else has to
        self._logger.debug('received: {0!s}'.format(msg))

        if msg.mtype == msg.REQUEST:
            return self.handle_request(client_conn, msg)
        elif msg.mtype == msg.INFORM:
            return self.handle_inform(client_conn, msg)
        elif msg.mtype == msg.REPLY:
            return self.handle_reply(client_conn, msg)
        else:
            reason = "Unexpected message type received by server ['%s']." \
                     % (msg,)
            client_conn.inform(self.create_log_inform("error", reason, "root"))
193059
def acked(err, msg):
    """"""
    if err is not None:
        print("failed to deliver message: {}".format(err.str()))
    else:
        print("produced to: {} [{}] @ {}".format(msg.topic(), msg.partition(), msg.offset()))
1081852
def HandleVerack(self):
        """"""
        m = Message('verack')
        self.SendSerializedMessage(m)
        self.leader.NodeCount += 1
        self.identifier = self.leader.NodeCount
        logger.debug(f"{self.prefix} Handshake complete!")
        self.handshake_complete = True
        self.ProtocolReady()
969817
def flexifunction_command_ack_send(self, command_type, result, force_mavlink1=False):
                '''
                

                '''
                return self.send(self.flexifunction_command_ack_encode(command_type, result), force_mavlink1=force_mavlink1)
370711
private void handleInitiateResponseMessage(InitiateResponseMessage message)
    {
        //For mis-routed transactions, no update for truncation handle or duplicated counter
        if (message.isMisrouted()){
            m_mailbox.send(message.getInitiatorHSId(), message);
            return;
        }

        /**
         * A shortcut read is a read operation sent to any replica and completed with no
         * confirmation or communication with other replicas. In a partition scenario, it's
         * possible to read an unconfirmed transaction's writes that will be lost.
         */
        final long spHandle = message.getSpHandle();
        final DuplicateCounterKey dcKey = new DuplicateCounterKey(message.getTxnId(), spHandle);
        DuplicateCounter counter = m_duplicateCounters.get(dcKey);
        final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);

        // All reads will have no duplicate counter.
        // Avoid all the lookup below.
        // Also, don't update the truncation handle, since it won't have meaning for anyone.
        if (message.isReadOnly()) {
            if (traceLog != null) {
                traceLog.add(() -> VoltTrace.endAsync("initsp", MiscUtils.hsIdPairTxnIdToString(m_mailbox.getHSId(), message.m_sourceHSId, message.getSpHandle(), message.getClientInterfaceHandle())));
            }

            // InvocationDispatcher routes SAFE reads to SPI only
            assert(m_bufferedReadLog != null);
            m_bufferedReadLog.offer(m_mailbox, message, m_repairLogTruncationHandle);
            return;
        }

        if (counter != null) {
            String traceName = "initsp";
            if (message.m_sourceHSId != m_mailbox.getHSId()) {
                traceName = "replicatesp";
            }
            String finalTraceName = traceName;
            if (traceLog != null) {
                traceLog.add(() -> VoltTrace.endAsync(finalTraceName, MiscUtils.hsIdPairTxnIdToString(m_mailbox.getHSId(), message.m_sourceHSId, message.getSpHandle(), message.getClientInterfaceHandle()),
                                                      "hash", message.getClientResponseData().getHashes()[0]));
            }

            int result = counter.offer(message);
            if (result == DuplicateCounter.DONE) {
                m_duplicateCounters.remove(dcKey);
                final TransactionState txn = m_outstandingTxns.get(message.getTxnId());
                setRepairLogTruncationHandle(spHandle, (txn != null && txn.isLeaderMigrationInvolved()));
                m_mailbox.send(counter.m_destinationId, counter.m_lastResponse);
            }
            else if (result == DuplicateCounter.MISMATCH) {
                if (m_isLeader && m_sendToHSIds.length > 0) {
                    StringBuilder sb = new StringBuilder();
                    for (long hsId : m_sendToHSIds) {
                        sb.append(CoreUtils.getHostIdFromHSId(hsId) + ":" + CoreUtils.getSiteIdFromHSId(hsId)).append(" ");
                    }
                    hostLog.info("Send dump plan message to other replicas: " + sb.toString());
                    m_mailbox.send(m_sendToHSIds, new DumpPlanThenExitMessage(counter.getStoredProcedureName()));
                }
                RealVoltDB.printDiagnosticInformation(VoltDB.instance().getCatalogContext(),
                        counter.getStoredProcedureName(), m_procSet);
                VoltDB.crashLocalVoltDB("HASH MISMATCH: replicas produced different results.", true, null);
            } else if (result == DuplicateCounter.ABORT) {
                if (m_isLeader && m_sendToHSIds.length > 0) {
                    StringBuilder sb = new StringBuilder();
                    for (long hsId : m_sendToHSIds) {
                        sb.append(CoreUtils.getHostIdFromHSId(hsId) + ":" + CoreUtils.getSiteIdFromHSId(hsId)).append(" ");
                    }
                    hostLog.info("Send dump plan message to other replicas: " + sb.toString());
                    m_mailbox.send(m_sendToHSIds, new DumpPlanThenExitMessage(counter.getStoredProcedureName()));
                }
                RealVoltDB.printDiagnosticInformation(VoltDB.instance().getCatalogContext(),
                        counter.getStoredProcedureName(), m_procSet);
                VoltDB.crashLocalVoltDB("HASH MISMATCH: transaction succeeded on one replica but failed on another replica.", true, null);
            }
        }
        else {
            if (traceLog != null) {
                traceLog.add(() -> VoltTrace.endAsync("initsp", MiscUtils.hsIdPairTxnIdToString(m_mailbox.getHSId(), message.m_sourceHSId, message.getSpHandle(), message.getClientInterfaceHandle())));
            }
            // the initiatorHSId is the ClientInterface mailbox.
            // this will be on SPI without k-safety or replica only with k-safety
            assert(!message.isReadOnly());
            setRepairLogTruncationHandle(spHandle, false);

            //BabySitter's thread (updateReplicas) could clean up a duplicate counter and send a transaction response to ClientInterface
            //if the duplicate counter contains only the replica's HSIDs from failed hosts. That is, a response from a replica could get here
            //AFTER the transaction is completed. Such a response message should not be further propagated.
            if (m_mailbox.getHSId() != message.getInitiatorHSId()) {
                m_mailbox.send(message.getInitiatorHSId(), message);
            }
        }

        //notify the new partition leader that the old leader has completed the Txns if needed.
        //m_mailbox can be MockMailBox for unit test.
        if (!m_isLeader && m_mailbox instanceof InitiatorMailbox) {
            ((InitiatorMailbox)m_mailbox).notifyNewLeaderOfTxnDoneIfNeeded();
        }
    }
799923
def handle_call(self, body, message):
        """"""
        try:
            r = self._DISPATCH(body, ticket=message.properties['reply_to'])
        except self.Next:
            # don't reply, delegate to other agents.
            pass
        else:
            self.reply(message, r)
915116
public void manageAck(final Acknowledgment acknowledgment) {
		final int smid = acknowledgment.getSmsId();
		final SmsStatus smsStatus = acknowledgment.getSmsStatus();
		
		if (logger.isDebugEnabled()) {
			logger.debug("Manage ack with : " + 
				     " - smid : " + smid + 
				     " - ack status : " + smsStatus);
		}
			
		final Sms sms = daoService.getSms(smid);
		
		if (sms != null) {
			manageAck(sms, smsStatus);			
		} else {
			logger.error("unable to find in db sms with : " + 
				     " - sms_id : " + smid + 
				     "In order to update is state in DB" + smid);
		}
		
	}
1365634
def received_message(self, msg):
        
        logger.debug("Received message: %s", msg)
        if msg.is_binary:
            raise ValueError("Binary messages not supported")
        resps = json.loads(msg.data)

        cmd_group = _get_cmds_id(*resps)
        if cmd_group:
            (cmds, promise) = self._cmd_groups[cmd_group]
            promise.fulfill((cmds, resps))
        else:
            try:
                self.received_unsolicited(resps)
            except:
                logger.exception("Error in unsolicited msg handler")
                raise
812900
void processAck(Message msg) {
        PubAck pa;
        Exception ex = null;
        try {
            pa = PubAck.parseFrom(msg.getData());
        } catch (InvalidProtocolBufferException e) {
            // If we are speaking to a server we don't understand, let the
            // user know.
            System.err.println("Protocol error: " +  e.getStackTrace());
            return;
        }

        // Remove
        AckClosure ackClosure = removeAck(pa.getGuid());
        if (ackClosure != null) {
            // Capture error if it exists.
            String ackError = pa.getError();

            if (ackClosure.ah != null) {
                if (!ackError.isEmpty()) {
                    ex = new IOException(ackError);
                }
                // Perform the ackHandler callback
                ackClosure.ah.onAck(pa.getGuid(), ex);
            } else if (ackClosure.ch != null) {
                try {
                    ackClosure.ch.put(ackError);
                } catch (InterruptedException e) {
                    // ignore
                }
            }
        }
    }
537344
def acknowledge_message(self, delivery_tag, **kwargs):
        
        logger.info('Acknowledging message', delivery_tag=delivery_tag, **kwargs)
        self._channel.basic_ack(delivery_tag)
239713
async def _process_ack(self, msg):
        
        pub_ack = protocol.PubAck()
        pub_ack.ParseFromString(msg.data)

        # Unblock pending acks queue if required.
        if not self._pending_pub_acks_queue.empty():
            await self._pending_pub_acks_queue.get()

        try:
            cb = self._pub_ack_map[pub_ack.guid]
            await cb(pub_ack)
            del self._pub_ack_map[pub_ack.guid]
        except KeyError:
            # Just skip the pub ack
            return
        except:
            # TODO: Check for protocol error
            return
97753
def MessageReceived(self, m):
        
        if m.Command == 'verack':
            # only respond with a verack when we connect to another client, not when a client connected to us or
            # we might end up in a verack loop
            if self.incoming_client:
                if self.expect_verack_next:
                    self.expect_verack_next = False
            else:
                self.HandleVerack()
        elif m.Command == 'version':
            self.HandleVersion(m.Payload)
        elif m.Command == 'getaddr':
            self.SendPeerInfo()
        elif m.Command == 'getdata':
            self.HandleGetDataMessageReceived(m.Payload)
        elif m.Command == 'getblocks':
            self.HandleGetBlocksMessageReceived(m.Payload)
        elif m.Command == 'inv':
            self.HandleInvMessage(m.Payload)
        elif m.Command == 'block':
            self.HandleBlockReceived(m.Payload)
        elif m.Command == 'getheaders':
            self.HandleGetHeadersMessageReceived(m.Payload)
        elif m.Command == 'headers':
            self.HandleBlockHeadersReceived(m.Payload)
        elif m.Command == 'addr':
            self.HandlePeerInfoReceived(m.Payload)
        else:
            logger.debug(f"{self.prefix} Command not implemented: {m.Command}")
735620
def _control_resp(self, data, state):
        
        if _is_control_response(data):
            ack_state = bytes([data[22]])
            if state == ack_state:
                _LOGGER.debug("Received state ack from %s, state: %s",
                              self.host, ord(ack_state))
                return ack_state
619563
def messageReceived(self, message):
        
        msgId, msg = message[0], message[2:]
        self._releaseId(msgId)
        d, canceller = self._requests.pop(msgId, (None, None))

        if canceller is not None and canceller.active():
            canceller.cancel()

        if d is None:
            # reply came for timed out or cancelled request, drop it silently
            return

        d.callback(msg)
917005
def ack(self, msg):
        
        self.log.info("senderID:%s Received: %s " % (self.senderID, msg['body']))
        return stomper.NO_REPONSE_NEEDED