Rocketmq: Some question about "vip channel"?

Created on 9 Oct 2019  ·  3Comments  ·  Source: apache/rocketmq

Some question about "vip channel"?

  • What’s the function of “vip channel”?
  • Why did we use it in RocketMQ?
  • Where use it?

I can’t find something of about it in RocketMQ docs. So, I question it.

Thank you for your attention to this matter.

question

Most helpful comment

brokerVIPChannel will return 2 possible broker's addresses. One is the origin address which has been passed in, another is an address with a different port. For example:
brokerVIPChannel(true, "127.0.0.1:9876") -> "127.0.0.1:9874" brokerVIPChannel(false, "127.0.0.1:9876") -> "127.0.0.1:9876"
The origin one is the normal channel and the different one is the VIP channel.
BrokerController will initialize 2 NettyRemotingServer instance when a broker starts with the same configuration, whick means these 2 server instances listening 2 different port has the same function. In other words, the VIP channel has the same function with the normal channel.
So why broker needs 2 server instance?
The answer is to isolate the read and write operation. Among the API of the message , the most important one is sending message which requires high RTT . It will block netty's IO thread when it occurs message accumulation and impact to write link . The request for consuming message will full of the IO thread pool which will result in the write operation are blocked . In this case , we could send message to VIP channel to guarantee the RTT of sending messages .

All 3 comments

VIP channel used for command message transfer to prevent the message sending/consume socket is very busy lead to the command cannot be executed in time.

brokerVIPChannel will return 2 possible broker's addresses. One is the origin address which has been passed in, another is an address with a different port. For example:
brokerVIPChannel(true, "127.0.0.1:9876") -> "127.0.0.1:9874" brokerVIPChannel(false, "127.0.0.1:9876") -> "127.0.0.1:9876"
The origin one is the normal channel and the different one is the VIP channel.
BrokerController will initialize 2 NettyRemotingServer instance when a broker starts with the same configuration, whick means these 2 server instances listening 2 different port has the same function. In other words, the VIP channel has the same function with the normal channel.
So why broker needs 2 server instance?
The answer is to isolate the read and write operation. Among the API of the message , the most important one is sending message which requires high RTT . It will block netty's IO thread when it occurs message accumulation and impact to write link . The request for consuming message will full of the IO thread pool which will result in the write operation are blocked . In this case , we could send message to VIP channel to guarantee the RTT of sending messages .

@MountainOne thanks, the answer is very clearly.

Was this page helpful?
0 / 5 - 0 ratings