Netty High Availability Cluster

Satisfying whether Netty has any examples of how I can create a high-availability application, according to which the net client will use the backup server in case of server failure.

+2
source share
2 answers

If you want to make the client and server highly accessible and easily manage the state of connections by your code, check out the Akka Remote Actor API , which uses Netty for basic communication.

+2
source

There is no such example. But I think he is pretty straight forward. You must have a pool of different "channels" connected to remote hosts. Do something like this:

channel.write(msg).addListener() { public void operationComplete(ChannelFuture future) { if (!future.isSuccess) { ... // get next channel from the pool and try the write there etc.. } } } 

Hope this helps.

0
source

All Articles