-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgateway.proto
More file actions
230 lines (196 loc) · 5.19 KB
/
gateway.proto
File metadata and controls
230 lines (196 loc) · 5.19 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
syntax = 'proto3';
package gateway_protocol;
option java_multiple_files = false;
option java_package = "io.zeebe.gateway.protocol";
option go_package = "pb";
message TopologyRequest {
}
message Partition {
int32 partitionId = 1;
enum PartitionBrokerRole {
LEADER = 0;
FOLLOWER = 1;
}
PartitionBrokerRole role = 3;
}
message BrokerInfo {
int32 nodeId = 1;
string host = 2;
int32 port = 3;
repeated Partition partitions = 4;
}
message TopologyResponse {
repeated BrokerInfo brokers = 1;
int32 clusterSize = 2;
int32 partitionsCount = 3;
int32 replicationFactor = 4;
}
message WorkflowRequestObject {
string name = 1;
enum ResourceType {
// FILE type means the gateway will try to detect the resource type using the file extension of the name
FILE = 0;
BPMN = 1;
YAML = 2;
}
ResourceType type = 2;
bytes definition = 3;
}
message DeployWorkflowRequest {
repeated WorkflowRequestObject workflows = 1;
}
message WorkflowMetadata {
string bpmnProcessId = 1;
int32 version = 2;
int64 workflowKey = 3;
string resourceName = 4;
}
message DeployWorkflowResponse {
int64 key = 1;
repeated WorkflowMetadata workflows = 2;
}
message PublishMessageRequest {
string name = 1;
string correlationKey = 2;
int64 timeToLive = 3;
string messageId = 4;
/* payload has to be a valid json object as string */
string payload = 5;
}
message PublishMessageResponse {
}
message CreateJobRequest {
string jobType = 1;
int32 retries = 2;
/* custom headers has to be a valid json object as string */
string customHeaders = 3;
/* payload has to be a valid json object as string */
string payload = 4;
}
message CreateJobResponse {
int64 key = 1;
}
message UpdateJobRetriesRequest {
int64 jobKey = 1;
int32 retries = 2;
}
message UpdateJobRetriesResponse {
}
message FailJobRequest {
int64 jobKey = 1;
int32 retries = 2;
}
message FailJobResponse {
}
message CompleteJobRequest {
int64 jobKey = 1;
/* payload has to be a valid json object as string */
string payload = 2;
}
message CompleteJobResponse {
}
message CreateWorkflowInstanceRequest {
int64 workflowKey = 1;
string bpmnProcessId = 2;
/* if bpmnProcessId is set version = -1 indicates to use the latest version */
int32 version = 3;
/* payload has to be a valid json object as string */
string payload = 4;
}
message CreateWorkflowInstanceResponse {
int64 workflowKey = 1;
string bpmnProcessId = 2;
int32 version = 3;
int64 workflowInstanceKey = 5;
}
message CancelWorkflowInstanceRequest {
int64 workflowInstanceKey = 1;
}
message CancelWorkflowInstanceResponse {
}
message UpdateWorkflowInstancePayloadRequest {
int64 elementInstanceKey = 1;
/* payload has to be a valid json object as string */
string payload = 2;
}
message UpdateWorkflowInstancePayloadResponse {
}
message ListWorkflowsRequest {
/* optional filter by BPMN process id, if empty all workflows are returned */
string bpmnProcessId = 1;
}
message ListWorkflowsResponse {
repeated WorkflowMetadata workflows = 1;
}
/* either workflow key or bpmn process id and version has to be specified*/
message GetWorkflowRequest {
int64 workflowKey = 1;
/* if bpmnProcessId is set version = -1 indicates to use the latest version */
int32 version = 2;
string bpmnProcessId = 3;
}
message GetWorkflowResponse {
int64 workflowKey = 1;
int32 version = 2;
string bpmnProcessId = 3;
string resourceName = 4;
string bpmnXml = 5;
}
message ActivateJobsRequest {
string type = 1;
string worker = 2;
int64 timeout = 3;
int32 amount = 4;
}
message JobHeaders {
int64 workflowInstanceKey = 1;
string bpmnProcessId = 2;
int32 workflowDefinitionVersion = 3;
int64 workflowKey = 4;
string elementId = 5;
int64 elementInstanceKey = 6;
}
message ActivatedJob {
int64 key = 1;
string type = 2;
JobHeaders jobHeaders = 3;
// json object as string
string customHeaders = 4;
string worker = 5;
int32 retries = 6;
// epoch milliseconds
int64 deadline = 7;
/* json object as string */
string payload = 8;
}
message ActivateJobsResponse {
repeated ActivatedJob jobs = 1;
}
service Gateway {
rpc Topology (TopologyRequest) returns (TopologyResponse) {
}
rpc DeployWorkflow (DeployWorkflowRequest) returns (DeployWorkflowResponse) {
}
rpc PublishMessage (PublishMessageRequest) returns (PublishMessageResponse) {
}
rpc CreateJob (CreateJobRequest) returns (CreateJobResponse) {
}
rpc UpdateJobRetries (UpdateJobRetriesRequest) returns (UpdateJobRetriesResponse) {
}
rpc FailJob (FailJobRequest) returns (FailJobResponse) {
}
rpc CompleteJob (CompleteJobRequest) returns (CompleteJobResponse) {
}
rpc CreateWorkflowInstance (CreateWorkflowInstanceRequest) returns (CreateWorkflowInstanceResponse) {
}
rpc CancelWorkflowInstance (CancelWorkflowInstanceRequest) returns (CancelWorkflowInstanceResponse) {
}
rpc UpdateWorkflowInstancePayload (UpdateWorkflowInstancePayloadRequest) returns (UpdateWorkflowInstancePayloadResponse) {
}
rpc ActivateJobs (ActivateJobsRequest) returns (stream ActivateJobsResponse) {
}
rpc ListWorkflows (ListWorkflowsRequest) returns (ListWorkflowsResponse) {
}
rpc GetWorkflow (GetWorkflowRequest) returns (GetWorkflowResponse) {
}
}