Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 25 Load Balancer Configuration : Adhoc Load Balancer Configuration

Adhoc Load Balancer Configuration
This section provides guidelines to configure the router and receivers in an adhoc load balancer configuration.
Router Configuration
LoadBalancer.Router.* functions are used for the router side.
Create the Load Balancer
Use this rule function as a startup rule function. It creates and returns a load balancer that can be used to send messages to load balanced remote destinations. You create the router TCP connection in a startup rule function.

 
LoadBalancer.Router.createLoadBalancerTo(adhocConfigName);

 
Send Event to 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)

 
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 );

 
This rulefunction discards the load balancer.

 
void discardLoadBalancer(Object loadBalancer)

 
Receiver Configuration
 
LoadBalancer.Receiver.* functions are used for the receiver side.
Local Channel
Receiver needs a local channel. The port information is obtained like this:

 
int port = System.getSystemPropertyAsInt("receiver_localchnl_localdest_port", 34567);

 
Create a Receiver
Creates and returns a receiver object that receives messages from a router. Messages will be received from the router on the local channel and destination specified. Create the receiver TCP connection in a startup rule function.

 
Object LoadBalancer.Receiver.createTcpReceiverFor(String adhocConfigName)

 
Discard a Receiver
You discard the receiver in a shutdown rule function.

 
LoadBalancer.Receiver.discardReceiver(Object loadBalancedReceiver);

 
Receiver Membership Functions in Catalog
LoadBalancer.Receiver.Membership.isInFlux
Returns true if the loadbalancer node membership is in a state of change such as nodes joining and/or leaving currently or in the recent past.
LoadBalancer.Receiver.Membership.getRecentChangeAt
Returns the timestamp (1970 epoch milliseconds) at which the most recent membership change occurred.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved