-
Notifications
You must be signed in to change notification settings - Fork 3
/
readside.proto
42 lines (36 loc) · 1.6 KB
/
readside.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
syntax = "proto3";
package chief_of_state.v1;
option csharp_namespace = "Namely.ChiefOfState.V1";
option go_package = "chief_of_state/v1;chiefofstatev1";
option java_multiple_files = true;
option java_outer_classname = "CosReadSideHandlerProto";
option java_package = "com.namely.protobuf.chiefofstate.v1";
import "chief_of_state/v1/common.proto";
import "google/protobuf/any.proto";
// Defines the readSide handler service interface that will be implemented by
// any application that needs to build a readSide from the events persisted.
// ChiefOfState will connect to this service when the readSide is enabled and
// push events to it.
service ReadSideHandlerService {
// Helps build a read model from persisted events and snpahots
rpc HandleReadSide(HandleReadSideRequest) returns (HandleReadSideResponse);
}
// ReadSideRequest is used to push the ReadSideHandler
// events and state persisted in the journal and the snapshot
message HandleReadSideRequest {
// the persisted event
google.protobuf.Any event = 1;
// the resulting state associated to the persisted event
google.protobuf.Any state = 2;
// additional meta data
chief_of_state.v1.MetaData meta = 3;
// the identifier of the read side service receiving the request
string read_side_id = 4;
}
// ReadSideResponse is used by ChiefOfState to either
// commit events read offset or not.
message HandleReadSideResponse {
// successful=true means the offset will be committed and the readside will move on to process the next event.
// Otherwise, if successful=false, the event will get reprocessed with a backoff strategy.
bool successful = 1;
}