不好,不用看

命令

  • nohup sh mqnamesrv &:启动namesrv
  • 启动mqbroker:image.png

    consumer类型

  • push Consumer

  • pull Consumer

集群环境

主从模式

  • 从节点只能提供给consumer服务。
  • 目前,不支持主从切换

    双主模式

消息返回状态

image.png

消费模式

  • 广播模式
    • group中每个consumer都消费topic所有消息。

Consumer拉模式

  • DefaultMQPullConsumer:需要自己保存offset
    • consumer.fetchSubscribeMessageQueues:获取queue
    • consumer.pullBlockIfNotFound:获取消息
  • MQPullConsumerScheduleService:可以将offset保存
    • updateConsumeOffset:保存offset

rocketmq结构

image.png

  • commit log:记录消息
  • queue:只存放消息的引用

事务消息

TransactionListener

image.png

顺序消费