Class InMemoryConsumer
- java.lang.Object
-
- org.apache.synapse.message.store.impl.memory.InMemoryConsumer
-
- All Implemented Interfaces:
MessageConsumer
public class InMemoryConsumer extends Object implements MessageConsumer
-
-
Constructor Summary
Constructors Constructor Description InMemoryConsumer(InMemoryStore store)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanack()Acknowledges the last message received so that it will be removed from the store.booleancleanup()Cleans up this message consumerStringgetId()Returns the ID of this Message consumer.booleanisAlive()Check availability of connectivity with the message storeMessageContextreceive()Receives the next message from the store.voidsetAlive(boolean isAlive)Set the connectivity state with the message storeInMemoryConsumersetDestination(Queue<MessageContext> queue)voidsetId(int id)Sets the ID of this message consumer.
-
-
-
Constructor Detail
-
InMemoryConsumer
public InMemoryConsumer(InMemoryStore store)
-
-
Method Detail
-
receive
public MessageContext receive()
Description copied from interface:MessageConsumerReceives the next message from the store.- Specified by:
receivein interfaceMessageConsumer- Returns:
- Synapse message context of the last message received from the store.
-
ack
public boolean ack()
Description copied from interface:MessageConsumerAcknowledges the last message received so that it will be removed from the store.- Specified by:
ackin interfaceMessageConsumer- Returns:
trueif the acknowledgement is successful.falseotherwise.
-
cleanup
public boolean cleanup()
Description copied from interface:MessageConsumerCleans up this message consumer- Specified by:
cleanupin interfaceMessageConsumer- Returns:
trueif cleanup is successful,falseotherwise.
-
isAlive
public boolean isAlive()
Description copied from interface:MessageConsumerCheck availability of connectivity with the message store- Specified by:
isAlivein interfaceMessageConsumer- Returns:
trueif connection available,falseotherwise.
-
setAlive
public void setAlive(boolean isAlive)
Description copied from interface:MessageConsumerSet the connectivity state with the message store- Specified by:
setAlivein interfaceMessageConsumer- Parameters:
isAlive- if connection available.
-
setId
public void setId(int id)
Description copied from interface:MessageConsumerSets the ID of this message consumer.- Specified by:
setIdin interfaceMessageConsumer- Parameters:
id- ID
-
getId
public String getId()
Description copied from interface:MessageConsumerReturns the ID of this Message consumer.- Specified by:
getIdin interfaceMessageConsumer- Returns:
- ID
-
setDestination
public InMemoryConsumer setDestination(Queue<MessageContext> queue)
-
-