In current HTTP SDK, we use LiteProducer to publish messages. We store the 
server address in the eventMeshServerList property of the LiteProducer, the 
producer is responsible for the selection work.

If we want to support multiple selection strategy, we can define a interface 
named  HostManager or HostSelector, we store the address in the HostManager and 
it can have different implementation according to a specific strategy. The 
producer uses the HostManager to do the selecte work. The User can use a 
specific implementation by configuration.

Best wish
Wenjun Ruan
From: Eason Chen <[email protected]>
Date: Saturday, May 8, 2021 at 3:47 PM
To: [email protected] <[email protected]>
Subject: Re: [Discuss] Support multiple load balance strategy in sdk
External Email

Hi,
Good suggestion, could you describe your design based on current sdk?

Eason

On Sat, May 8, 2021 at 11:37 AM Ruan, Wenjun <[email protected]>
wrote:

> Hi team,
>
> As mention in this issue<
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fincubator-eventmesh%2Fissues%2F333&amp;data=04%7C01%7Cweruan%40ebay.com%7C6fe949af0f4d4fb4cebf08d911f58841%7C46326bff992841a0baca17c16c94ea99%7C0%7C1%7C637560568514613383%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=m6JOMxAeHV6QK%2B1d7ECpilQxG%2Fu%2FU8TcFtz4N4kKb1Y%3D&amp;reserved=0>,
>  at present, if
> we use HTTP SDK to publish a message, the producer will use random strategy
> to select the target server host, this may work well in most  scenarios.
> But sometimes if the servers have different hardware we may want to use the
> weighted polling method to select the server.
>
> So I suggest adding additional load strategy to choose server in SDK.
>
> Best wish,
> Wenjun Ruan
>

Reply via email to