Search in sources :

Example 1 with AppServerWithRmi

use of org.mobicents.tools.sip.balancer.AppServerWithRmi 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);
}
Also used : HeartbeatConfig(org.mobicents.tools.heartbeat.api.HeartbeatConfig) HeartbeatConfigRmi(org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi) AppServerWithRmi(org.mobicents.tools.sip.balancer.AppServerWithRmi) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) Shootist(org.mobicents.tools.sip.balancer.operation.Shootist) WorstCaseUdpTestAffinityAlgorithm(org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm) ListeningPoint(javax.sip.ListeningPoint) Before(org.junit.Before)

Aggregations

ListeningPoint (javax.sip.ListeningPoint)1 Before (org.junit.Before)1 LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)1 HeartbeatConfig (org.mobicents.tools.heartbeat.api.HeartbeatConfig)1 HeartbeatConfigRmi (org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi)1 AppServerWithRmi (org.mobicents.tools.sip.balancer.AppServerWithRmi)1 BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)1 WorstCaseUdpTestAffinityAlgorithm (org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm)1 Shootist (org.mobicents.tools.sip.balancer.operation.Shootist)1