Extend logging in JsonRpcReader

This commit is contained in:
AsamK 2021-11-08 14:56:50 +01:00
parent e495afcff5
commit e7a4bc5ef1

View file

@ -41,13 +41,14 @@ public class JsonRpcReader {
JsonRpcMessage message = readMessage(); JsonRpcMessage message = readMessage();
if (message == null) break; if (message == null) break;
if (message instanceof JsonRpcRequest) { if (message instanceof final JsonRpcRequest jsonRpcRequest) {
final var response = handleRequest(requestHandler, (JsonRpcRequest) message); logger.debug("Received json rpc request, method: " + jsonRpcRequest.method);
final var response = handleRequest(requestHandler, jsonRpcRequest);
if (response != null) { if (response != null) {
jsonRpcSender.sendResponse(response); jsonRpcSender.sendResponse(response);
} }
} else if (message instanceof JsonRpcResponse) { } else if (message instanceof JsonRpcResponse jsonRpcResponse) {
responseHandler.accept((JsonRpcResponse) message); responseHandler.accept(jsonRpcResponse);
} else { } else {
final var responseList = ((JsonRpcBulkMessage) message).getMessages().stream().map(jsonNode -> { final var responseList = ((JsonRpcBulkMessage) message).getMessages().stream().map(jsonNode -> {
final JsonRpcRequest request; final JsonRpcRequest request;