回調有以下方式,下面將分別實踐spring
public enum AcknowledgeMode { NONE, MANUAL, AUTO; }
關於回調官方文檔上的說明springboot
NONE = no acks will be sent (incompatible with channelTransacted=true). RabbitMQ calls this "autoack" because the broker assumes all messages are acked without any action from the consumer.
MANUAL = the listener must acknowledge all messages by calling Channel.basicAck().
AUTO = the container will acknowledge the message automatically, unless the MessageListener throws an exception. Note that acknowledgeMode is complementary to channelTransacted - if the channel is transacted then the broker requires a commit notification in addition to the ack. This is the default mode. See also txSize.less