2012-01-04 61 views
2

想知道Netty是否有任何關於如何創建高可用性應用程序的示例,Netty客戶機將在服務器發生故障時使用備份服務器。Netty高可用性羣集

+0

定義「失敗」,定義您所需的保證。 – 2012-01-04 22:50:21

回答

2

如果你想在客戶端和服務器的高可用性和輕鬆你的代碼來管理連接狀態,對Akka Remote Actor API看看它使用Netty進行底層通信。

+0

Akka Remote Actor API鏈接已損壞 – ruruskyi 2015-04-06 18:39:44

+0

http://doc.akka.io/docs/akka/1.3.1/scala/remote-actors.html – ruruskyi 2015-04-06 18:41:19

0

沒有這方面的例子。但我認爲它非常直截了當。您需要有一個連接到遠程主機的不同「通道」池。在做這樣的事情:

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

希望它可以幫助..