Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/itests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,18 @@ jobs:
install-version: '7.0.x'
env:
NUPKG_OUTDIR: bin/Release/nugets
GOVER: 1.19
GOVER: 1.20.3
GOOS: linux
GOARCH: amd64
GOPROXY: https://proxy.golang.org
DAPR_CLI_VER: 1.9.1
DAPR_RUNTIME_VER: 1.9.5
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/3dacfb672d55f1436c249057aaebbe597e1066f3/install/install.sh
DAPR_CLI_REF: ''
DAPR_REF: '82e097134cdc7494c5c3be71bf80f7904d6db9ea'
DAPR_REF: 'dbeea96710d38d08dcc5aaf6807914a7d697bed4'
steps:
- name: Set up Dapr CLI
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
- name: Set up Go ${{ env.GOVER }}
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Checkout Dapr CLI repo to override dapr command.
uses: actions/checkout@v2
if: env.DAPR_CLI_REF != ''
Expand All @@ -72,6 +67,16 @@ jobs:
repository: dapr/dapr
ref: ${{ env.DAPR_REF }}
path: dapr
- name: Set up Go from dapr/go.mod
if: env.DAPR_REF != ''
uses: actions/setup-go@v3
with:
go-version-file: "dapr/go.mod"
- name: Set up Go from cli/go.mod
if: env.DAPR_REF == '' && env.DAPR_CLI_REF != ''
uses: actions/setup-go@v3
with:
go-version-file: "cli/go.mod"
- name: Build and override dapr cli with referenced commit.
if: env.DAPR_CLI_REF != ''
run: |
Expand Down
10 changes: 5 additions & 5 deletions src/Dapr.Client/DaprClientGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ public async override Task<GetConfigurationResponse> GetConfiguration(
Autogenerated.GetConfigurationResponse response = new Autogenerated.GetConfigurationResponse();
try
{
response = await client.GetConfigurationAlpha1Async(request, options);
response = await client.GetConfigurationAsync(request, options);
}
catch (RpcException ex)
{
Expand Down Expand Up @@ -1358,7 +1358,7 @@ public override Task<SubscribeConfigurationResponse> SubscribeConfiguration(
}

var options = CreateCallOptions(headers: null, cancellationToken: cancellationToken);
return Task.FromResult(new SubscribeConfigurationResponse(new DaprSubscribeConfigurationSource(client.SubscribeConfigurationAlpha1(request, options))));
return Task.FromResult(new SubscribeConfigurationResponse(new DaprSubscribeConfigurationSource(client.SubscribeConfiguration(request, options))));
}

[Obsolete]
Expand All @@ -1377,7 +1377,7 @@ public override async Task<UnsubscribeConfigurationResponse> UnsubscribeConfigur
};

