Apply a set of updates to a task and return the updated task
Path parameters
Name of the topic
Unique ID of the task
Request body
A duration relative to the time the commit is accepted, indicating that the task will be scheduled to execute after this duration. When the absolute scheduled time is specified, the scheduled time will take precedence. It is recommended to use relative durations whenever possible to avoid clock synchronization issues. The value must be a valid duration string parsable by time.ParseDuration. This field is only used when creating a commit and will be cleared after converting to an absolute scheduled time.
If not empty, the commit will be accepted only if the value matches the corresponding nonce of the target task.
If not nil, use this value to replace the payload of the task.
If not nil, set the scheduled time of the task to the specified value.
If not empty, transfer the task to the specified topic.
Response
OK
User-defined unique ID of the task. Task IDs across all topics share the same namespace.
The time the task was claimed by a consumer. Not to confuse this with the time of commit, which is not recorded.
Identifier of the consumer instance who consumed the task.
The deadline for the completion of execution promised by the consumer. Consumer code needs to commit the task before this deadline, otherwise the task is determined to have timed out and will be reset to the "pending" state, allowing other consumers to retry.
A duration relative to the time the task is accepted, indicating that the task will be scheduled to execute after this duration. When the absolute scheduled time is specified, the scheduled time will take precedence. It is recommended to use relative durations whenever possible to avoid clock synchronization issues. The value must be a valid duration string parsable by time.ParseDuration. This field is only used when creating a task and will be cleared after converting to an absolute scheduled time.
The nonce field stores a random string for implementing an optimistic concurrency control (OCC) layer outside of the storage engine. Ratus ensures consumers can only commit to tasks that have not changed since the promise was made by verifying the nonce field.
A minimal descriptor of the task to be executed. It is not recommended to rely on Ratus as the main storage of tasks. Instead, consider storing the complete task record in a database, and use a minimal descriptor as the payload to reference the task.
The time the task was created. Timestamps are generated by the instance running Ratus, remember to perform clock synchronization before running multiple instances.
Identifier of the producer instance who produced the task.
The time the task is scheduled to be executed. Tasks will not be executed until the scheduled time arrives. After the scheduled time, excessive tasks will be executed in the order of the scheduled time.
Topic that the task currently belongs to. Tasks under the same topic will be executed according to the scheduled time.