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 |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSubscriberManager(Class<T> type,
ITraceContextFactory traceFactory,
IThreadSafeErrorConsumer<P> unprocessableMessageConsumer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertConfigurable() |
protected ITraceContextFactory |
getTraceFactory() |
long |
handleMessage(IThreadSafeRetryableConsumer<P> consumer,
P payload,
ITraceContext trace,
String messageId)
Handle the given message.
|
protected void |
setLifeCycleState(FugueLifecycleState arg0) |
void |
start() |
protected abstract void |
startSubscription(Subscription<P> subscription) |
void |
stop() |
protected abstract void |
stopSubscriptions()
Stop all subscribers.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionName,
List<String> topicNames)
Subscribe to the given subscription on the given topics.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionName,
String[] topicNames)
Subscribe to the given subscription on the given topics.
|
T |
withSubscription(IThreadSafeRetryableConsumer<P> consumer,
String subscriptionName,
String topicName,
String... additionalTopicNames)
Subscribe to the given subscription on the given topics.
|
getSubscribersclone, 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(Class<T> type, ITraceContextFactory traceFactory, IThreadSafeErrorConsumer<P> unprocessableMessageConsumer)
public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionName, String topicName, String... additionalTopicNames)
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.subscriptionName - A subscription name.topicName - A topic name.additionalTopicNames - An optional list of additional topic names.public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionName, List<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.subscriptionName - A subscription name.topicNames - A list of topic names.public T withSubscription(IThreadSafeRetryableConsumer<P> consumer, String subscriptionName, 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.subscriptionName - A subscription name.topicNames - A list of topic names.protected abstract void startSubscription(Subscription<P> subscription)
protected abstract void stopSubscriptions()
protected ITraceContextFactory getTraceFactory()
public void start()
start 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.