use of org.monkey.mmq.core.distributed.raft.processor.MmqReadRequestProcessor in project mmqtt by MrHKing.
the class JRaftUtils method initRpcServer.
public static RpcServer initRpcServer(JRaftServer server, PeerId peerId) {
// GrpcRaftRpcFactory raftRpcFactory = (GrpcRaftRpcFactory) RpcFactoryHelper.rpcFactory();
// raftRpcFactory.registerProtobufSerializer(Log.class.getName(), Log.getDefaultInstance());
// raftRpcFactory.registerProtobufSerializer(GetRequest.class.getName(), GetRequest.getDefaultInstance());
// raftRpcFactory.registerProtobufSerializer(WriteRequest.class.getName(), WriteRequest.getDefaultInstance());
// raftRpcFactory.registerProtobufSerializer(ReadRequest.class.getName(), ReadRequest.getDefaultInstance());
// raftRpcFactory.registerProtobufSerializer(Response.class.getName(), Response.getDefaultInstance());
//
// MarshallerRegistry registry = raftRpcFactory.getMarshallerRegistry();
// registry.registerResponseInstance(Log.class.getName(), Response.getDefaultInstance());
// registry.registerResponseInstance(GetRequest.class.getName(), Response.getDefaultInstance());
//
// registry.registerResponseInstance(WriteRequest.class.getName(), Response.getDefaultInstance());
// registry.registerResponseInstance(ReadRequest.class.getName(), Response.getDefaultInstance());
final RpcServer rpcServer = RaftRpcServerFactory.createRaftRpcServer(peerId.getEndpoint());
// RaftRpcServerFactory.addRaftRequestProcessors(rpcServer, RaftExecutor.getRaftCoreExecutor(),
// RaftExecutor.getRaftCliServiceExecutor());
// Deprecated
rpcServer.registerProcessor(new MmqLogProcessor(server, SerializeFactory.getDefault()));
// Deprecated
rpcServer.registerProcessor(new MmqGetRequestProcessor(server, SerializeFactory.getDefault()));
rpcServer.registerProcessor(new MmqWriteRequestProcessor(server, SerializeFactory.getDefault()));
rpcServer.registerProcessor(new MmqReadRequestProcessor(server, SerializeFactory.getDefault()));
return rpcServer;
}
Aggregations