Tencent / TubeMQ

TubeMQ has been donated to the Apache Software Foundation and renamed to InLong, please visit the new Apache repository: https://github.com/apache/incubator-inlong
https://inlong.apache.org/
2.02k stars 391 forks source link

Optimize client visitToken checking #133

Closed gosonzhang closed 4 years ago

gosonzhang commented 4 years ago

Optimize client visitToken checking The client visitToken check function is mainly to prevent the client from bypassing the Master node to directly access the Broker. However, it is a cumbersome problem to maintain the visitToken consistency of the three nodes in real time. In order to ensure the service priority in any scenario, the function is as follows adjustment:

  1. Allow the cluster manager to disable this feature;
  2. If the function is enabled, it will only be checked when the Broker and the Master maintain the heartbeat; if the Broker finally registers the Master for less than 4 minutes, it will not be checked; if the check fails, the production and consumption will fail.

优化客户端visitToken检查功能 客户端visitToken检查功能主要是为了防止客户端绕过Master节点直接访问Broker情况,但要实时维持3个节点的visitToken一致是一个比较麻烦的问题,为了保证任何场景下都能业务优先,功能进行如下调整:

  1. 允许集群管理者关闭该功能;
  2. 如果功能启用时,只在Broker与Master维持心跳时才进行检查;如果Broker最后注册Master的时间不足4分钟则不作检查;如果检查不通过,则生产消费会失败