Skip to content
Tracon

IWebhookPublisher

Namespace Tracon · Assembly Tracon.Abstractions.dll

The component that publishes an event to its subscriptions.

public interface IWebhookPublisher

Core code calls this; delivery does not happen in the request, it is written to a queue. This way a slow or unreachable recipient does not slow down the main path.

The observability rule applies here too: if publishing fails, the run continues, the error is only logged.

Delivery guarantee — AT-LEAST-ONCE. Each subscriber may receive the SAME event more than once: the delivery job retries a failed HTTP POST against the same WebhookDelivery.Id (see IWebhookStore’s remarks). Every attempt — the original and every retry — carries the SAME delivery id in the X-Tracon-Delivery header; a recipient that wants exactly-once processing MUST deduplicate on that header’s value itself. Tracon does not deduplicate on the recipient’s behalf.

PublishAsync(string, string, WebhookEventPayload, CancellationToken)

Section titled “ PublishAsync(string, string, WebhookEventPayload, CancellationToken)”

Writes an event to the queue.

ValueTask<int> PublishAsync(string tenantId, string eventType, WebhookEventPayload payload, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

eventType string

The event name. See WebhookEvents.

payload WebhookEventPayload

The event summary. Serialized and written to the body.

cancellationToken CancellationToken

The cancellation token.

ValueTask<int>

The number of deliveries created. 0 if there is no subscriber.