All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rettypb.prettypb-rpc.0.3.3.source-code.protobuf-rpc-duplex.proto Maven / Gradle / Ivy

There is a newer version: 0.3.5
Show newest version
// Copyright (c) 2010 Peter Klauser

//
// TcpClient->TcpServer : ConnectRequest
// TcpServer->TcpClient : ConnectResponse
// 
// RpcClient->RpcServer : RpcRequest, RpcCancel, OobMessage
// RpcServer->RpcClient : RpcResponse, RpcError, OobResponse, OobMessage
//  remember TcpClient can be both RpcClient or RpcServer
//  and a TcpServer can be both RpcClient or RpcServer

option java_package = "net.dongliu.prettypb.rpc.protocol";

option java_outer_classname = "DuplexProtocol";

// This is default, but it's nice to be explicit
option optimize_for = SPEED;

option java_multiple_files = true;


message ConnectRequest {
    required int32 correlationId = 1;
    required string clientHostName = 2;
    required int32 clientPort = 3;
    required string clientPID = 4;
    optional bool compress = 5;
}

message ConnectResponse {
    required int32 correlationId = 1;
    optional string serverPID = 2;
    optional ConnectErrorCode errorCode = 3;
    optional bool compress = 4;
}

enum ConnectErrorCode {
    ALREADY_CONNECTED = 0; // Client with same name already connected.
}

message RpcRequest {
    required int32 correlationId = 1;
    required string serviceIdentifier = 2;
    required string methodIdentifier = 3;
    required bytes requestBytes = 4;
    optional int32 timeoutMs = 5;

    // added by Dong Liu
    // proto-rpc-pro has a issue do not consider the package of proto file. we add it here and
    // keep compatible with the origin proto-rpc-pro
    optional string service_package = 101;
}

message RpcResponse {
    required int32 correlationId = 1;
    required bytes responseBytes = 2;
}

message RpcError {
    required int32 correlationId = 1;
    required string errorMessage = 2;
}

message RpcCancel {
    required int32 correlationId = 1;
}

message OobResponse {
    required int32 correlationId = 1;
    required bytes messageBytes = 2;
}

message OobMessage {
    required bytes messageBytes = 1;
}

message WirePayload {
    optional ConnectRequest connectRequest = 1;
    optional ConnectResponse connectResponse = 2;
    optional RpcRequest rpcRequest = 3;
    optional RpcResponse rpcResponse = 4;
    optional RpcError rpcError = 5;
    optional RpcCancel rpcCancel = 6;

    optional OobResponse oobResponse = 7;
    // out of band responses from RPC server to client during
    // the processing of a RPC call

    optional OobMessage oobMessage = 8;
    // bidirectional message not related to any particular RPC call.

    optional OobMessage transparentMessage = 100;
    //Message just passed through the Pipeline and not touched.
    //Reduces need of extension handling for several of customization cases.

    extensions 1000 to max;
    // for wireprotocol customizations
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy