Skip to content

Commit ecc0e4e

Browse files
Updates gRPC proto - dapr v1.10 release (#88)
* updates grpc proto for dapr v1.10 release Signed-off-by: Roberto J Rojas <[email protected]> * updates dependencies to most recent Signed-off-by: Roberto J Rojas <[email protected]> --------- Signed-off-by: Roberto J Rojas <[email protected]>
1 parent b682ce7 commit ecc0e4e

File tree

5 files changed

+243
-10
lines changed

5 files changed

+243
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dapr"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
authors = ["dapr.io"]
55
edition = "2021"
66
license-file = "LICENSE"

dapr/proto/common/v1/common.proto

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ message InvokeRequest {
6060
// Required. method is a method name which will be invoked by caller.
6161
string method = 1;
6262

63-
// Required. Bytes value or Protobuf message which caller sent.
63+
// Required in unary RPCs. Bytes value or Protobuf message which caller sent.
6464
// Dapr treats Any.value as bytes type if Any.type_url is unset.
6565
google.protobuf.Any data = 2;
6666

@@ -82,13 +82,26 @@ message InvokeRequest {
8282
// This message is used in InvokeService of Dapr gRPC Service and OnInvoke
8383
// of AppCallback gRPC service.
8484
message InvokeResponse {
85-
// Required. The content body of InvokeService response.
85+
// Required in unary RPCs. The content body of InvokeService response.
8686
google.protobuf.Any data = 1;
8787

8888
// Required. The type of data content.
8989
string content_type = 2;
9090
}
9191

92+
// Chunk of data sent in a streaming request or response.
93+
// This is used in requests including InternalInvokeRequestStream.
94+
message StreamPayload {
95+
// Data sent in the chunk.
96+
// The amount of data included in each chunk is up to the discretion of the sender, and can be empty.
97+
// Additionally, the amount of data doesn't need to be fixed and subsequent messages can send more, or less, data.
98+
// Receivers must not make assumptions about the number of bytes they'll receive in each chunk.
99+
bytes data = 1;
100+
101+
// Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent.
102+
uint32 seq = 2;
103+
}
104+
92105
// StateItem represents state key, value, and additional options to save state.
93106
message StateItem {
94107
// Required. The state key

dapr/proto/runtime/v1/appcallback.proto

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package dapr.proto.runtime.v1;
1717

1818
import "google/protobuf/empty.proto";
1919
import "dapr/proto/common/v1/common.proto";
20+
import "google/protobuf/struct.proto";
2021

2122
option csharp_namespace = "Dapr.AppCallback.Autogen.Grpc.v1";
2223
option java_outer_classname = "DaprAppCallbackProtos";
@@ -53,6 +54,13 @@ service AppCallbackHealthCheck {
5354
rpc HealthCheck(google.protobuf.Empty) returns (HealthCheckResponse) {}
5455
}
5556

57+
// AppCallbackAlpha V1 is an optional extension to AppCallback V1 to opt
58+
// for Alpha RPCs.
59+
service AppCallbackAlpha {
60+
// Subscribes bulk events from Pubsub
61+
rpc OnBulkTopicEventAlpha1(TopicEventBulkRequest) returns (TopicEventBulkResponse) {}
62+
}
63+
5664
// TopicEventRequest message is compatible with CloudEvent spec v1.0
5765
// https://github.com/cloudevents/spec/blob/v1.0/spec.md
5866
message TopicEventRequest {
@@ -89,6 +97,9 @@ message TopicEventRequest {
8997
// The matching path from TopicSubscription/routes (if specified) for this event.
9098
// This value is used by OnTopicEvent to "switch" inside the handler.
9199
string path = 9;
100+
101+
// The map of additional custom properties to be sent to the app. These are considered to be cloud event extensions.
102+
google.protobuf.Struct extensions = 10;
92103
}
93104

94105
// TopicEventResponse is response from app on published message
@@ -107,6 +118,90 @@ message TopicEventResponse {
107118
TopicEventResponseStatus status = 1;
108119
}
109120

121+
// TopicEventCERequest message is compatible with CloudEvent spec v1.0
122+
message TopicEventCERequest {
123+
// The unique identifier of this cloud event.
124+
string id = 1;
125+
126+
// source identifies the context in which an event happened.
127+
string source = 2;
128+
129+
// The type of event related to the originating occurrence.
130+
string type = 3;
131+
132+
// The version of the CloudEvents specification.
133+
string spec_version = 4;
134+
135+
// The content type of data value.
136+
string data_content_type = 5;
137+
138+
// The content of the event.
139+
bytes data = 6;
140+
141+
// Custom attributes which includes cloud event extensions.
142+
google.protobuf.Struct extensions = 7;
143+
}
144+
145+
// TopicEventBulkRequestEntry represents a single message inside a bulk request
146+
message TopicEventBulkRequestEntry {
147+
// Unique identifier for the message.
148+
string entry_id = 1;
149+
150+
// The content of the event.
151+
oneof event {
152+
bytes bytes = 2;
153+
TopicEventCERequest cloud_event = 3;
154+
}
155+
156+
// content type of the event contained.
157+
string content_type = 4;
158+
159+
// The metadata associated with the event.
160+
map<string,string> metadata = 5;
161+
}
162+
163+
// TopicEventBulkRequest represents request for bulk message
164+
message TopicEventBulkRequest {
165+
// Unique identifier for the bulk request.
166+
string id = 1;
167+
168+
// The list of items inside this bulk request.
169+
repeated TopicEventBulkRequestEntry entries = 2;
170+
171+
// The metadata associated with the this bulk request.
172+
map<string,string> metadata = 3;
173+
174+
// The pubsub topic which publisher sent to.
175+
string topic = 4;
176+
177+
// The name of the pubsub the publisher sent to.
178+
string pubsub_name = 5;
179+
180+
// The type of event related to the originating occurrence.
181+
string type = 6;
182+
183+
// The matching path from TopicSubscription/routes (if specified) for this event.
184+
// This value is used by OnTopicEvent to "switch" inside the handler.
185+
string path = 7;
186+
}
187+
188+
// TopicEventBulkResponseEntry Represents single response, as part of TopicEventBulkResponse, to be
189+
// sent by subscibed App for the corresponding single message during bulk subscribe
190+
message TopicEventBulkResponseEntry {
191+
// Unique identifier associated the message.
192+
string entry_id = 1;
193+
194+
// The status of the response.
195+
TopicEventResponse.TopicEventResponseStatus status = 2;
196+
}
197+
198+
// AppBulkResponse is response from app on published message
199+
message TopicEventBulkResponse {
200+
201+
// The list of all responses for the bulk request.
202+
repeated TopicEventBulkResponseEntry statuses = 1;
203+
}
204+
110205
// BindingEventRequest represents input bindings event.
111206
message BindingEventRequest {
112207
// Required. The name of the input binding component.
@@ -170,6 +265,9 @@ message TopicSubscription {
170265

171266
// The optional dead letter queue for this topic to send events to.
172267
string dead_letter_topic = 6;
268+
269+
// The optional bulk subscribe settings for this topic.
270+
BulkSubscribeConfig bulk_subscribe = 7;
173271
}
174272

175273
message TopicRoutes {
@@ -192,6 +290,18 @@ message TopicRule {
192290
string path = 2;
193291
}
194292

293+
// BulkSubscribeConfig is the message to pass settings for bulk subscribe
294+
message BulkSubscribeConfig {
295+
// Required. Flag to enable/disable bulk subscribe
296+
bool enabled = 1;
297+
298+
// Optional. Max number of messages to be sent in a single bulk request
299+
int32 max_messages_count = 2;
300+
301+
// Optional. Max duration to wait for messages to be sent in a single bulk request
302+
int32 max_await_duration_ms = 3;
303+
}
304+
195305
// ListInputBindingsResponse is the message including the list of input bindings.
196306
message ListInputBindingsResponse {
197307
// The list of input bindings.

dapr/proto/runtime/v1/dapr.proto

Lines changed: 115 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ option go_package = "github.com/dapr/dapr/pkg/proto/runtime/v1;runtime";
2727
// Dapr service provides APIs to user application to access Dapr building blocks.
2828
service Dapr {
2929
// Invokes a method on a remote Dapr app.
30+
// Deprecated: Use proxy mode service invocation instead.
3031
rpc InvokeService(InvokeServiceRequest) returns (common.v1.InvokeResponse) {}
3132

3233
// Gets the state for a specific key.
@@ -53,6 +54,9 @@ service Dapr {
5354
// Publishes events to the specific topic.
5455
rpc PublishEvent(PublishEventRequest) returns (google.protobuf.Empty) {}
5556

57+
// Bulk Publishes multiple events to the specified topic.
58+
rpc BulkPublishEventAlpha1(BulkPublishRequest) returns (BulkPublishResponse) {}
59+
5660
// Invokes binding data to specific output bindings
5761
rpc InvokeBinding(InvokeBindingRequest) returns (InvokeBindingResponse) {}
5862

@@ -107,6 +111,15 @@ service Dapr {
107111
// Sets value in extended metadata of the sidecar
108112
rpc SetMetadata (SetMetadataRequest) returns (google.protobuf.Empty) {}
109113

114+
// Start Workflow
115+
rpc StartWorkflowAlpha1 (StartWorkflowRequest) returns (WorkflowReference) {}
116+
117+
// Get Workflow details
118+
rpc GetWorkflowAlpha1 (GetWorkflowRequest) returns (GetWorkflowResponse) {}
119+
120+
// Terminate Workflow
121+
rpc TerminateWorkflowAlpha1 (TerminateWorkflowRequest) returns (TerminateWorkflowResponse) {}
122+
110123
// Shutdown the sidecar
111124
rpc Shutdown (google.protobuf.Empty) returns (google.protobuf.Empty) {}
112125
}
@@ -287,6 +300,53 @@ message PublishEventRequest {
287300
map<string, string> metadata = 5;
288301
}
289302

303+
// BulkPublishRequest is the message to bulk publish events to pubsub topic
304+
message BulkPublishRequest {
305+
// The name of the pubsub component
306+
string pubsub_name = 1;
307+
308+
// The pubsub topic
309+
string topic = 2;
310+
311+
// The entries which contain the individual events and associated details to be published
312+
repeated BulkPublishRequestEntry entries = 3;
313+
314+
// The request level metadata passing to to the pubsub components
315+
map<string, string> metadata = 4;
316+
}
317+
318+
// BulkPublishRequestEntry is the message containing the event to be bulk published
319+
message BulkPublishRequestEntry {
320+
// The request scoped unique ID referring to this message. Used to map status in response
321+
string entry_id = 1;
322+
323+
// The event which will be pulished to the topic
324+
bytes event = 2;
325+
326+
// The content type for the event
327+
string content_type = 3;
328+
329+
// The event level metadata passing to the pubsub component
330+
map<string, string> metadata = 4;
331+
}
332+
333+
// BulkPublishResponse is the message returned from a BulkPublishEvent call
334+
message BulkPublishResponse {
335+
// The entries for different events that failed publish in the BulkPublishEvent call
336+
repeated BulkPublishResponseFailedEntry failedEntries = 1;
337+
}
338+
339+
// BulkPublishResponseFailedEntry is the message containing the entryID and error of a failed event in BulkPublishEvent call
340+
message BulkPublishResponseFailedEntry {
341+
342+
// The response scoped unique ID referring to this message
343+
string entry_id = 1;
344+
345+
// The error message if any on failure
346+
string error = 2;
347+
}
348+
349+
290350
// InvokeBindingRequest is the message to send data to output bindings
291351
message InvokeBindingRequest {
292352
// The name of the output binding to invoke.
@@ -296,10 +356,10 @@ message InvokeBindingRequest {
296356
bytes data = 2;
297357

298358
// The metadata passing to output binding components
299-
//
359+
//
300360
// Common metadata property:
301-
// - ttlInSeconds : the time to live in seconds for the message.
302-
// If set in the binding definition will cause all messages to
361+
// - ttlInSeconds : the time to live in seconds for the message.
362+
// If set in the binding definition will cause all messages to
303363
// have a default time to live. The message ttl overrides any value
304364
// in the binding definition.
305365
map<string, string> metadata = 3;
@@ -362,7 +422,7 @@ message TransactionalStateOperation {
362422
// The type of operation to be executed
363423
string operationType = 1;
364424

365-
// State values to be operated on
425+
// State values to be operated on
366426
common.v1.StateItem request = 2;
367427
}
368428

@@ -469,6 +529,7 @@ message GetMetadataResponse {
469529
repeated ActiveActorsCount active_actors_count = 2;
470530
repeated RegisteredComponents registered_components = 3;
471531
map<string, string> extended_metadata = 4;
532+
repeated PubsubSubscription subscriptions = 5;
472533
}
473534

474535
message ActiveActorsCount {
@@ -483,6 +544,23 @@ message RegisteredComponents {
483544
repeated string capabilities = 4;
484545
}
485546

547+
message PubsubSubscription {
548+
string pubsub_name = 1;
549+
string topic = 2;
550+
map<string,string> metadata = 3;
551+
PubsubSubscriptionRules rules = 4;
552+
string dead_letter_topic = 5;
553+
}
554+
555+
message PubsubSubscriptionRules {
556+
repeated PubsubSubscriptionRule rules = 1;
557+
}
558+
559+
message PubsubSubscriptionRule {
560+
string match = 1;
561+
string path = 2;
562+
}
563+
486564
message SetMetadataRequest {
487565
string key = 1;
488566
string value = 2;
@@ -596,4 +674,36 @@ message UnlockResponse {
596674
}
597675

598676
Status status = 1;
599-
}
677+
}
678+
679+
message WorkflowReference {
680+
string instance_id = 1;
681+
}
682+
683+
message GetWorkflowRequest {
684+
string instance_id = 1;
685+
string workflow_type = 2;
686+
string workflow_component = 3;
687+
}
688+
689+
message GetWorkflowResponse {
690+
string instance_id = 1;
691+
int64 start_time = 2;
692+
map<string, string> metadata = 3;
693+
}
694+
695+
message StartWorkflowRequest {
696+
string instance_id = 1;
697+
string workflow_component = 2;
698+
string workflow_name = 3;
699+
map<string, string> options = 4;
700+
bytes input = 5;
701+
}
702+
703+
message TerminateWorkflowRequest {
704+
string instance_id = 1;
705+
string workflow_component = 2;
706+
}
707+
708+
message TerminateWorkflowResponse {
709+
}

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ impl From<TonicError> for Error {
2424

2525
impl From<TonicStatus> for Error {
2626
fn from(error: TonicStatus) -> Self {
27-
Error::GrpcError(GrpcError { status: error })
27+
Error::GrpcError(GrpcError { _status: error })
2828
}
2929
}
3030

3131
#[derive(Debug)]
3232
pub struct GrpcError {
33-
status: TonicStatus,
33+
_status: TonicStatus,
3434
}
3535

3636
impl Display for GrpcError {

0 commit comments

Comments
 (0)