public interface MessagePersister
MessageQueue so that if the joynr runtime quits unexpectedly,
the messages in the queue are not lost and can be restored on the next start of the runtime.| Modifier and Type | Method and Description |
|---|---|
Set<DelayableImmutableMessage> |
fetchAll(String messageQueueId)
Fetches all messages from persistence which have not yet been
remove(String,DelayableImmutableMessage). |
boolean |
persist(String messageQueueId,
DelayableImmutableMessage message)
Called with the message to be persisted.
|
void |
remove(String messageQueueId,
DelayableImmutableMessage message)
Called once the message queue has actually processed the message previously added to the persistence by calling
persist(String,DelayableImmutableMessage). |
boolean persist(String messageQueueId, DelayableImmutableMessage message)
false. Implementations of this method can block until the persisting was
successful, but be aware that this might impact performance.messageQueueId - the unique ID of the message queue for which the message is being persistedmessage - the message which is a candidate for persistingtrue if the message is persisted, false if not.Set<DelayableImmutableMessage> fetchAll(String messageQueueId)
remove(String,DelayableImmutableMessage).
The MessageQueue will call this during startup to fetch any messages which were
persisted but not consumed during a previous lifetime of the joynr runtime in order to re-add them to the queue.messageQueueId - the ID of the message queue for which to fetch the persisted messages.void remove(String messageQueueId, DelayableImmutableMessage message)
persist(String,DelayableImmutableMessage).
The implementation of this method should ensure that the message is actually removed
from the persistence, and should block until this has been done successfully.messageQueueId - the ID of the message queue which consumed the message.message - the message which has been consumed by the queue and should be removed from persistence.Copyright © 2021. All rights reserved.