use of com.alibaba.spring.boot.rsocket.broker.cluster.jsonrpc.JsonRpcRequest in project alibaba-rsocket-broker by alibaba.
the class RSocketBrokerManagerGossipImpl method onMessage.
@Override
public void onMessage(Message message) {
if (message.header("jsonrpc") != null) {
JsonRpcRequest request = message.data();
Message replyMessage = Message.builder().correlationId(message.correlationId()).data(onJsonRpcCall(request)).build();
this.monoCluster.flatMap(cluster -> cluster.send(message.sender(), replyMessage)).subscribe();
}
}
use of com.alibaba.spring.boot.rsocket.broker.cluster.jsonrpc.JsonRpcRequest in project alibaba-rsocket-broker by alibaba.
the class RSocketBrokerManagerGossipImpl method makeJsonRpcCall.
public Mono<JsonRpcResponse> makeJsonRpcCall(@NotNull Member member, @NotNull String methodName, @Nullable Object params) {
String uuid = UUID.randomUUID().toString();
Message jsonRpcMessage = Message.builder().correlationId(uuid).header("jsonrpc", "2.0").data(new JsonRpcRequest(methodName, params, uuid)).build();
return monoCluster.flatMap(cluster -> cluster.requestResponse(member, jsonRpcMessage)).map(Message::data);
}
Aggregations