Search in sources :

Example 1 with HeartbeatConfigRmi

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

Example 2 with HeartbeatConfigRmi

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);
}
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)2 Before (org.junit.Before)2 LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)2 HeartbeatConfig (org.mobicents.tools.heartbeat.api.HeartbeatConfig)2 HeartbeatConfigRmi (org.mobicents.tools.heartbeat.rmi.HeartbeatConfigRmi)2 BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)2 Shootist (org.mobicents.tools.sip.balancer.operation.Shootist)2 AppServerWithRmi (org.mobicents.tools.sip.balancer.AppServerWithRmi)1 WorstCaseUdpTestAffinityAlgorithm (org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm)1