var options = CreateCallOptions(headers: null, cancellationToken);
var resp = await client.UnsubscribeConfigurationAlpha1Async(request, options);
var resp = await client.UnsubscribeConfigurationAsync(request, options);
return new UnsubscribeConfigurationResponse(resp.Ok, resp.Message);
}
#endregion
Expand Down Expand Up @@ -1526,7 +1526,7 @@ public async override Task<GetWorkflowResponse> GetWorkflowAsync(
{
InstanceId = instanceId,
WorkflowComponent = workflowComponent,
WorkflowType = workflowName //TODO: Change 'WorkflowType' to 'WorkflowName' once changes go through dapr/dapr
WorkflowName = workflowName
Comment thread
halspang marked this conversation as resolved.
};

try
Expand Down Expand Up @@ -1554,7 +1554,7 @@ public async override Task TerminateWorkflowAsync(
ArgumentVerifier.ThrowIfNullOrEmpty(instanceId, nameof(instanceId));
ArgumentVerifier.ThrowIfNullOrEmpty(workflowComponent, nameof(workflowComponent));

var request = new Autogenerated.TerminateWorkflowRequest()
var request = new Autogenerated.WorkflowActivityRequest()
{
InstanceId = instanceId,
WorkflowComponent = workflowComponent
Expand Down
71 changes: 15 additions & 56 deletions src/Dapr.Client/Protos/dapr/proto/common/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ message InvokeRequest {
// Required. method is a method name which will be invoked by caller.
string method = 1;

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

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

// Required. The type of data content.
string content_type = 2;
}

// Chunk of data sent in a streaming request or response.
// This is used in requests including InternalInvokeRequestStream.
message StreamPayload {
// Data sent in the chunk.
// The amount of data included in each chunk is up to the discretion of the sender, and can be empty.
// Additionally, the amount of data doesn't need to be fixed and subsequent messages can send more, or less, data.
// Receivers must not make assumptions about the number of bytes they'll receive in each chunk.
bytes data = 1;

// Sequence number. This is a counter that starts from 0 and increments by 1 on each chunk sent.
uint64 seq = 2;
}

// StateItem represents state key, value, and additional options to save state.
message StateItem {
// Required. The state key
Expand Down Expand Up @@ -134,60 +147,6 @@ message StateOptions {
StateConsistency consistency = 2;
}

// TopicSubscription represents topic and metadata.
message TopicSubscription {
// Required. The name of the pubsub containing the topic below to subscribe to.
string pubsub_name = 1;

// Required. The name of topic which will be subscribed
string topic = 2;

// The optional properties used for this topic's subscription e.g. session id
map<string,string> metadata = 3;

// The optional routing rules to match against. In the gRPC interface, OnTopicEvent
// is still invoked but the matching path is sent in the TopicEventRequest.
TopicRoutes routes = 5;

// The optional dead letter queue for this topic to send events to.
string dead_letter_topic = 6;

// The optional bulk subscribe settings for this topic.
BulkSubscribeConfig bulk_subscribe = 7;
}

message TopicRoutes {
// The list of rules for this topic.
repeated TopicRule rules = 1;

// The default path for this topic.
string default = 2;
}

// BulkSubscribeConfig is the message to pass settings for bulk subscribe
message BulkSubscribeConfig {
// Required. Flag to enable/disable bulk subscribe
bool enabled = 1;

// Optional. Max number of messages to be sent in a single bulk request
int32 max_messages_count = 2;

// Optional. Max duration to wait for messages to be sent in a single bulk request
int32 max_await_duration_ms = 3;
}

message TopicRule {
// The optional CEL expression used to match the event.
// If the match is not specified, then the route is considered
// the default.
string match = 1;

// The path used to identify matches for this subscription.
// This value is passed in TopicEventRequest and used by OnTopicEvent to "switch"
// inside the handler.
string path = 2;
}

// ConfigurationItem represents all the configuration with its name(key).
message ConfigurationItem {
// Required. The value of configuration item.
Expand Down
151 changes: 150 additions & 1 deletion src/Dapr.Client/Protos/dapr/proto/dapr/v1/appcallback.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package dapr.proto.runtime.v1;

import "google/protobuf/empty.proto";
import "dapr/proto/common/v1/common.proto";
import "google/protobuf/struct.proto";

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

// AppCallbackAlpha V1 is an optional extension to AppCallback V1 to opt
// for Alpha RPCs.
service AppCallbackAlpha {
// Subscribes bulk events from Pubsub
rpc OnBulkTopicEventAlpha1(TopicEventBulkRequest) returns (TopicEventBulkResponse) {}
}

// TopicEventRequest message is compatible with CloudEvent spec v1.0
// https://github.com/cloudevents/spec/blob/v1.0/spec.md
message TopicEventRequest {
Expand Down Expand Up @@ -89,6 +97,9 @@ message TopicEventRequest {
// The matching path from TopicSubscription/routes (if specified) for this event.
// This value is used by OnTopicEvent to "switch" inside the handler.
string path = 9;

// The map of additional custom properties to be sent to the app. These are considered to be cloud event extensions.
google.protobuf.Struct extensions = 10;
}

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

// TopicEventCERequest message is compatible with CloudEvent spec v1.0
message TopicEventCERequest {
// The unique identifier of this cloud event.
string id = 1;

// source identifies the context in which an event happened.
string source = 2;

// The type of event related to the originating occurrence.
string type = 3;

// The version of the CloudEvents specification.
string spec_version = 4;

// The content type of data value.
string data_content_type = 5;

// The content of the event.
bytes data = 6;

// Custom attributes which includes cloud event extensions.
google.protobuf.Struct extensions = 7;
}

// TopicEventBulkRequestEntry represents a single message inside a bulk request
message TopicEventBulkRequestEntry {
// Unique identifier for the message.
string entry_id = 1;

// The content of the event.
oneof event {
bytes bytes = 2;
TopicEventCERequest cloud_event = 3;
}

// content type of the event contained.
string content_type = 4;

// The metadata associated with the event.
map<string,string> metadata = 5;
}

// TopicEventBulkRequest represents request for bulk message
message TopicEventBulkRequest {
// Unique identifier for the bulk request.
string id = 1;

// The list of items inside this bulk request.
repeated TopicEventBulkRequestEntry entries = 2;

// The metadata associated with the this bulk request.
map<string,string> metadata = 3;

// The pubsub topic which publisher sent to.
string topic = 4;

// The name of the pubsub the publisher sent to.
string pubsub_name = 5;

// The type of event related to the originating occurrence.
string type = 6;

// The matching path from TopicSubscription/routes (if specified) for this event.
// This value is used by OnTopicEvent to "switch" inside the handler.
string path = 7;
}

// TopicEventBulkResponseEntry Represents single response, as part of TopicEventBulkResponse, to be
// sent by subscibed App for the corresponding single message during bulk subscribe
message TopicEventBulkResponseEntry {
// Unique identifier associated the message.
string entry_id = 1;

// The status of the response.
TopicEventResponse.TopicEventResponseStatus status = 2;
}

// AppBulkResponse is response from app on published message
message TopicEventBulkResponse {

// The list of all responses for the bulk request.
repeated TopicEventBulkResponseEntry statuses = 1;
}

// BindingEventRequest represents input bindings event.
message BindingEventRequest {
// Required. The name of the input binding component.
Expand Down Expand Up @@ -150,7 +245,61 @@ message BindingEventResponse {
// ListTopicSubscriptionsResponse is the message including the list of the subscribing topics.
message ListTopicSubscriptionsResponse {
// The list of topics.
repeated common.v1.TopicSubscription subscriptions = 1;
repeated TopicSubscription subscriptions = 1;
}

// TopicSubscription represents topic and metadata.
message TopicSubscription {
// Required. The name of the pubsub containing the topic below to subscribe to.
string pubsub_name = 1;

// Required. The name of topic which will be subscribed
string topic = 2;

// The optional properties used for this topic's subscription e.g. session id
map<string,string> metadata = 3;

// The optional routing rules to match against. In the gRPC interface, OnTopicEvent
// is still invoked but the matching path is sent in the TopicEventRequest.
TopicRoutes routes = 5;

// The optional dead letter queue for this topic to send events to.
string dead_letter_topic = 6;

// The optional bulk subscribe settings for this topic.
BulkSubscribeConfig bulk_subscribe = 7;
}

message TopicRoutes {
// The list of rules for this topic.
repeated TopicRule rules = 1;

// The default path for this topic.
string default = 2;
}

message TopicRule {
// The optional CEL expression used to match the event.
// If the match is not specified, then the route is considered
// the default.
string match = 1;

// The path used to identify matches for this subscription.
// This value is passed in TopicEventRequest and used by OnTopicEvent to "switch"
// inside the handler.
string path = 2;
}

// BulkSubscribeConfig is the message to pass settings for bulk subscribe
message BulkSubscribeConfig {
// Required. Flag to enable/disable bulk subscribe
bool enabled = 1;

// Optional. Max number of messages to be sent in a single bulk request
int32 max_messages_count = 2;

// Optional. Max duration to wait for messages to be sent in a single bulk request
int32 max_await_duration_ms = 3;
}

// ListInputBindingsResponse is the message including the list of input bindings.
Expand Down
Loading