P - Type of payload received.T - Type of concrete manager, needed for fluent methods.public abstract class AbstractSubscriberManager<P,T extends ISubscriberManager<P,T>> extends AbstractSubscriberBase<P,T> implements ISubscriberManager<P,T>
| Modifier and Type | Field and Description |
|---|---|
protected static long |
FAILED_CONSUMER_RETRY_TIME |
protected static long |
FAILED_DEAD_LETTER_RETRY_TIME |
protected static long |
MESSAGE_PROCESSED_OK |
nameFactory_, subscribers_| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSubscriberManager(INameFactory nameFactory,
Class<T> type,
ITraceContextTransactionFactory traceFactory,
IThreadSafeErrorConsumer<P> unprocessableMessageConsumer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertConfigurable() |
protected ITraceContextTransactionFactory |
getTraceFactory() |
long |
handleMessage(IThreadSafeRetryableConsumer<P> consumer,
P payload,
ITraceContext trace,
String messageId)
Handle the given message.
|
protected abstract void |
initSubscription(SubscriptionImpl<P> subscription) |
void |
quiesce() |
protected void |
setLifeCycleState(FugueLifecycleState arg0) |
void |
start() |
protected abstract void |
startSubscriptions() |
void |
stop() |
protected abstract void |
stopSubscriptions()
Stop all subscribers.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionId,
Collection<TopicName> topicNames)
Subscribe to the given subscription on the given topics.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionId,
String[] topicNames)
Subscribe to the given subscription on the given topics.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionId,
String topicId,
String... additionalTopicIds)
Subscribe to the given subscription on the given topics.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
Subscription subscription) |
getSubscribers, getTotalSubscriptionCntclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetComponentId, getComponentState, getComponentStatusMessageprotected static final long FAILED_DEAD_LETTER_RETRY_TIME
protected static final long FAILED_CONSUMER_RETRY_TIME
protected static final long MESSAGE_PROCESSED_OK
protected AbstractSubscriberManager(INameFactory nameFactory, Class<T> type, ITraceContextTransactionFactory traceFactory, IThreadSafeErrorConsumer<P> unprocessableMessageConsumer)
public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, Subscription subscription)
withSubscription in interface ISubscriberManager<P,T extends ISubscriberManager<P,T>>withSubscription in class AbstractSubscriberBase<P,T extends ISubscriberManager<P,T>>public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionId, String topicId, String... additionalTopicIds)
ISubscriberManagerwithSubscription in interface ISubscriberManager<P,T extends ISubscriberManager<P,T>>withSubscription in class AbstractSubscriberBase<P,T extends ISubscriberManager<P,T>>consumer - A consumer for received messages.subscriptionId - A subscription name.topicId - A topic name.additionalTopicIds - An optional list of additional topic names.public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionId, Collection<TopicName> topicNames)
ISubscriberManagerwithSubscription in interface ISubscriberManager<P,T extends ISubscriberManager<P,T>>withSubscription in class AbstractSubscriberBase<P,T extends ISubscriberManager<P,T>>consumer - A consumer for received messages.subscriptionId - A subscription name.topicNames - A list of topic names.public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionId, String[] topicNames)
ISubscriberManagerwithSubscription in interface ISubscriberManager<P,T extends ISubscriberManager<P,T>>withSubscription in class AbstractSubscriberBase<P,T extends ISubscriberManager<P,T>>consumer - A consumer for received messages.subscriptionId - A subscription name.topicNames - A list of topic names.protected abstract void initSubscription(SubscriptionImpl<P> subscription)
protected abstract void startSubscriptions()
protected abstract void stopSubscriptions()
protected ITraceContextTransactionFactory getTraceFactory()
public void start()
start in interface IFugueComponentpublic void quiesce()
quiesce in interface IFugueComponentpublic void stop()
stop in interface IFugueComponentpublic long handleMessage(IThreadSafeRetryableConsumer<P> consumer, P payload, ITraceContext trace, String messageId)
consumer - The consumer for the message.payload - A received message.trace - A trace context.messageId - A unique ID for the message.protected void assertConfigurable()
protected void setLifeCycleState(FugueLifecycleState arg0)
Copyright © 2018 Symphony Software Foundation. All rights reserved.