DarVar
DarVar

Reputation: 18124

Netty High Availability Cluster

Wondering if Netty has any examples of how I can create a high availability application whereby the netty client will use a backup server in case of live server failure.

Upvotes: 2

Views: 4376

Answers (2)

Jestan Nirojan
Jestan Nirojan

Reputation: 2486

If you want to make the client and server highly available and to manage the connections state by your code with ease, Have a look on Akka Remote Actor API which is using Netty for underlying communication .

Upvotes: 2

Norman Maurer
Norman Maurer

Reputation: 23557

There is no example of this. But I think its quite straight-forward. You need to have a pool of different "channels" that are connected to remote hosts. The 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 it helps..

Upvotes: 0

Related Questions