@@ -14,16 +14,16 @@ message RetryState {
1414 // Current attempt number
1515 uint32 attempts = 1 ;
1616
17- // After this number of attempts, the task is either discarded or deadlettered.
17+ // After this number of attempts, the activation is either discarded or deadlettered.
1818 uint32 max_attempts = 2 ;
1919
2020 // The action to take after the max_attempts is exceeded.
2121 OnAttemptsExceeded on_attempts_exceeded = 3 ;
2222
23- // Whether a task should be executed at most once.
23+ // Whether an activation should be executed at most once.
2424 optional bool at_most_once = 4 ;
2525
26- // Duration in seconds that a task must wait to begin execution after it is retried.
26+ // Duration in seconds that an activation must wait to begin execution after it is retried.
2727 optional uint64 delay_on_retry = 5 ;
2828}
2929
@@ -36,17 +36,17 @@ enum TaskActivationStatus {
3636 TASK_ACTIVATION_STATUS_COMPLETE = 5 ;
3737}
3838
39- // Task message that is stored in Kafka and shared over RPC.
39+ // Activation message that is stored in Kafka and shared over RPC.
4040message TaskActivation {
41- // A GUID for the task . Used to update tasks
41+ // A GUID for the activation . Used to update activations
4242 string id = 1 ;
4343
44- // The task namespace. Applications can contain multiple namespaces.
44+ // The activation namespace. Applications can contain multiple namespaces.
4545 // While namespaces within an application must be unique, different
4646 // applications can have overlapping namespace values.
4747 string namespace = 2 ;
4848
49- // The name of the task . This name is resolved within the worker
49+ // The name of the activation . This name is resolved within the worker
5050 string taskname = 3 ;
5151
5252 // DEPRECATED: Use parameters_bytes instead.
@@ -58,25 +58,25 @@ message TaskActivation {
5858 // Mutually exclusive with `parameters`.
5959 bytes parameters_bytes = 13 ;
6060
61- // A map of headers for the task .
61+ // A map of headers for the activation .
6262 map <string , string > headers = 5 ;
6363
64- // The timestamp a task was stored in Kafka
64+ // The timestamp an activation was stored in Kafka
6565 google.protobuf.Timestamp received_at = 6 ;
6666
6767 // Retry state
6868 RetryState retry_state = 7 ;
6969
70- // The duration in seconds that a worker has to complete task execution.
70+ // The duration in seconds that a worker has to complete activation execution.
7171 // When an activation is moved from pending -> processing a result is expected
7272 // in this many seconds.
7373 uint64 processing_deadline_duration = 8 ;
7474
75- // The duration in seconds that a task has to start execution.
75+ // The duration in seconds that an activation has to start execution.
7676 // After received_at + expires has passed an activation is expired and will not be executed.
7777 optional uint64 expires = 9 ;
7878
79- // The duration in seconds that a task must wait to begin execution after it is emitted.
79+ // The duration in seconds that an activation must wait to begin execution after it is emitted.
8080 // After received_at + delay has passed, the activation will become pending.
8181 optional uint64 delay = 11 ;
8282
@@ -91,11 +91,14 @@ message TaskActivation {
9191// RPC messages and services
9292////////////////////////////
9393service ConsumerService {
94- // Fetch a new task activation to process.
94+ // Fetch a new activation to process.
9595 rpc GetTask (GetTaskRequest ) returns (GetTaskResponse ) {}
9696
97- // Update the state of a task with execution results.
97+ // Update the state of an activation with execution results.
9898 rpc SetTaskStatus (SetTaskStatusRequest ) returns (SetTaskStatusResponse ) {}
99+
100+ // Update the status of multiple activations
101+ rpc SetBatchActivationStatus (SetBatchActivationStatusRequest ) returns (SetBatchActivationStatusResponse ) {}
99102}
100103
101104message GetTaskRequest {
@@ -106,7 +109,7 @@ message GetTaskRequest {
106109}
107110
108111message GetTaskResponse {
109- // If there are no tasks available, this will be empty
112+ // If there are no activations available, this will be empty
110113 optional TaskActivation task = 1 ;
111114}
112115
@@ -122,29 +125,36 @@ message SetTaskStatusRequest {
122125
123126 TaskActivationStatus status = 2 ;
124127
125- // If fetch_next is provided, receive a new task in the response
128+ // If fetch_next is provided, receive a new activation in the response
126129 optional FetchNextTask fetch_next_task = 3 ;
127130
128- // Maximum number of attempts for this task (including the initial attempt).
131+ // Maximum number of attempts for this activation (including the initial attempt).
129132 // When status is RETRY and this field is set, the broker will update
130133 // the activation's retry_state with this value. This allows workers
131134 // to communicate the retry policy for tasks from raw topics that
132135 // don't have retry_state embedded in the message.
133136 optional uint32 max_attempts = 4 ;
134137
135- // Duration in seconds to wait before retrying the task .
138+ // Duration in seconds to wait before retrying the activation .
136139 // When status is RETRY and this field is set, the broker will update
137140 // the activation's retry_state.delay_on_retry with this value.
138141 optional uint64 delay_on_retry = 5 ;
139142}
140143
141144message SetTaskStatusResponse {
142- // The next task the worker should execute. Requires fetch_next to be set on the request.
145+ // The next activation the worker should execute. Requires fetch_next to be set on the request.
143146 optional TaskActivation task = 1 ;
144147}
145148
149+ message SetBatchActivationStatusRequest {
150+ // The status updates the broker should execute
151+ repeated SetTaskStatusRequest updates = 1 ;
152+ }
153+
154+ message SetBatchActivationStatusResponse {}
155+
146156service WorkerService {
147- // Provide the worker with a task to execute.
157+ // Provide the worker with an activation to execute.
148158 rpc PushTask (PushTaskRequest ) returns (PushTaskResponse ) {}
149159}
150160
0 commit comments