Search in sources :

Example 1 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class ActiveStandbyHttpTest method initialization.

@BeforeClass
public static void initialization() {
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(ActiveStandbyAlgorithm.class.getName());
    balancerRunner.start(lbConfig);
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < numberNodes; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : ActiveStandbyAlgorithm(org.mobicents.tools.sip.balancer.ActiveStandbyAlgorithm) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 2 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class ChunkedRequestTest method initialization.

@BeforeClass
public static void initialization() {
    executor = Executors.newCachedThreadPool();
    server = new HttpServer(8080, 4444, 2222);
    server.start();
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    balancerRunner.start(lbConfig);
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 3 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpBadResponseNodeRemovalTest method initialization.

@BeforeClass
public static void initialization() {
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < numberNodes; i++) {
        String id = null;
        if (i == 0)
            id = "ID1f2a2222772f4195948d040a2ccc648c";
        else
            id = "ID1f2a2222772f4195948d040a2ccc648" + i;
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, id, 2222 + i);
        if (i == 0)
            serverArray[i].setBadSever(true);
        serverArray[i].start();
    }
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    lbConfig.getHttpConfiguration().setRequestCheckPattern("(/Accounts/)");
    balancerRunner.start(lbConfig);
    try {
        Thread.sleep(1000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 4 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpBalancerWithHttpServerTest method initialization.

@BeforeClass
public static void initialization() {
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    balancerRunner.start(lbConfig);
    serverArray = new HttpServer[numberNodes];
    for (int i = 0; i < numberNodes; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Example 5 with LoadBalancerConfiguration

use of org.mobicents.tools.configuration.LoadBalancerConfiguration in project load-balancer by RestComm.

the class HttpNodeRemovalTest method initialization.

@BeforeClass
public static void initialization() {
    serverArray = new HttpServer[numberNodes];
    balancerRunner = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
    lbConfig.getSipConfiguration().getInternalLegConfiguration().setTcpPort(5065);
    lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(5060);
    balancerRunner.start(lbConfig);
    for (int i = 0; i < numberNodes; i++) {
        serverArray[i] = new HttpServer(7080 + i, 4444 + i, 2222 + i);
        serverArray[i].start();
        Helper.sleep(1000);
    }
    Helper.sleep(5000);
}
Also used : BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) BeforeClass(org.junit.BeforeClass)

Aggregations

LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)64 BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)50 ListeningPoint (javax.sip.ListeningPoint)28 Shootist (org.mobicents.tools.sip.balancer.operation.Shootist)28 Before (org.junit.Before)26 AppServer (org.mobicents.tools.sip.balancer.AppServer)24 BeforeClass (org.junit.BeforeClass)15 WorstCaseUdpTestAffinityAlgorithm (org.mobicents.tools.sip.balancer.WorstCaseUdpTestAffinityAlgorithm)8 ArrayList (java.util.ArrayList)7 UserBasedAlgorithm (org.mobicents.tools.sip.balancer.UserBasedAlgorithm)6 Test (org.junit.Test)5 HeartbeatConfigHttp (org.mobicents.tools.heartbeat.impl.HeartbeatConfigHttp)5 HeaderConsistentHashBalancerAlgorithm (org.mobicents.tools.sip.balancer.HeaderConsistentHashBalancerAlgorithm)5 SinglePointTest (org.mobicents.tools.sip.balancer.SinglePointTest)4 SmppToNodeSubmitToAllAlgorithm (org.mobicents.tools.smpp.multiplexer.SmppToNodeSubmitToAllAlgorithm)4 DefaultSmppServer (com.cloudhopper.smpp.impl.DefaultSmppServer)3 SmppChannelException (com.cloudhopper.smpp.type.SmppChannelException)3 CongestionControlMessageValve (org.mobicents.ext.javax.sip.congestion.CongestionControlMessageValve)2 HeartbeatConfig (org.mobicents.tools.heartbeat.api.HeartbeatConfig)2 Node (org.mobicents.tools.heartbeat.api.Node)2