public class RabbitMQConsumer extends java.lang.Object implements MessageConsumer
Constructor and Description |
---|
RabbitMQConsumer(RabbitMQStore store) |
Modifier and Type | Method and Description |
---|---|
boolean |
ack()
Acknowledge the message upon successful backend invocation
|
boolean |
cleanup()
Cleanup the
Connection and it's related resources |
java.lang.String |
getId()
Get ID of this RabbitMQ consumer
|
boolean |
isAlive()
Check availability of connectivity with the message store
|
MessageContext |
receive()
Get a single message from the queue and deserialize for set into the message context
|
void |
setAlive(boolean isAlive)
Set availability of connectivity with the message store
|
void |
setChannel(com.rabbitmq.client.Channel channel)
Set the
Channel object |
void |
setConnection(com.rabbitmq.client.Connection connection)
Set the
Connection object |
void |
setId(int id)
Set ID of this RabbitMQ consumer
|
void |
setQueueName(java.lang.String queueName)
Set the queue name
|
public RabbitMQConsumer(RabbitMQStore store)
public MessageContext receive()
receive
in interface MessageConsumer
MessageContext
with received messagepublic boolean ack()
ack
in interface MessageConsumer
public boolean cleanup()
Connection
and it's related resourcescleanup
in interface MessageConsumer
public boolean isAlive()
isAlive
in interface MessageConsumer
true
if connection available, false
otherwise.public void setAlive(boolean isAlive)
setAlive
in interface MessageConsumer
isAlive
- connection availability.public java.lang.String getId()
getId
in interface MessageConsumer
public void setId(int id)
setId
in interface MessageConsumer
id
- IDpublic void setConnection(com.rabbitmq.client.Connection connection)
Connection
objectconnection
- a Connection
objectpublic void setChannel(com.rabbitmq.client.Channel channel)
Channel
objectchannel
- a Channel
objectpublic void setQueueName(java.lang.String queueName)
queueName
- the queue nameCopyright © 2005-2020 Apache Software Foundation. All Rights Reserved.