Class TaskClient
java.lang.Object
com.netflix.conductor.client.http.TaskClient
Client for conductor task management including polling for task, updating task status etc.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a default task clientTaskClient(ConductorClient client) TaskClient(ConductorClient client, ConductorClientConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionAck for the task poll.batchPollTasksByTaskType(String taskType, String workerId, int count, int timeoutInMillisecond) Perform a batch poll for tasks by task type.batchPollTasksInDomain(String taskType, String domain, String workerId, int count, int timeoutInMillisecond) Batch poll for tasks in a domain.evaluateAndUploadLargePayload(Map<String, Object> taskOutputData, String taskType) Get the last poll data for all task typesgetPollData(String taskType) Get last poll data for a given task typeintgetQueueSizeForTask(String taskType) intgetQueueSizeForTask(String taskType, String domain, String isolationGroupId, String executionNamespace) getTaskDetails(String taskId) Retrieve information about the taskgetTaskLogs(String taskId) Fetch execution logs for a task.voidlogMessageForTask(String taskId, String logMessage) Log execution messages for a task.Perform a poll for a task of a specific task type.voidpopulateTaskPayloads(Task task) voidregisterListener(TaskClientListener listener) voidremoveTaskFromQueue(String taskType, String taskId) Removes a task from a taskType queueRequeue pending tasks for all running workflowsrequeuePendingTasksByTaskType(String taskType) Requeue pending tasks of a specific task typePaginated search for tasks based on payloadSearch for tasks based on payloadPaginated search for tasks based on payloadSearch for tasks based on payloadvoidsetRootURI(String rootUri) Deprecated.voidupdateTask(TaskResult taskResult) Updates the result of a task execution.updateTaskV2(TaskResult taskResult) Updates the result of a task execution.
-
Constructor Details
-
TaskClient
public TaskClient()Creates a default task client -
TaskClient
-
TaskClient
-
-
Method Details
-
setRootURI
Deprecated.Kept only for backwards compatibility- Parameters:
rootUri- basePath for the ApiClient
-
registerListener
-
pollTask
Perform a poll for a task of a specific task type.- Parameters:
taskType- The taskType to poll fordomain- The domain of the task typeworkerId- Name of the client worker. Used for logging.- Returns:
- Task waiting to be executed.
-
batchPollTasksByTaskType
public List<Task> batchPollTasksByTaskType(String taskType, String workerId, int count, int timeoutInMillisecond) Perform a batch poll for tasks by task type. Batch size is configurable by count.- Parameters:
taskType- Type of task to poll forworkerId- Name of the client worker. Used for logging.count- Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.timeoutInMillisecond- Long poll wait timeout.- Returns:
- List of tasks awaiting to be executed.
-
batchPollTasksInDomain
public List<Task> batchPollTasksInDomain(String taskType, String domain, String workerId, int count, int timeoutInMillisecond) Batch poll for tasks in a domain. Batch size is configurable by count.- Parameters:
taskType- Type of task to poll fordomain- The domain of the task typeworkerId- Name of the client worker. Used for logging.count- Maximum number of tasks to be returned. Actual number of tasks returned can be less than this number.timeoutInMillisecond- Long poll wait timeout.- Returns:
- List of tasks awaiting to be executed.
-
updateTask
Updates the result of a task execution. If the size of the task output payload is bigger thanExternalPayloadStorage, if enabled, else the task is marked as FAILED_WITH_TERMINAL_ERROR.- Parameters:
taskResult- theTaskResultof the executed task to be updated.
-
updateTaskV2
Updates the result of a task execution. If the size of the task output payload is bigger thanExternalPayloadStorage, if enabled, else the task is marked as FAILED_WITH_TERMINAL_ERROR.- Parameters:
taskResult- theTaskResultof the executed task to be updated.
-
evaluateAndUploadLargePayload
-
ack
Ack for the task poll.- Parameters:
taskId- Id of the task to be polledworkerId- user identified worker.- Returns:
- true if the task was found with the given ID and acknowledged. False otherwise. If the server returns false, the client should NOT attempt to ack again.
-
logMessageForTask
Log execution messages for a task.- Parameters:
taskId- id of the tasklogMessage- the message to be logged
-
getTaskLogs
Fetch execution logs for a task.- Parameters:
taskId- id of the task.
-
getTaskDetails
Retrieve information about the task- Parameters:
taskId- ID of the task- Returns:
- Task details
-
removeTaskFromQueue
Removes a task from a taskType queue- Parameters:
taskType- the taskType to identify the queuetaskId- the id of the task to be removed
-
getQueueSizeForTask
-
getQueueSizeForTask
-
getPollData
Get last poll data for a given task type- Parameters:
taskType- the task type for which poll data is to be fetched- Returns:
- returns the list of poll data for the task type
-
getAllPollData
Get the last poll data for all task types- Returns:
- returns a list of poll data for all task types
-
requeueAllPendingTasks
Requeue pending tasks for all running workflows- Returns:
- returns the number of tasks that have been requeued
-
requeuePendingTasksByTaskType
Requeue pending tasks of a specific task type- Returns:
- returns the number of tasks that have been requeued
-
search
Search for tasks based on payload- Parameters:
query- the search string- Returns:
- returns the
SearchResultcontaining theTaskSummarymatching the query
-
searchV2
Search for tasks based on payload- Parameters:
query- the search string- Returns:
- returns the
SearchResultcontaining theTaskmatching the query
-
search
public SearchResult<TaskSummary> search(Integer start, Integer size, String sort, String freeText, String query) Paginated search for tasks based on payload- Parameters:
start- start value of pagesize- number of tasks to be returnedsort- sort orderfreeText- additional free text queryquery- the search query- Returns:
- the
SearchResultcontaining theTaskSummarythat match the query
-
searchV2
public SearchResult<Task> searchV2(Integer start, Integer size, String sort, String freeText, String query) Paginated search for tasks based on payload- Parameters:
start- start value of pagesize- number of tasks to be returnedsort- sort orderfreeText- additional free text queryquery- the search query- Returns:
- the
SearchResultcontaining theTaskthat match the query
-
populateTaskPayloads
-