RabbitMQ:基本确认是否也需要由服务器确认?

RabbitMQ:基本确认是否也需要由服务器确认?,rabbitmq,amqp,Rabbitmq,Amqp,假设我使用“确认。选择”将通道置于确认模式,并且确认模式设置为手动,然后我执行以下操作(伪代码): 否,basic.ack无需确认。如果确认消息出现问题(例如,它在网络上丢失),RabbitMQ将使消息保持“未确认”状态。当与该消息关联的通道关闭时,RabbitMQ将对其重新排队,并将其传递给该队列的下一个使用者 请注意,这意味着消息将被传递两次!这是一种你必须考虑的情况(罕见但可能) 注意:RabbitMQ团队监控RabbitMQ用户,并且有时只回答有关StackOverflow的问题 fu

假设我使用“确认。选择”将通道置于确认模式,并且确认模式设置为手动,然后我执行以下操作(伪代码):


否,
basic.ack
无需确认。如果确认消息出现问题(例如,它在网络上丢失),RabbitMQ将使消息保持“未确认”状态。当与该消息关联的通道关闭时,RabbitMQ将对其重新排队,并将其传递给该队列的下一个使用者

请注意,这意味着消息将被传递两次!这是一种你必须考虑的情况(罕见但可能)


注意:RabbitMQ团队监控
RabbitMQ用户
,并且有时只回答有关StackOverflow的问题

function msg_handler(msg: TheDelivery, chan: TheChannelThatDeliverredThisMessage) {
    let new_msg = do_some_computation(msg)

    let confirm = chan.basic_publish(some_other_queue, new_msg)

    -- wait for rabbitmq to confirm this new_msg
    confirm.wait_for_rmq_confirmation()
    
    let x = chan.basic_ack(msg.delivery_tag)

    -- Question: do I need x.wait_for_rmq_confirmation() here?
    -- namely, does the basic_ack/reject/nack needs to be confirmed 
    -- if the channel is in confirmation mode?

    -- The library I am using doesn't require the ack to be confirmed,
    -- for the basic_ack call returns unit, so there is no handle to wait on,
    -- I just want to know that this is the way the AMQP designed (no confirms
    -- of the ack are generated by the rmq server), or that, the protocol requires
    -- that the confirmation of the channel.basic_ack should be generated by the server,
    -- it's just that the library I am using that hides this from me (when the channel is
    -- in confirmation mode)
}

channel.basic_consume(some_queue_name, msg_handler).wait_forever()