Monitoring available Diffusion servers from your load balancer
To route your client connections most effectively, your load balancer must know which Diffusion™ servers are available to accept connections.
- Implement a custom monitor using a scripting language that is supported by
your load balancer.
For example, create a custom Diffusion client that connects and subscribes to a status topic.
This is the most effective way of determine availability as can check the connector used by your client applications.
- Use a TCP probe against the client connector.
A TCP probe checks whether the Diffusion server is able to accept new connections without doing any processing.
If your load balancer's TCP probe does not complete the full 3-way handshake and instead responds with a TCP reset after the server acks the probe, you might see IO exceptions on the the Diffusion server. You can use the ignore-error-from element in the Connectors.xml configuration file to tell Diffusion to ignore these errors.
- Use an HTTP probe against the built-in web
server. This has the advantage of being simple; most system administrators are familiar with HTTP requests. In the simplest case, a GET request can be made against the root context of the web server, for example:
GET / HTTP/1.0\r\n
However, this only tests the availability of the Diffusion server as a whole, and not the applications within it. - Implement an http-service on your Diffusion servers.
This service can query the state of the topic tree or any publishers, and return availability on receipt of a GET request.