So I can create a plugin handle MOVED when using custom sharding.
eg.
`
public ProxyPluginResponse executeReply(ProxyReply reply) {
var redisReply = reply.getReply();
var command = reply.getCommand();
var context = command.getCommandContext();
var bid = context.getBid();
var bgroup = context.getBgroup();
if (redisReply instanceof ErrorReply) {
var error = ((ErrorReply) redisReply).getError();
if (error != null && error.startsWith("MOVED")) {
var alreadyContainsMoved = bgroup.contains(MOVED_IN_BGROUP);
if (!alreadyContainsMoved) {
var arr = error.split(" ");
var slot = Integer.parseInt(arr[1]);
var hostWithPort = arr[2];
updateOneSlotTargetHostIpWhenGetMoveErrorReply(bid, bgroup, slot, hostWithPort);
logger.info("Update moved slot {} to {} for bid: {}.", slot, hostWithPort, bid);
var bgroupAddMoved = MontCacheProxyRouteConfUpdater.MOVED_IN_BGROUP + bgroup;
var routeRewriteResult = new RouteRewriteResult(bid, bgroupAddMoved);
var response = new ProxyPluginResponse(false, true, routeRewriteResult);
return response;
}
}
}
return ProxyPluginResponse.SUCCESS;
}
So I can create a plugin handle MOVED when using custom sharding.
eg. ` public ProxyPluginResponse executeReply(ProxyReply reply) { var redisReply = reply.getReply(); var command = reply.getCommand(); var context = command.getCommandContext();
`