Class AlertWebhookDispatcher

java.lang.Object
dev.dokimos.server.service.AlertWebhookDispatcher

@Component public class AlertWebhookDispatcher extends Object
Delivers regression alerts to a project's enabled webhooks. Dispatch runs only after the run-completion transaction commits (TransactionalEventListener on TransactionPhase.AFTER_COMMIT) and on a separate thread (Async), so neither the webhook lookup nor the HTTP POST can block, lengthen, or roll back run completion. Every delivery failure is caught and logged; a failing or slow receiver never fails the run.

When a webhook has a signing secret, the request body is signed with HMAC-SHA256 and the lowercase hex digest is sent in the X-Dokimos-Signature header so receivers can verify authenticity.

  • Constructor Details

    • AlertWebhookDispatcher

      @Autowired public AlertWebhookDispatcher(AlertWebhookRepository webhookRepository, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • onRegressionAlert

      @Async @TransactionalEventListener(phase=AFTER_COMMIT) @Transactional(propagation=REQUIRES_NEW, readOnly=true) public void onRegressionAlert(RegressionAlertEvent event)
      Resolves the project's enabled webhooks and POSTs the alert to each. Runs after commit on an async thread; opens its own read-only transaction to load the webhooks because the original persistence context is gone by this point.
      Parameters:
      event - the regression alert published during run completion