Class SubscriptionPublisher

  • All Implemented Interfaces:
    com.lmax.disruptor.EventHandler<EventPubSub.ChangeEventHolder>, com.lmax.disruptor.LifecycleAware, EventPublisher
    Direct Known Subclasses:
    EmailPublisher, GChatPublisher, GenericPublisher, MSTeamsPublisher, SlackEventPublisher

    public class SubscriptionPublisher
    extends AbstractAlertPublisher
    SubscriptionPublisher publishes events to the alert endpoint using POST http requests/ Email. There is one instance of SubscriptionPublisher per alert subscription. Each SubscriptionPublisher is an EventHandler that runs in a separate thread and receives events from LMAX Disruptor EventPubSub through BatchEventProcessor.

    The failures during callback to Alert are handled in this class as follows:

    • Alerts with unresolvable URLs are marked as "failed" and no further attempt is made to deliver the events
    • Alerts callbacks that return 3xx are marked as "failed" and no further attempt is made to deliver the events
    • Alerts callbacks that return 4xx, 5xx, or timeout are marked as "awaitingRetry" and 5 retry attempts are made to deliver the events with the following backoff - 3 seconds, 30 seconds, 5 minutes, 1 hours, and 24 hour. When all the 5 delivery attempts fail, the alerts state is marked as "retryLimitReached" and no further attempt is made to deliver the events.