RocketMq接收消息流程
2020-06-15 11:56:09 0 举报
rocketmq接收消息流程
作者其他创作
大纲/内容
BrokerController
+ initialize+ start
SendMessageProcessor
asyncProcessRequest|asyncConsumerSendMsgBack|asyncPutMessage
NettyServerHandler
1. channelRead0
请求标示是异步处理吗?
RemotingResponseCallback
callback|ctx.writeAndFlush(response);把响应的结果写回给客户端
1.创建了DefaultMessageStore2.创建了NettyRemotingServer3.创建了各种线程池调度Executor4.开启了各种定时任务5.调用registerProcessor
NettyRemotingServer
start--开启netty监听,等待消息
1. 创新执行线程runnable接口2. 调用最开始关联的线程调度Executor的submit方法把定义线程runnable接口提交,方法执行完成。runnable异步执行。
同步调用
异步调用
Runnable
run
sendMsg
netty监听消息
asyncProcessRequest|callback
BrokerStartup
+createBrokerController+start
1. 创建SendMessageProcessor2. 调用NettyremotingServer的registerProcessor方法把executor和processor注册到netty中
No
Yes
rocket-client
NettyRemotingAbstract
processMessageReceived |processRequestCommand
0 条评论
下一页