Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get fundamentals up for allowing batched event handlers #123

Merged
merged 1 commit into from
Sep 19, 2022
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
15 changes: 13 additions & 2 deletions Source/Runtime/Events.Processing/EventHandlers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,25 @@ message HandleEventRequest {
RetryProcessingState retryProcessingState = 3;
}

message HandleEventBatchRequest {
services.ReverseCallRequestContext callContext = 1;
repeated StreamEvent events = 2;
RetryProcessingState retryProcessingState = 3;
}

message EventHandlerRuntimeToClientMessage {
oneof Message {
EventHandlerRegistrationResponse registrationResponse = 1;
HandleEventRequest handleRequest = 2;
HandleEventRequest handleRequest = 2 [deprecated = true]; // Replaced by handleBatchRequest
services.Ping ping = 3;
HandleEventBatchRequest handleBatchRequest = 4;
}
}

service EventHandlers {
rpc Connect(stream EventHandlerClientToRuntimeMessage) returns(stream EventHandlerRuntimeToClientMessage);
rpc Connect(stream EventHandlerClientToRuntimeMessage) returns(stream EventHandlerRuntimeToClientMessage){
option deprecated = true;
}; // Replaced by ConnectBatched
rpc ConnectBatched(stream EventHandlerClientToRuntimeMessage) returns(stream EventHandlerRuntimeToClientMessage);

}
1 change: 1 addition & 0 deletions Source/Runtime/Events.Processing/Processors.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ message ProcessorFailure {
string reason = 1;
bool retry = 2;
google.protobuf.Duration retryTimeout = 3;
StreamEventMetadata eventMetadata = 4; // The metadata of the event that failed
}

message RetryProcessingState {
Expand Down
14 changes: 11 additions & 3 deletions Source/Runtime/Events.Processing/StreamEvent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ option go_package = "go.dolittle.io/contracts/runtime/events/processing";

message StreamEvent {
events.CommittedEvent event = 1;
string partitionId = 2;
protobuf.Uuid scopeId = 3;
bool partitioned = 4;
string partitionId = 2 [deprecated = true]; // Replaced by metadata
protobuf.Uuid scopeId = 3 [deprecated = true]; // Replaced by metadata
bool partitioned = 4 [deprecated = true]; // Replaced by metadata
StreamEventMetadata metadata = 5; // The metadata of the stream event
}

message StreamEventMetadata {
string partitionId = 1; // The partition id of the event
protobuf.Uuid scopeId = 2; // The scope id of the event
bool partitioned = 3; // Whether the stream is partitioned or not
uint64 streamPosition = 4; // The stream position of the event
}