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 boolean
ack()
Acknowledges the last message received so that it will be removed from the store.boolean
cleanup()
Cleans up this message consumerString
getId()
Returns the ID of this Message consumer.boolean
isAlive()
Check availability of connectivity with the message storeMessageContext
receive()
Receives the next message from the store.void
setAlive(boolean isAlive)
Set the connectivity state with the message storeInMemoryConsumer
setDestination(Queue<MessageContext> queue)
void
setId(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:MessageConsumer
Receives the next message from the store.- Specified by:
receive
in interfaceMessageConsumer
- Returns:
- Synapse message context of the last message received from the store.
-
ack
public boolean ack()
Description copied from interface:MessageConsumer
Acknowledges the last message received so that it will be removed from the store.- Specified by:
ack
in interfaceMessageConsumer
- Returns:
true
if the acknowledgement is successful.false
otherwise.
-
cleanup
public boolean cleanup()
Description copied from interface:MessageConsumer
Cleans up this message consumer- Specified by:
cleanup
in interfaceMessageConsumer
- Returns:
true
if cleanup is successful,false
otherwise.
-
isAlive
public boolean isAlive()
Description copied from interface:MessageConsumer
Check availability of connectivity with the message store- Specified by:
isAlive
in interfaceMessageConsumer
- Returns:
true
if connection available,false
otherwise.
-
setAlive
public void setAlive(boolean isAlive)
Description copied from interface:MessageConsumer
Set the connectivity state with the message store- Specified by:
setAlive
in interfaceMessageConsumer
- Parameters:
isAlive
- if connection available.
-
setId
public void setId(int id)
Description copied from interface:MessageConsumer
Sets the ID of this message consumer.- Specified by:
setId
in interfaceMessageConsumer
- Parameters:
id
- ID
-
getId
public String getId()
Description copied from interface:MessageConsumer
Returns the ID of this Message consumer.- Specified by:
getId
in interfaceMessageConsumer
- Returns:
- ID
-
setDestination
public InMemoryConsumer setDestination(Queue<MessageContext> queue)
-
-