Interface WorkerCallback


public interface WorkerCallback
The callback interface for a task to report it is complete or that it must be subject to some further action, e.g. forwarding.
  • Method Details

    • send

      void send(TaskInformation taskInformation, TaskMessage responseMessage)
      Used to send responses prior to the final response (when complete should be used instead).
      Parameters:
      taskInformation - a queue-specific reference for the incoming message that generated the response
      responseMessage - the message to put on the queue (target specified by the to property)
    • complete

      void complete(TaskInformation taskInformation, String queue, TaskMessage responseMessage)
      Indicate a task was completed.
      Parameters:
      taskInformation - a queue-specific reference for the incoming message that generated the response
      queue - the queue to hold the message
      responseMessage - the message to put on the queue
    • abandon

      void abandon(TaskInformation taskInformation, Exception e)
      Indicates the Worker wishes to abandon this task, but return it to the queue so that it can be retried by this or another Worker instance.
      Parameters:
      taskInformation - the id of the task's queue message to reject
      e - the Exception causing the task's queue message to be rejected
    • forward

      void forward(TaskInformation taskInformation, String queue, TaskMessage forwardedMessage, Map<String,Object> headers)
      Indicates the Worker wishes to forward this task to the specified queue without processing it.
      Parameters:
      taskInformation - a queue-specific reference for the incoming message to be forwarded
      queue - the queue to hold the forwarded message
      forwardedMessage - the message to put on the queue
      headers - the map of key/value paired headers to be stamped on the message
    • pause

      void pause(TaskInformation taskInformation, String pausedQueue, TaskMessage taskMessage, Map<String,Object> headers)
      Indicates the Worker wishes to forward this task to the specified paused queue without processing it.
      Parameters:
      taskInformation - a queue-specific reference for the incoming message to be forwarded to the paused queue
      pausedQueue - the queue to hold the forwarded message
      taskMessage - the message to put on the paused queue
      headers - the map of key/value paired headers to be stamped on the message
    • discard

      void discard(TaskInformation taskInformation)
      Indicates the Worker wishes to discard this task without returning it to the queue for retry.
      Parameters:
      taskInformation - the id of the task's queue message to discard
    • reportUpdate

      void reportUpdate(TaskInformation taskInformation, TaskMessage reportUpdateMessage)
      Used to send a report update message.
      Parameters:
      taskInformation - a queue-specific reference for the incoming message
      reportUpdateMessage - the report update message to put on the queue