public enum CommitStrategy extends java.lang.Enum<CommitStrategy>
An enum representing different strategies for committing positions in a Coherence topic when
using CoherenceTopicListener
.
To track messages that have been consumed, Coherence allows committing positions at a frequency desired by the developer.
Depending on requirements you may wish the commit more or less frequently and you may not care whether the
commit was successful or not. This enum allows configuring a range of policies for a Coherence topic subscriber
from leaving it down to the client to synchronously commit (with SYNC
) or asynchronously commit
(with ASYNC
) after each message is consumed, through to manually handling commits (with MANUAL
).
Enum Constant and Description |
---|
ASYNC
Asynchronously commit using
Subscriber.Element.commitAsync() after each messages is processed. |
MANUAL
Do not commit messages.
|
SYNC
Synchronously commit using
Subscriber.Element.commit() after each messages is processed. |
Modifier and Type | Method and Description |
---|---|
static CommitStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CommitStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CommitStrategy MANUAL
Subscriber.Element
itself and call Subscriber.Element.commit()
or Subscriber.Element.commitAsync()
to commit the received element.public static final CommitStrategy SYNC
Subscriber.Element.commit()
after each messages is processed.public static final CommitStrategy ASYNC
Subscriber.Element.commitAsync()
after each messages is processed.public static CommitStrategy[] values()
for (CommitStrategy c : CommitStrategy.values()) System.out.println(c);
public static CommitStrategy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null