use of org.mobicents.tools.heartbeat.packets.SwitchoverRequestPacket in project load-balancer by RestComm.
the class Client method switchover.
@Override
public void switchover(String fromJvmRoute, String toJvmRoute) {
Packet packet = new SwitchoverRequestPacket(fromJvmRoute, toJvmRoute);
ClientBootstrap clientBootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(executor, executor));
clientBootstrap.setPipelineFactory(new ClientPipelineFactory(clientListener));
ChannelFuture future = clientBootstrap.connect(new InetSocketAddress(lbAddress, lbPort));
future.awaitUninterruptibly();
future.getChannel().write(createRequest(Protocol.SWITCHOVER, packet));
}
Aggregations