public abstract class AbstractSubscriberManager<T extends AbstractSubscriberManager<T>> extends FugueLifecycleComponent<T>
| Modifier and Type | Field and Description |
|---|---|
protected static long |
FAILED_CONSUMER_RETRY_TIME |
protected static long |
FAILED_DEAD_LETTER_RETRY_TIME |
| Constructor and Description |
|---|
AbstractSubscriberManager(Class<T> type,
INamingStrategy namingStrategy,
ITraceContextFactory traceFactory,
IThreadSafeRetryableConsumer<Reader> consumer,
IThreadSafeConsumer<Reader> unprocessableMessageConsumer) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertConfigurable() |
protected ITraceContextFactory |
getTraceFactory() |
protected T |
getTypedThis() |
long |
handleMessage(Reader item,
ITraceContext trace)
Handle the given message.
|
protected void |
setLifeCycleState(FugueLifecycleState arg0) |
void |
start() |
protected abstract void |
startSubscriptions(Map<String,Set<String>> subscriptionsByTopic,
Map<String,Set<String>> topicsBySubscription)
Start with the given subscriptions.
|
void |
stop() |
protected abstract void |
stopSubscriptions()
Stop all subscribers.
|
protected void |
transitionTo(FugueLifecycleState arg0) |
T |
withSubscription(String topicName,
String subscriptionName)
Subscribe to the given subscription on the given topic.
|
protected static final long FAILED_DEAD_LETTER_RETRY_TIME
protected static final long FAILED_CONSUMER_RETRY_TIME
public AbstractSubscriberManager(Class<T> type, INamingStrategy namingStrategy, ITraceContextFactory traceFactory, IThreadSafeRetryableConsumer<Reader> consumer, IThreadSafeConsumer<Reader> unprocessableMessageConsumer)
public T withSubscription(String topicName, String subscriptionName)
topicName - The name of the topic to subscribe to.subscriptionName - The name of the subscription to subscribe to.IllegalArgumentException - If a duplicate request is made.protected abstract void startSubscriptions(Map<String,Set<String>> subscriptionsByTopic, Map<String,Set<String>> topicsBySubscription)
subscriptionsByTopic - A map of topic names, each entry is a set of subscription names.topicsBySubscription - A map of subscription names, each entry is a set of topic names.protected abstract void stopSubscriptions()
protected ITraceContextFactory getTraceFactory()
public final void start()
public final void stop()
public long handleMessage(Reader item, ITraceContext trace)
item - A received message as a (possibly read-only) Reader.trace - A trace context.protected T getTypedThis()
protected void assertConfigurable()
protected void transitionTo(FugueLifecycleState arg0)
protected void setLifeCycleState(FugueLifecycleState arg0)
Copyright © 2018 Symphony Software Foundation. All rights reserved.