MQ消息队列(4)RabbitMQ源码

1.概述

在RabbitMQ客户端中使用的顶级包com.rabbitmq.client;其中主要的接口和类有:

(1)Channel:AMQP0-9-1的通道,提供了大部分的操作和方法
(2)Connection:AMQP 0-9-1的连接
(3)ConnectionFactory:用于构建Connection的实例
(4)Consumer:消息的消费者
(5)DefaultConsumer:消费者常用的基类
(6)ba

2.源码解析

  • 1.Consumer 接口
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25

    package com.rabbitmq.client;
    import java.io.IOException;
    public interface Consumer {

    void handleConsumeOk(String consumerTag);


    void handleCancelOk(String consumerTag);


    void handleCancel(String consumerTag) throws IOException;

    void handleShutdownSignal(String consumerTag, ShutdownSignalException sig);

    void handleRecoverOk(String consumerTag);


    void handleDelivery(String consumerTag,
    Envelope envelope,
    AMQP.BasicProperties properties,
    byte[] body)
    throws IOException;
    }