@Override
	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
			throws Exception {
		final RedisRequest request = (RedisRequest) e.getMessage();
		if (request.canceled()) {
			return;
		}
		request.setClientChannel(e.getChannel());
		String command = request.getCommand().toUpperCase();
		switch (command) {
		case "PING":
			request.sendToClient(RedisReply.status("PONG"));
			break;
		case "QUIT":
			ChannelFuture future = request
					.sendToClient(RedisReply.status("OK"));
			if (future != null) {
				future.addListener(ChannelFutureListener.CLOSE);
			}
			break;
		case "VERBOSE": // a special command to enable/disable debugger
			Debugger.noisy = Boolean.valueOf(request.getKey());
		case "SELECT": // "select db" will have no effect
			request.sendToClient(RedisReply.status("OK"));
			break;
		default:
			String key = request.getKey();
			BackendServer server = dht.find(key);
			String name = server.getKey();

			pools.putIfAbsent(name, new ConnectionPool((BackendServer)server, bootstrap));
			ConnectionPool _pool = pools.get(name);
			_pool.handleRequest(request);
		}

	}