不知道Netty是否有任何示例说明如何创建一个高可用性应用程序,以便netty客户机在实时服务器发生故障时使用备份服务器。
发布于 2012-01-05 04:21:49
如果您想让客户端和服务器高度可用,并通过您的代码轻松地管理连接状态,那么可以看看Akka Remote Actor API,它使用Netty进行底层通信。
发布于 2012-01-05 03:08:07
没有这样的例子。但我认为这是非常直接的。您需要有一个连接到远程主机的不同“通道”池。他们这样做:
channel.write(msg).addListener() {
public void operationComplete(ChannelFuture future) {
if (!future.isSuccess) {
... // get next channel from the pool and try the write there etc..
}
}
}希望能有所帮助..。
https://stackoverflow.com/questions/8725228
复制相似问题