Package com.github.workerframework.api
Class WorkerResponse
java.lang.Object
com.github.workerframework.api.WorkerResponse
Object to represent a response from a Worker, to be interpreted by the core worker framework.
-
Constructor Summary
ConstructorsConstructorDescriptionWorkerResponse
(String queue, TaskStatus status, byte[] data, String msgType, int version, byte[] context) Create a new WorkerResponse.WorkerResponse
(String queue, TaskStatus status, byte[] data, String msgType, int version, byte[] context, String trackTo) Create a new WorkerResponse. -
Method Summary
-
Constructor Details
-
WorkerResponse
public WorkerResponse(String queue, TaskStatus status, byte[] data, String msgType, int version, byte[] context) Create a new WorkerResponse.- Parameters:
queue
- the reference to the queue that the response data should be put upon. This can be null if no queue is providedstatus
- the status of the message the Worker is returningdata
- the serialised task-specific data returned from the Worker internalsmsgType
- the task-specific message classifierversion
- the task-specific message API versioncontext
- the new context to add to the task message, can be null
-
WorkerResponse
public WorkerResponse(String queue, TaskStatus status, byte[] data, String msgType, int version, byte[] context, String trackTo) Create a new WorkerResponse.- Parameters:
queue
- the reference to the queue that the response data should be put upon. This can be null if no queue is providedstatus
- the status of the message the Worker is returningdata
- the serialised task-specific data returned from the Worker internalsmsgType
- the task-specific message classifierversion
- the task-specific message API versioncontext
- the new context to add to the task message, can be nulltrackTo
- the tracking 'trackTo' pipe to set
-
-
Method Details
-
getTaskStatus
-
getQueueReference
-
getData
public byte[] getData() -
getMessageType
-
getApiVersion
public int getApiVersion() -
getContext
public byte[] getContext() -
getTrackTo
-