public class QueueManager extends Object implements Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes all open channels and connections to Rabbitmq server and stops the Consumer thread.
|
static com.rabbitmq.client.Connection |
createRabbitConnection(com.hpe.caf.worker.queue.rabbit.RabbitWorkerQueueConfiguration configuration)
Helper method to establish connection to Rabbitmq Server
|
static QueueManager |
getInstance()
Constructs or returns the QueueManager instance
|
MessageHandler |
getMessageHandler()
Returns the messageHandler property
|
void |
publishMessage(com.hpe.caf.api.worker.TaskMessage message)
Publishes a TaskMessage to the InputQueue
|
public static QueueManager getInstance() throws Exception
Exceptionpublic void publishMessage(com.hpe.caf.api.worker.TaskMessage message)
throws com.hpe.caf.api.CodecException,
IOException
message - the message to publishcom.hpe.caf.api.CodecException - if TaskMessage fails to serializeIOException - if channel fails to publish the messagepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic static com.rabbitmq.client.Connection createRabbitConnection(com.hpe.caf.worker.queue.rabbit.RabbitWorkerQueueConfiguration configuration)
throws IOException,
TimeoutException
configuration - the Connection configurationIOExceptionTimeoutExceptionpublic MessageHandler getMessageHandler()
Copyright © 2015–2017 Hewlett Packard Enterprise Development LP. All rights reserved.