| Modifier and Type | Class and Description |
|---|---|
static class |
RabbitMQTaskQueue.MsgProp |
| Constructor and Description |
|---|
RabbitMQTaskQueue(com.rabbitmq.client.Connection conn,
String exchange,
String queueName) |
RabbitMQTaskQueue(String host,
Integer port,
String vhost,
String exchange,
String username,
String password,
String queueName)
Creates RabbitMQ task queue, a RabbitMQ server is needed and a DIRECT exchange must be created and bound to
the queue name provided (routing key must be the same as the queue name)
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteTask(Task task)
Deletes a task from the queue.
|
void |
deleteTasks(Set<Task> tasks)
Deletes a set of tasks
|
void |
extendVisibilityTimeout(Task task)
RabbitMQ does not have this feature, messages would not be visible until rejected and requeued
|
String |
getName()
A name identifying the queue used for logging and analysis purposes.
|
protected Task |
marshallTask(byte[] msgBody,
long deliveryTag,
String routingKey,
String exchange) |
void |
put(Set<Task> tasks)
puts multiple tasks on the queue using batch puts if the queue
implementation supports batch puts
|
void |
put(Task... tasks)
Convenience method that calls put(Set
|
void |
put(Task task)
puts a task on the queue
|
void |
requeue(Task task)
Requeues the task by deleting the task, incrementing the "attempts"
counter, and re-adding back to the queue.
|
Integer |
size() |
Integer |
sizeIncludingInvisibleAndDelayed() |
Task |
take()
Blocks until a task is available
|
Set<Task> |
take(int maxTasks)
Take a max of specified number of tasks.
|
protected String |
unmarshallTask(Task task) |
public RabbitMQTaskQueue(String host, Integer port, String vhost, String exchange, String username, String password, String queueName)
public String getName()
TaskQueueprotected Task marshallTask(byte[] msgBody, long deliveryTag, String routingKey, String exchange)
public void put(Task task)
TaskQueuepublic void put(Task... tasks)
public void put(Set<Task> tasks)
TaskQueuepublic Set<Task> take(int maxTasks) throws TimeoutException
TaskQueuetake in interface TaskQueuemaxTasks - to take from queue. Must be between 1 and 10 inclusive.TimeoutExceptionpublic Task take() throws TimeoutException
TaskQueuetake in interface TaskQueueTimeoutExceptionpublic void extendVisibilityTimeout(Task task) throws TaskNotFoundException
extendVisibilityTimeout in interface TaskQueueTaskNotFoundExceptionpublic void deleteTask(Task task) throws TaskNotFoundException
TaskQueuedeleteTask in interface TaskQueueTaskNotFoundExceptionpublic void deleteTasks(Set<Task> tasks) throws TaskException
TaskQueuedeleteTasks in interface TaskQueueTaskExceptionpublic void requeue(Task task)
TaskQueuepublic Integer size()
public Integer sizeIncludingInvisibleAndDelayed()
sizeIncludingInvisibleAndDelayed in interface TaskQueueCopyright © 2009–2020 LYRASIS. All rights reserved.