
1、对于同步消息重发2次,异步消息或者oneWay消息发送一次,对于没有发送的消息,可以暂时入库,定时去发
2、其次选择queue,对于任何一个线程而言,首次都有一个threadlocal存储一个随机数,下次在发送消息会加1,依次往所有队列里发消息

然后进行了大概的步骤
1、获得broker地址
2、设置唯一消息id
3、压缩消息
4、判断是否事务消息
5、消息hook检查
6、设置请求头、请求体
7、发送消息
8、响应结果解析

broker接收消息:
1、消息检查

2、判断queueId
3、判断是否进入死信队列

4、存储消息

5、返回结果

网友评论