@Override
        public void run() {
            try {
                byte compressionType = rpcRequest.parameters().get(0).asInt8();
                if (compressionType != 0) {
                    rpcRequest.setError(ErrorCode.METHOD_FAILED, "Invalid compression type: " + compressionType);
                    rpcRequest.returnRequest();
                    return;
                }
                int uncompressedSize = rpcRequest.parameters().get(1).asInt32();
                byte[] logRequestPayload = rpcRequest.parameters().get(2).asData();
                if (uncompressedSize != logRequestPayload.length) {
                    rpcRequest.setError(ErrorCode.METHOD_FAILED, String.format("Invalid uncompressed size: got %d while data is of size %d ", uncompressedSize, logRequestPayload.length));
                    rpcRequest.returnRequest();
                    return;
                }
                logDispatcher.handle(ProtobufSerialization.fromLogRequest(logRequestPayload));
                logDispatcher.flush();
                rpcRequest.returnValues().add(new Int8Value((byte)0));
                byte[] responsePayload = ProtobufSerialization.toLogResponse();
                rpcRequest.returnValues().add(new Int32Value(responsePayload.length));
                rpcRequest.returnValues().add(new DataValue(responsePayload));
                rpcRequest.returnRequest();
            } catch (Exception e) {
                String errorMessage = "Failed to handle log request: " + e.getMessage();
                log.log(Level.WARNING, e, () -> errorMessage);
                rpcRequest.setError(ErrorCode.METHOD_FAILED, errorMessage);
                rpcRequest.returnRequest();
            }
        }
RPC method that archives incoming log messages

@author bjorncs
logserver/src/main/java/ai/vespa/logserver/protocol/ArchiveLogMessagesMethod.java