use of com.generallycloud.baseio.balance.router.HashedBalanceRouter in project baseio by generallycloud.
the class TestBalanceMain method main.
public static void main(String[] args) throws IOException {
BalanceServerBootStrap f = new BalanceServerBootStrap();
f.setBalanceProtocolFactory(new ProtobaseProtocolFactory());
f.setBalanceReverseProtocolFactory(new ProtobaseProtocolFactory());
f.setBalanceProtocolFactory(new ProtobaseProtocolFactory());
f.setBalanceReverseProtocolFactory(new ProtobaseProtocolFactory());
ServerConfiguration fc = new ServerConfiguration();
fc.setSERVER_PORT(8600);
ServerConfiguration frc = new ServerConfiguration();
frc.setSERVER_PORT(8800);
f.setFacadeExceptionCaughtHandle(new LoggerExceptionCaughtHandle());
f.setReverseExceptionCaughtHandle(new LoggerExceptionCaughtHandle());
f.setBalanceServerConfiguration(fc);
f.setBalanceReverseServerConfiguration(frc);
f.setFacadeInterceptor(new FacadeInterceptorImpl(500, 50000));
f.setBalanceRouter(new HashedBalanceRouter(10240));
// f.setBalanceRouter(new SimpleNextRouter());
f.startup();
}
Aggregations