Class AbstractSubscriberManager<T extends AbstractSubscriberManager<T>>

  • Type Parameters:
    T - Type of concrete manager, needed for fluent methods.
    All Implemented Interfaces:
    org.symphonyoss.s2.common.fluent.IFluent<T>, org.symphonyoss.s2.fugue.IFugueComponent, org.symphonyoss.s2.fugue.IFugueLifecycleComponent, ISubscriberManager<T>
    Direct Known Subclasses:
    AbstractPullSubscriberManager

    public abstract class AbstractSubscriberManager<T extends AbstractSubscriberManager<T>>
    extends org.symphonyoss.s2.fugue.FugueLifecycleComponent<T>
    implements ISubscriberManager<T>
    Base class for subscriber managers.
    Author:
    Bruce Skingle
    • Field Detail

      • FAILED_DEAD_LETTER_RETRY_TIME

        protected static final long FAILED_DEAD_LETTER_RETRY_TIME
      • FAILED_CONSUMER_RETRY_TIME

        protected static final long FAILED_CONSUMER_RETRY_TIME
      • nameFactory_

        protected final org.symphonyoss.s2.fugue.naming.INameFactory nameFactory_
      • subscribers_

        protected final com.google.common.collect.ImmutableList<ISubscription> subscribers_
      • traceFactory_

        protected final org.symphonyoss.s2.fugue.core.trace.ITraceContextTransactionFactory traceFactory_
      • unprocessableMessageConsumer_

        protected final org.symphonyoss.s2.fugue.pipeline.IThreadSafeErrorConsumer<String> unprocessableMessageConsumer_
      • config_

        protected final org.symphonyoss.s2.fugue.config.IConfiguration config_
      • counter_

        protected final org.symphonyoss.s2.fugue.counter.ICounter counter_
      • totalSubscriptionCnt_

        protected final int totalSubscriptionCnt_
    • Method Detail

      • getCounter

        protected org.symphonyoss.s2.fugue.counter.ICounter getCounter()
      • initSubscription

        protected abstract void initSubscription​(ISubscription subscription)
      • startSubscriptions

        protected abstract void startSubscriptions()
      • stopSubscriptions

        protected abstract void stopSubscriptions()
        Stop all subscribers.
      • getTraceFactory

        protected org.symphonyoss.s2.fugue.core.trace.ITraceContextTransactionFactory getTraceFactory()
      • start

        public void start()
        Specified by:
        start in interface org.symphonyoss.s2.fugue.IFugueComponent
      • quiesce

        public void quiesce()
        Specified by:
        quiesce in interface org.symphonyoss.s2.fugue.IFugueComponent
      • stop

        public void stop()
        Specified by:
        stop in interface org.symphonyoss.s2.fugue.IFugueComponent
      • handleMessage

        public long handleMessage​(org.symphonyoss.s2.fugue.pipeline.IThreadSafeRetryableConsumer<String> consumer,
                                  String payload,
                                  org.symphonyoss.s2.fugue.core.trace.ITraceContext trace,
                                  String messageId)
        Handle the given message.
        Parameters:
        consumer - The consumer for the message.
        payload - A received message.
        trace - A trace context.
        messageId - A unique ID for the message.
        Returns:
        The number of milliseconds after which a retry should be made, or -1 if the message was processed and no retry is necessary.
      • assertConfigurable

        protected void assertConfigurable()
      • setLifeCycleState

        protected void setLifeCycleState​(org.symphonyoss.s2.fugue.FugueLifecycleState arg0)
      • getLifecycleState

        public org.symphonyoss.s2.fugue.FugueLifecycleState getLifecycleState()