Skip to content

[Discuss] Producer and consumer add a strategy to connect to NameServer  #5698

@mxsm

Description

@mxsm

Producers and consumers connecting to NameServer to obtain routing information are random, and data is obtained by randomly selecting a NameServer from the given NameServer list for connection. This situation has the following disadvantages:

  1. The better machines deployed by NameServer cannot exert all their machine performance, while the poorer machines may connect to many, causing the service to crash.
  2. Cannot specify a NameServer for connection (except for configuring a single NameServer address).

Therefore, it is considered to add a strategy pattern for selecting a NameServer for connection in the client (producer and consumer). The developer can choose or implement the strategy to select the NameServer for connection. The following strategies can be considered:

  1. Random strategy: randomly select a NameServer for connection (current mode).
  2. Specified strategy: specify a specific NameServer for connection.
  3. Polling strategy: the current application's clients select from the given NameServers on their own.
  4. NameServer minimum client connection strategy: obtain the current NameServer with the minimum number of client connections for connection.

Other strategies can be added in the future.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions