@Beta public class ReliableTopicConfig extends Object
ITopic
.
The reliable topic makes use of the Ringbuffer
to store the actual messages.
To configure the ringbuffer for a reliable topic, define a ringbuffer in the config with exactly the same name. It is very
unlikely that you want to run with the default settings.
When a ReliableTopic starts, it will always start from the tail+1 item from the RingBuffer. It will not chew its way through
all available events but it will wait for the next item being published.
In the reliable topic, global order is always maintained, so all listeners will observe exactly the same order of sequence of
messages.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_READ_BATCH_SIZE
The default read batch size.
|
static boolean |
DEFAULT_STATISTICS_ENABLED
Default value for statistics enabled.
|
static TopicOverloadPolicy |
DEFAULT_TOPIC_OVERLOAD_POLICY
The default slow consumer policy.
|
Constructor and Description |
---|
ReliableTopicConfig(String name)
Creates a new ReliableTopicConfig with default settings.
|
Modifier and Type | Method and Description |
---|---|
ReliableTopicConfig |
addMessageListenerConfig(ListenerConfig listenerConfig)
Adds a message listener (listens for when messages are added or removed) to this reliable topic.
|
ReliableTopicConfig |
getAsReadOnly()
Returns a readonly version of the ReliableTopicConfig.
|
Executor |
getExecutor()
Gets the Executor that is going to process the events.
|
List<ListenerConfig> |
getMessageListenerConfigs()
Gets the list of message listeners (listens for when messages are added or removed) for this reliable topic.
|
String |
getName()
Gets the name of the reliable topic.
|
int |
getReadBatchSize()
Gets the maximum number of items to read in a batch.
|
TopicOverloadPolicy |
getTopicOverloadPolicy()
Gets the TopicOverloadPolicy for this reliable topic.
|
boolean |
isStatisticsEnabled()
Checks if statistics are enabled for this reliable topic.
|
ReliableTopicConfig |
setExecutor(Executor executor)
Sets the Executor that is going to process the event.
|
ReliableTopicConfig |
setReadBatchSize(int readBatchSize)
Sets the read batch size.
|
ReliableTopicConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics for this reliable topic..
|
ReliableTopicConfig |
setTopicOverloadPolicy(TopicOverloadPolicy topicOverloadPolicy)
Sets the TopicOverloadPolicy for this reliable topic.
|
String |
toString() |
public static final int DEFAULT_READ_BATCH_SIZE
public static final TopicOverloadPolicy DEFAULT_TOPIC_OVERLOAD_POLICY
public static final boolean DEFAULT_STATISTICS_ENABLED
public ReliableTopicConfig(String name)
public String getName()
public TopicOverloadPolicy getTopicOverloadPolicy()
public ReliableTopicConfig setTopicOverloadPolicy(TopicOverloadPolicy topicOverloadPolicy)
TopicOverloadPolicy
for more details about
this setting.topicOverloadPolicy
- the new TopicOverloadPolicy.IllegalArgumentException
- if topicOverloadPolicy is null.public Executor getExecutor()
ExecutionService.ASYNC_EXECUTOR
is used.setExecutor(java.util.concurrent.Executor)
public ReliableTopicConfig setExecutor(Executor executor)
executor
- the Executor. if the executor is null, the ExecutionService.ASYNC_EXECUTOR
will
be used to process the event.public int getReadBatchSize()
public ReliableTopicConfig setReadBatchSize(int readBatchSize)
readBatchSize
- the maximum number of items to read in a batch.IllegalArgumentException
- if readBatchSize is smaller than 1.public boolean isStatisticsEnabled()
public ReliableTopicConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- true to enable statistics, false to disable.public List<ListenerConfig> getMessageListenerConfigs()
public ReliableTopicConfig addMessageListenerConfig(ListenerConfig listenerConfig)
listenerConfig
- the ListenerConfig to add.NullPointerException
- if listenerConfig is null.public ReliableTopicConfig getAsReadOnly()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.