E
- type of item contained in the topicpublic class ReliableTopicProxy<E> extends AbstractDistributedObject<ReliableTopicService> implements ITopic<E>
ITopic
implementation for reliable topics.Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_BACKOFF_MS |
static int |
MAX_BACKOFF |
PARTITIONING_STRATEGY
Constructor and Description |
---|
ReliableTopicProxy(String name,
NodeEngine nodeEngine,
ReliableTopicService service,
ReliableTopicConfig topicConfig) |
Modifier and Type | Method and Description |
---|---|
String |
addMessageListener(MessageListener<E> listener)
Subscribes to this topic.
|
LocalTopicStats |
getLocalTopicStats()
Returns statistics about this topic, like total number of publishes/receives.
|
String |
getName()
Returns the name of this ITopic instance.
|
String |
getServiceName()
Returns the service name for this object.
|
protected void |
postDestroy() |
void |
publish(E payload)
Publishes the message to all subscribers of this topic.
|
boolean |
removeMessageListener(String registrationId)
Stops receiving messages for the given message listener.
|
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, preDestroy, throwNotActiveException, toData, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey
public static final int MAX_BACKOFF
public static final int INITIAL_BACKOFF_MS
public ReliableTopicProxy(String name, NodeEngine nodeEngine, ReliableTopicService service, ReliableTopicConfig topicConfig)
public String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<ReliableTopicService>
public String getName()
ITopic
getName
in interface DistributedObject
getName
in interface ITopic<E>
public void publish(E payload)
ITopic
public String addMessageListener(MessageListener<E> listener)
ITopic
MessageListener.onMessage(Message)
method of the given
MessageListener is called.
More than one message listener can be added on one instance.addMessageListener
in interface ITopic<E>
listener
- the MessageListener to addpublic boolean removeMessageListener(String registrationId)
ITopic
If the given listener already removed, this method does nothing.
removeMessageListener
in interface ITopic<E>
registrationId
- ID of listener registrationtrue
if registration is removed, false
otherwiseprotected void postDestroy()
postDestroy
in class AbstractDistributedObject<ReliableTopicService>
public LocalTopicStats getLocalTopicStats()
ITopic
getLocalTopicStats
in interface ITopic<E>
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.