Creating the Load Balancer

The startup rule function has to be provided. It creates and returns a load balancer that can be used to send messages to load balanced remote destinations.

Procedure

  1. Create the router TCP connection in a startup rule function.
    LoadBalancer.Router.createLoadBalancerTo(adhocConfigName);
  2. Send Event to the Receiver .
    Use this rule function as an event preprocessor. It sends an event to a remote receiver. The router agent does not have any destinations. The routing decision is made using the routing key.

    void send(Object loadBalancer , SimpleEvent event, String routingKey);

  3. Discard the Load Balancer.
    Put this rule function in a shutdown rule function.
    Object loadBalancer = Util.HashMap.remove(String mapID, String key);
    Util.HashMap.deleteMap(Object LoadBalancerReceiver);
  4. This rulefunction discards the load balancer.
    void discardLoadBalancer(Object loadBalancer);