forked from uw-labs/proximo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proximo.proto
57 lines (46 loc) · 1.01 KB
/
proximo.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
syntax = "proto3";
package proximo;
option go_package = "github.com/uw-labs/proximo/proto;proto";
message Message {
bytes data = 1;
string id = 2;
bytes key = 3;
}
// Consumer types
service MessageSource {
rpc Consume(stream ConsumerRequest) returns (stream Message) {
}
}
message ConsumerRequest {
// expected if this is a start request
StartConsumeRequest startRequest = 2;
// expected if this is a confirmation
Confirmation confirmation = 3;
}
message StartConsumeRequest {
string topic = 1;
string consumer = 2;
Offset initial_offset = 3;
}
enum Offset {
OFFSET_DEFAULT = 0;
OFFSET_NEWEST = 1;
OFFSET_OLDEST = 2;
}
message Confirmation {
string msgID = 1;
}
// Producer types
service MessageSink {
rpc Publish(stream PublisherRequest) returns (stream Confirmation) {
}
}
message PublisherRequest {
// expected if this is a start request
StartPublishRequest startRequest = 2;
// expected if this is a message
Message msg = 3;
}
message StartPublishRequest {
string topic = 1;
}