public class InMemoryConsumer extends Object implements MessageConsumer
Constructor and Description |
---|
InMemoryConsumer(InMemoryStore store) |
Modifier and Type | Method and Description |
---|---|
boolean |
ack()
Acknowledges the last message received so that it will be removed from the store.
|
boolean |
cleanup()
Cleans up this message consumer
|
String |
getId()
Returns the ID of this Message consumer.
|
boolean |
isAlive()
Check availability of connectivity with the message store
|
MessageContext |
receive()
Receives the next message from the store.
|
InMemoryConsumer |
setDestination(Queue<MessageContext> queue) |
void |
setId(int id)
Sets the ID of this message consumer.
|
public InMemoryConsumer(InMemoryStore store)
public MessageContext receive()
MessageConsumer
receive
in interface MessageConsumer
public boolean ack()
MessageConsumer
ack
in interface MessageConsumer
true
if the acknowledgement is successful. false
otherwise.public boolean cleanup()
MessageConsumer
cleanup
in interface MessageConsumer
true
if cleanup is successful, false
otherwise.public boolean isAlive()
MessageConsumer
isAlive
in interface MessageConsumer
true
if connection available, false
otherwise.public void setId(int id)
MessageConsumer
setId
in interface MessageConsumer
id
- IDpublic String getId()
MessageConsumer
getId
in interface MessageConsumer
public InMemoryConsumer setDestination(Queue<MessageContext> queue)
Copyright © 2005–2017 Apache Software Foundation. All rights reserved.