Interface PagedTopicService
- All Superinterfaces:
CacheService
,ClassLoaderAware
,Controllable
,DistributedCacheService
,PartitionedService
,Service
,Service
,com.tangosol.internal.tracing.SpanDecorator
,TopicService
A
TopicService
which provides globally ordered topics.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.CacheService
CacheService.CacheAction
Nested classes/interfaces inherited from interface com.tangosol.net.PartitionedService
PartitionedService.PartitionedAction, PartitionedService.PartitionRecoveryAction
Nested classes/interfaces inherited from interface com.tangosol.net.Service
Service.MemberJoinAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Topic API version zero 14.1.1.2206.2 and below 22.09static final int
Topic API version one 14.1.1.2206.3 - 14.1.1.2206.5 23.03.0 - 22.03.1static final int
Topic API version two 14.1.1.2206.6 -> and above 23.03.2 and abovestatic final int
Topic API version three 15.1.1.0.0 -> and above patch compatible 14.1.2.0.4 patch compatible 14.1.1.2206.14Fields inherited from interface com.tangosol.net.CacheService
TYPE_DISTRIBUTED, TYPE_FEDERATED, TYPE_LOCAL, TYPE_OPTIMISTIC, TYPE_PAGED_TOPIC, TYPE_REMOTE, TYPE_REMOTE_GRPC, TYPE_REPLICATED
Fields inherited from interface com.tangosol.net.TopicService
TYPE_PAGED_TOPIC, TYPE_REMOTE, TYPE_REMOTE_GRPC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubscriptionListener
(com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription.Listener listener) Add a listener that will be notified when changes are made to topic subscriptions.void
destroySubscription
(long lSubscriptionId) Remove an existing subscriber group.void
destroySubscription
(long lSubscriptionId, Subscriber.Id subscriberId) Remove an existing subscriber from a subscriber group.void
ensureSubscription
(String sTopicName, long lSubscription, Subscriber.Id subscriberId) Ensure the specified subscriber is subscribed to a subscription.void
ensureSubscription
(String sTopicName, long lSubscription, Subscriber.Id subscriberId, boolean fForceReconnect) Ensure the specified subscriber is subscribed to a subscription.void
ensureSubscription
(String sTopicName, long lSubscription, Subscriber.Id subscriberId, boolean fForceReconnect, int[] anChannel) Ensure the specified subscriber is subscribed to a subscription.long
ensureSubscription
(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId, Subscriber.Id subscriberId, Filter<?> filter, ValueExtractor<?, ?> extractor) Ensure the specified subscriber is created in a subscription.long
ensureSubscription
(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId, Subscriber.Id subscriberId, Filter<?> filter, ValueExtractor<?, ?> extractor, int[] anChannel) Ensure the specified subscriber is created in a subscription.int
Return the minimum topics API version supported by the cluster members.int
getRemainingMessages
(String sTopic, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId subscriberGroupId, int... anChannel) Return the number messages remaining in the topic after the last committed message.Set
<com.tangosol.internal.net.topic.impl.paged.model.SubscriberId> getSubscribers
(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId) Returns thesubscriber ids
known to this service and subscribed to a subscriber group for a topic .com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription
getSubscription
(long lSubscriptionId) Return aPagedTopicSubscription
.long
getSubscriptionCount
(String sTopicName) Returns the count of subscriptions for the specified topic.long
getSubscriptionId
(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId) Return the subscription id for a subscriber group.com.tangosol.internal.net.topic.impl.paged.statistics.PagedTopicStatistics
getTopicStatistics
(String sTopicName) Returns thePagedTopicStatistics
for a topic.boolean
hasSubscribers
(String sTopicName) Returnstrue
if the specified topic has subscribers or subscriber groups.boolean
hasSubscription
(long lSubscriptionId) Determine whether a subscriber group exists.boolean
isSubscriptionDestroyed
(long lSubscriptionId) Determine whether a subscriber group has been destroyed.void
removeSubscriptionListener
(com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription.Listener listener) Remove a listener that was being notified when changes are made to topic subscriptions.Methods inherited from interface com.tangosol.net.CacheService
destroyCache, ensureCache, getBackingMapManager, getCacheNames, releaseCache, setBackingMapManager
Methods inherited from interface com.tangosol.io.ClassLoaderAware
getContextClassLoader, setContextClassLoader
Methods inherited from interface com.tangosol.util.Controllable
configure, isRunning, shutdown, start, stop
Methods inherited from interface com.tangosol.net.DistributedCacheService
getStorageEnabledMembers, isLocalStorageEnabled
Methods inherited from interface com.tangosol.net.PartitionedService
addPartitionListener, getBackupCount, getBackupOwner, getBackupStrength, getBackupStrengthName, getKeyAssociator, getKeyOwner, getKeyPartitioningStrategy, getOwnedPartitions, getOwnedPartitions, getOwnershipEnabledMembers, getOwnershipSenior, getOwnershipVersion, getPartitionAssignmentStrategy, getPartitionCount, getPartitionOwner, getPersistenceMode, instantiateKeyToBinaryConverter, removePartitionListener
Methods inherited from interface com.tangosol.net.Service
addMemberListener, getCluster, getDependencies, getInfo, getMinimumServiceVersion, getResourceRegistry, getSerializer, getUserContext, isSuspended, isVersionCompatible, isVersionCompatible, isVersionCompatible, isVersionCompatible, removeMemberListener, setDependencies, setUserContext
Methods inherited from interface com.tangosol.util.Service
addServiceListener, removeServiceListener
Methods inherited from interface com.tangosol.internal.tracing.SpanDecorator
decorate
Methods inherited from interface com.tangosol.net.TopicService
destroyTopic, ensureChannelCount, ensureChannelCount, ensureTopic, getChannelCount, getSubscriberGroups, getTopicBackingMapManager, getTopicNames, releaseTopic, setTopicBackingMapManager
-
Field Details
-
TOPIC_API_v0
static final int TOPIC_API_v0Topic API version zero 14.1.1.2206.2 and below 22.09.*- See Also:
-
TOPIC_API_v1
static final int TOPIC_API_v1Topic API version one 14.1.1.2206.3 - 14.1.1.2206.5 23.03.0 - 22.03.1- See Also:
-
TOPIC_API_v2
static final int TOPIC_API_v2Topic API version two 14.1.1.2206.6 -> and above 23.03.2 and above- See Also:
-
TOPIC_API_v3
static final int TOPIC_API_v3Topic API version three 15.1.1.0.0 -> and above patch compatible 14.1.2.0.4 patch compatible 14.1.1.2206.14- See Also:
-
-
Method Details
-
ensureSubscription
long ensureSubscription(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId, Subscriber.Id subscriberId, Filter<?> filter, ValueExtractor<?, ?> extractor) Ensure the specified subscriber is created in a subscription.- Parameters:
sTopicName
- the name of the topicgroupId
- theid
of the subscriber groupsubscriberId
- theSubscriber.Id
filter
- theFilter
to use to filter messages sent to subscribersextractor
- theValueExtractor
to use to convert messages sent to subscribers- Returns:
- the unique identifier of the subscriber group the
Subscriber
is subscribed to, of-1
if the cluster is not version compatible and cannot create subscriptions
-
ensureSubscription
long ensureSubscription(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId, Subscriber.Id subscriberId, Filter<?> filter, ValueExtractor<?, ?> extractor, int[] anChannel) Ensure the specified subscriber is created in a subscription.- Parameters:
sTopicName
- the name of the topicgroupId
- theid
of the subscriber groupsubscriberId
- theSubscriber.Id
filter
- theFilter
to use to filter messages sent to subscribersextractor
- theValueExtractor
to use to convert messages sent to subscribersanChannel
- the channels to manually allocate to the subscriber- Returns:
- the unique identifier of the subscriber group the
Subscriber
is subscribed to, of-1
if the cluster is not version compatible and cannot create subscriptions
-
ensureSubscription
Ensure the specified subscriber is subscribed to a subscription.- Parameters:
sTopicName
- the name of the topiclSubscription
- the unique id of the subscriber groupsubscriberId
- theSubscriber.Id
-
ensureSubscription
void ensureSubscription(String sTopicName, long lSubscription, Subscriber.Id subscriberId, boolean fForceReconnect) Ensure the specified subscriber is subscribed to a subscription.- Parameters:
sTopicName
- the name of the topiclSubscription
- the unique id of the subscriber groupsubscriberId
- theSubscriber.Id
fForceReconnect
- force a reconnection even if the subscriber is known to the service
-
ensureSubscription
void ensureSubscription(String sTopicName, long lSubscription, Subscriber.Id subscriberId, boolean fForceReconnect, int[] anChannel) Ensure the specified subscriber is subscribed to a subscription.- Parameters:
sTopicName
- the name of the topiclSubscription
- the unique id of the subscriber groupsubscriberId
- theSubscriber.Id
fForceReconnect
- force a reconnection even if the subscriber is known to the service
-
destroySubscription
Remove an existing subscriber from a subscriber group.- Parameters:
lSubscriptionId
- the subscription identifiersubscriberId
- theSubscriber.Id
-
destroySubscription
void destroySubscription(long lSubscriptionId) Remove an existing subscriber group.- Parameters:
lSubscriptionId
- the subscription identifier
-
hasSubscription
boolean hasSubscription(long lSubscriptionId) Determine whether a subscriber group exists.- Parameters:
lSubscriptionId
- the id of the subscription to return- Returns:
true
if the group exists
-
isSubscriptionDestroyed
boolean isSubscriptionDestroyed(long lSubscriptionId) Determine whether a subscriber group has been destroyed.- Parameters:
lSubscriptionId
- the unique identifier of the subscriber group- Returns:
true
if the group has been destroyed
-
getSubscription
com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription getSubscription(long lSubscriptionId) Return aPagedTopicSubscription
.- Parameters:
lSubscriptionId
- the id of the subscription to return- Returns:
- the specified
PagedTopicSubscription
ornull
if the subscription does not exist.
-
getSubscriptionId
long getSubscriptionId(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId) Return the subscription id for a subscriber group.- Parameters:
sTopicName
- the name of the topicgroupId
- theidentifier
for the subscriber group- Returns:
- the subscription id for a subscriber group or zero if the subscription does not exist.
-
getTopicStatistics
com.tangosol.internal.net.topic.impl.paged.statistics.PagedTopicStatistics getTopicStatistics(String sTopicName) Returns thePagedTopicStatistics
for a topic.- Parameters:
sTopicName
- the name of the topic- Returns:
- the
PagedTopicStatistics
for the topic ornull
if no statistics exist for the topic
-
getSubscribers
Set<com.tangosol.internal.net.topic.impl.paged.model.SubscriberId> getSubscribers(String sTopicName, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId groupId) Returns thesubscriber ids
known to this service and subscribed to a subscriber group for a topic .- Returns:
- the
subscriber ids
known to this service and subscribed to a subscriber group for a topic
-
hasSubscribers
Returnstrue
if the specified topic has subscribers or subscriber groups.- Parameters:
sTopicName
- the name of the topic- Returns:
true
if the specified topic has subscribers or subscriber groups
-
getSubscriptionCount
Returns the count of subscriptions for the specified topic.- Parameters:
sTopicName
- the name of the topic- Returns:
- the count of subscriptions for the specified topic
-
addSubscriptionListener
void addSubscriptionListener(com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription.Listener listener) Add a listener that will be notified when changes are made to topic subscriptions.- Parameters:
listener
- the listener to add
-
removeSubscriptionListener
void removeSubscriptionListener(com.tangosol.internal.net.topic.impl.paged.model.PagedTopicSubscription.Listener listener) Remove a listener that was being notified when changes are made to topic subscriptions.- Parameters:
listener
- the listener to remove
-
getRemainingMessages
int getRemainingMessages(String sTopic, com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId subscriberGroupId, int... anChannel) Return the number messages remaining in the topic after the last committed message.This value is a count of messages remaining to be polled after the last committed message. If a subscriber has received multiple messages but not committed any of them then the count of remaining messages will remain unchanged.
This value is transitive and could already have changed by another in-flight commit request immediately after this value is returned.
Note, getting the total remaining messages count is a cluster wide operation as the value is stored by each member.
- Parameters:
sTopic
- the name of the topicsubscriberGroupId
- the subscriber groupanChannel
- the channels to get the remaining message count from, or specify no channels to return the count for all channels- Returns:
- the number of unread messages
-
getCurrentClusterTopicsApiVersion
int getCurrentClusterTopicsApiVersion()Return the minimum topics API version supported by the cluster members.- Returns:
- the minimum topics API version supported by cluster members
-