use of org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi in project load-balancer by RestComm.
the class NodeGracefulShutdownRmiTest method setUp.
@Before
public void setUp() throws Exception {
shootist1 = new Shootist(ListeningPoint.TCP, 5060, 5033);
shootist2 = new Shootist(ListeningPoint.TCP, 5060, 5034);
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getExternalLegConfiguration().setUdpPort(5060);
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(UserBasedAlgorithm.class.getCanonicalName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setSipHeaderAffinityKey("To");
HeartbeatConfig heartbeatConfig = new HeartbeatConfigRmi();
lbConfig.setHeartbeatConfiguration(heartbeatConfig);
balancer.start(lbConfig);
for (int q = 0; q < servers.length; q++) {
servers[q] = new AppServerWithRmi("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPoint.TCP);
servers[q].start();
}
Thread.sleep(2000);
}
use of org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi in project load-balancer by RestComm.
the class TcpWorstCaseAffinityTest method setUp.
@Before
public void setUp() throws Exception {
shootist = new Shootist(ListeningPoint.TCP, 5060);
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(WorstCaseUdpTestAffinityAlgorithm.class.getName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setEarlyDialogWorstCase(true);
HeartbeatConfig rmiConfig = new HeartbeatConfigRmi();
lbConfig.setHeartbeatConfiguration(rmiConfig);
balancer.start(lbConfig);
for (int q = 0; q < servers.length; q++) {
servers[q] = new AppServerWithRmi("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPoint.TCP);
servers[q].start();
}
Thread.sleep(5000);
}
Aggregations