Try PubSub+

High Availability client configuration properties to load balance from the client end

swamiswami Member Posts: 3

Hi All,
I have a question.
What are configuration properties are required to achieve High Availablity like load balancing from the client SDK's sides?

For examples: .NET ,Node js, Javascript, python, c etc...
the configuration, I mean reconnection strategies and auto-switch between servers.
can any one describe proper configuration is requires from the above client sides?

Comments

  • uherbstuherbst Member, Employee Posts: 18 Solace Employee

    Hi Swami,
    Just to get the wording correctly: "Load balancing" is a way to distribute publishing and consuming to multiple brokers to leverage the load on them. This is not the way Solace HA works.
    In Solace HA, you have a triplet of brokers (the 3rd is just a quorum, no application ever will connect to it), where one of the both messaging nodes is the active one and does all the work while the other one is synchronously synced with the active one, but has no application connections. In case the active broker goes down, the inactive one will detect that and takes over the role as active on. There will be no data loss, because the inactive one is synchronously synced and knows about all config, all messages and all message states.
    You can put a "load balancer" (like a F5, a haproxy, a nginx) in front of both messaging nodes. I put the term "load balancer" in parentheses, because that thing will not balance load, but choose always the correct active node. I know, everyone calls this a "load balancer" :-)

    So, your HA setup can include a load balancer or not - both is possible and both is fully supported.

    Case 1: No load balancer.
    In that case, your application has to know a list of connection details for 2 different brokers (the active one and the inactive one). The Solace API then connects to one after the other until a connection is successful.

    Case 2: With load balancer
    In that case, there is just one set of connection details - your application always connects to the load balancer. The load balancer forwards the connection to the active broker.
    If your broker is a Solace cloud instance, you have automatically configured a load balancer in front of the brokers.

    In both cases, you have to reconnect after connection failure - and one reason of connection failure is the outage of the active broker.

    https://docs.solace.com/Solace-PubSub-Messaging-APIs/API-Developer-Guide/Configuring-Connection-T.htm
    lists the connect and retry parameters
    Solace' recommendation for most setups is:

    • connect retries: 1
    • reconnect retries: 20
    • reconnect retry wait: 3,000 ms
    • connect retries per host: 5

    https://docs.solace.com/Solace-PubSub-Messaging-APIs/API-Developer-Guide/Configuring-Connection-T.htm#Sample shows an example, how to do that.

    Hopefully that answers your question.
    Uli

Sign In or Register to comment.