|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<TopicOverloadPolicy>
com.hazelcast.topic.TopicOverloadPolicy
@Beta public enum TopicOverloadPolicy
A policy to deal with an overloaded topic; so topic where there is no place to store new messages.
This policy can only be used in combination with the HazelcastInstance.getReliableTopic(String)
.
The reliable topic uses a Ringbuffer
to store the messages. A ringbuffer doesn't track where
readers are, so therefore it has no concept of a slow consumers. This provides many advantages like high performance reads, but
it also gives the ability to the reader to reread the same message multiple times in case of error.
Because a ringbuffer has a capacity and to prevent that a fast producer overwrites the messages needed by a slow consumer, a
retention time can be set on the ringbuffer. See com.hazelcast.config.RingbufferConfig#setRetentionSeconds(int)
. This
TopicOverloadPolicy
controls how te publisher is going to deal with the situation that a ringbuffer is full and the
oldest item in the ringbuffer is not old enough to get overwritten.
So keep in mind that a this retention period keep the messages in memory, even though it might by that all readers already
have completed reading.
Enum Constant Summary | |
---|---|
BLOCK
The caller will wait till there space in the ringbuffer. |
|
DISCARD_NEWEST
The message that was to be published, is discarded. |
|
DISCARD_OLDEST
Using this policy a message that has not expired can be overwritten. |
|
ERROR
The publish call immediately fails. |
Method Summary | |
---|---|
static TopicOverloadPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static TopicOverloadPolicy[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final TopicOverloadPolicy DISCARD_OLDEST
public static final TopicOverloadPolicy DISCARD_NEWEST
public static final TopicOverloadPolicy BLOCK
public static final TopicOverloadPolicy ERROR
Method Detail |
---|
public static TopicOverloadPolicy[] values()
for (TopicOverloadPolicy c : TopicOverloadPolicy.values()) System.out.println(c);
public static TopicOverloadPolicy valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |