Interface WorkerQueue

All Known Subinterfaces:
ManagedWorkerQueue
All Known Implementing Classes:
RabbitWorkerQueue

public interface WorkerQueue
A general representation of a queue for the purposes of a worker service.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called from the asynchronous worker service to notify the queue that it is acknowledging a task.
    void
    discardTask(TaskInformation taskInformation)
    Called from the asynchronous worker service to notify the queue that it is discarding a task.
    Return the name of the input queue.
    Return the name of the paused queue.
    void
    publish(TaskInformation taskInformation, byte[] taskMessage, String targetQueue, Map<String,Object> headers)
    Acknowledge the original received message but send out a new message to a target queue.
    void
    publish(TaskInformation taskInformation, byte[] taskMessage, String targetQueue, Map<String,Object> headers, boolean isLastMessage)
    Acknowledge the original received message but send out a new message to a target queue.
    void
    rejectTask(TaskInformation taskInformation)
    Called from the asynchronous worker service to notify the queue that it is rejecting a task.
  • Method Details

    • publish

      void publish(TaskInformation taskInformation, byte[] taskMessage, String targetQueue, Map<String,Object> headers, boolean isLastMessage) throws QueueException
      Acknowledge the original received message but send out a new message to a target queue.
      Parameters:
      taskInformation - the internal queue message id of the message to acknowledge
      taskMessage - the message to publish
      targetQueue - the queue to put the message upon
      headers - the map of key/value paired headers to be stamped on the message
      isLastMessage - the boolean to indicate if current message is final message for the task
      Throws:
      QueueException - if the message cannot be submitted
    • publish

      void publish(TaskInformation taskInformation, byte[] taskMessage, String targetQueue, Map<String,Object> headers) throws QueueException
      Acknowledge the original received message but send out a new message to a target queue.
      Parameters:
      taskInformation - the internal queue message id of the message to acknowledge
      taskMessage - the message to publish
      targetQueue - the queue to put the message upon
      headers - the map of key/value paired headers to be stamped on the message
      Throws:
      QueueException - if the message cannot be submitted
    • rejectTask

      void rejectTask(TaskInformation taskInformation)
      Called from the asynchronous worker service to notify the queue that it is rejecting a task. It is up to the queue implementation as to whether submit this task to retry or not.
      Parameters:
      taskInformation - the queue task id that has been rejected
    • discardTask

      void discardTask(TaskInformation taskInformation)
      Called from the asynchronous worker service to notify the queue that it is discarding a task.
      Parameters:
      taskInformation - the queue task id that has been discarded
    • acknowledgeTask

      void acknowledgeTask(TaskInformation taskInformation)
      Called from the asynchronous worker service to notify the queue that it is acknowledging a task.
      Parameters:
      taskInformation - the queue task id that has been acknowledged
    • getInputQueue

      String getInputQueue()
      Return the name of the input queue.
      Returns:
      the name of the input queue
    • getPausedQueue

      String getPausedQueue()
      Return the name of the paused queue.
      Returns:
      the name of the paused queue