@@ -44,28 +44,27 @@ message Header {
4444 optional SpanContext span_context = 7 ;
4545}
4646
47- message SpanContext {
48- map <string , string > fields = 1 ;
49- }
47+ message SpanContext { map <string , string > fields = 1 ; }
5048
5149// direction is defined from the lens of the connection initiator
5250enum ConnectionDirection {
5351 // By default, it's assumed this is a bidirectional connection to maintain
5452 // compatibility with v1.2
5553 ConnectionDirection_UNKNOWN = 0 ;
5654 // Connection is declared by initiator as bidirectional. Bidirectional
57- // connections are used to send and receive rpc and unary messages by both ends
58- // of the connection.
55+ // connections are used to send and receive rpc and unary messages by both
56+ // ends of the connection.
5957 BIDIRECTIONAL = 1 ;
6058 // Connection is declared by initiator that it's used by initiator to send rpc
61- // requests and unary messages to the peer (acceptor). The acceptor side should *not*
62- // use this connection to send requests back to us. Only servicing requests. This is
63- // a typical case for a server who wants to run a side dedicated connection to a peer
64- // or for a client session connecting to a server.
59+ // requests and unary messages to the peer (acceptor). The acceptor side
60+ // should *not* use this connection to send requests back to us. Only
61+ // servicing requests. This is a typical case for a server who wants to run a
62+ // side dedicated connection to a peer or for a client session connecting to a
63+ // server.
6564 FORWARD = 2 ;
66- // Connection is declared as a reverse connection by the initiator. A reverse connection
67- // is used to receive requests from peers. The acceptor can use this connection to send
68- // rpc requests to us.
65+ // Connection is declared as a reverse connection by the initiator. A reverse
66+ // connection is used to receive requests from peers. The acceptor can use
67+ // this connection to send rpc requests to us.
6968 //
7069 // This can be used to initiate connections to a remote node that doesn't have
7170 // network access to initiate connections back to us.
@@ -86,7 +85,7 @@ message Hello {
8685 // the purpose of this connection. Default is GENERAL.
8786 Swimlane swimlane = 6 ;
8887
89- // a unique fingerprint for this cluster. It will be respected by the receiver
88+ // a unique fingerprint for this cluster. It will be respected by the receiver
9089 // if it was a non-zero value.
9190 uint64 cluster_fingerprint = 7 ;
9291}
@@ -96,9 +95,9 @@ message Welcome {
9695 restate.common.ProtocolVersion protocol_version = 2 ;
9796 // generational node id of sender
9897 restate.common.GenerationalNodeId my_node_id = 3 ;
99- // confirmation that this connection respects the direction state in the Hello message.
100- // if this is unset (UNKNOWN) then it's equivalent to if the Hello message had `BIDIRECTIONAL`
101- // for backward compatibility.
98+ // confirmation that this connection respects the direction state in the Hello
99+ // message. if this is unset (UNKNOWN) then it's equivalent to if the Hello
100+ // message had `BIDIRECTIONAL` for backward compatibility.
102101 ConnectionDirection direction_ack = 4 ;
103102}
104103
@@ -151,6 +150,8 @@ message Datagram {
151150 WatchUpdate watch_update = 4 ;
152151 Ping ping = 5 ;
153152 Pong pong = 6 ;
153+ StreamInbound stream_inbound = 7 ;
154+ StreamOutbound stream_outbound = 8 ;
154155
155156 // one way message
156157 Unary unary = 100 ;
@@ -172,9 +173,9 @@ message Watch {
172173message WatchUpdate {
173174 enum Start {
174175 // Receiver will not respond to this request for unknown reason
175- // This is often returned when the receiver sent us a status that we don't recognize
176- // in this protocol version.
177- // The request *might* have been processed
176+ // This is often returned when the receiver sent us a status that we don't
177+ // recognize in this protocol version. The request *might* have been
178+ // processed
178179 Start_UNKNOWN = 0 ;
179180 // Service identifier was not registered on this node
180181 // Request has not been processed
@@ -201,9 +202,9 @@ message WatchUpdate {
201202
202203 enum End {
203204 // Receiver will not respond to this request for unknown reason
204- // This is often returned when the receiver sent us a status that we don't recognize
205- // in this protocol version.
206- // The request *might* have been processed
205+ // This is often returned when the receiver sent us a status that we don't
206+ // recognize in this protocol version. The request *might* have been
207+ // processed
207208 End_UNKNOWN = 0 ;
208209 // Watch was cleanly stopped
209210 OK = 1 ;
@@ -231,9 +232,9 @@ message RpcCall {
231232message RpcReply {
232233 enum Status {
233234 // Receiver will not respond to this request for unknown reason
234- // This is often returned when the receiver sent us a status that we don't recognize
235- // in this protocol version.
236- // The request *might* have been processed
235+ // This is often returned when the receiver sent us a status that we don't
236+ // recognize in this protocol version. The request *might* have been
237+ // processed
237238 Status_UNKNOWN = 0 ;
238239 // Service identifier was not registered on this node
239240 // Request has not been processed
@@ -277,10 +278,66 @@ message Unary {
277278 bytes payload = 100 ;
278279}
279280
280- message Ping {
281- uint64 timestamp = 1 ;
281+ message Ping { uint64 timestamp = 1 ; }
282+
283+ message Pong { uint64 timestamp = 1 ; }
284+
285+ enum StreamStatus {
286+ // Receiver will not respond to this request for unknown reason
287+ // This is often returned when the receiver sent us a status that we don't
288+ // recognize in this protocol version. The request *might* have been
289+ // processed
290+ StreamStatus_UNKNOWN = 0 ;
291+ // Service identifier was not registered on this node
292+ // Request has not been processed
293+ SERVICE_NOT_FOUND = 1 ;
294+ // Service has stopped processing requests
295+ // Request has not been processed
296+ SERVICE_STOPPED = 2 ;
297+ // Service is known but it has not started yet
298+ // Request has not been processed
299+ SERVICE_NOT_READY = 3 ;
300+ // Service is known but it didn't recognize the sort code
301+ // Request has not been processed
302+ SORT_CODE_NOT_FOUND = 4 ;
303+ // The received dropped the response handle
304+ // The request *might* have been processed
305+ STREAM_DROPPED = 5 ;
306+ // The received dropped the response handle
307+ // Channel has been closed
308+ STREAM_NOT_FOUND = 6 ;
309+ // Service did not process the request due to backpressure
310+ // Request has not been processed
311+ LOAD_SHEDDING = 7 ;
312+ // Message type was unrecognized by the receiver
313+ // Request has not been processed
314+ MESSAGE_UNRECOGNIZED = 8 ;
315+ // Channel with the same id is already open
316+ ALREADY_OPEN = 9 ;
282317}
283318
284- message Pong {
285- uint64 timestamp = 1 ;
319+ message StreamInbound {
320+
321+ message Open {
322+ restate.common.ServiceTag service = 1 ;
323+ // routing code of the target inbox if applicable, otherwise, defaults to 0.
324+ optional uint64 sort_code = 2 ;
325+ // the type-name of the unary message (variant in the service)
326+ string msg_type = 3 ;
327+ }
328+
329+ uint64 stream_id = 1 ;
330+ oneof body {
331+ StreamStatus status = 2 ;
332+ Open open = 3 ;
333+ bytes payload = 4 ;
334+ }
335+ }
336+
337+ message StreamOutbound {
338+ uint64 stream_id = 1 ;
339+ oneof body {
340+ StreamStatus status = 2 ;
341+ bytes payload = 4 ;
342+ }
286343}
0 commit comments