Class WorkerResponse

java.lang.Object
com.github.workerframework.api.WorkerResponse

public class WorkerResponse extends Object
Object to represent a response from a Worker, to be interpreted by the core worker framework.
  • 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 provided
      status - the status of the message the Worker is returning
      data - the serialised task-specific data returned from the Worker internals
      msgType - the task-specific message classifier
      version - the task-specific message API version
      context - 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 provided
      status - the status of the message the Worker is returning
      data - the serialised task-specific data returned from the Worker internals
      msgType - the task-specific message classifier
      version - the task-specific message API version
      context - the new context to add to the task message, can be null
      trackTo - the tracking 'trackTo' pipe to set
  • Method Details

    • getTaskStatus

      public TaskStatus getTaskStatus()
    • getQueueReference

      public String getQueueReference()
    • getData

      public byte[] getData()
    • getMessageType

      public String getMessageType()
    • getApiVersion

      public int getApiVersion()
    • getContext

      public byte[] getContext()
    • getTrackTo

      public String getTrackTo()