pub struct WebhookSubscriber {
pub id: String,
pub url: String,
pub event_pattern: String,
pub headers: HashMap<String, String>,
pub retry_count: u32,
pub timeout_ms: u64,
pub retry: EventRetryConfig,
}Expand description
Delivers events via HTTP POST to a webhook URL.
Delivery contract (spec docs/features/event-system.md §Event Delivery
Semantics, Issue #61): on_event performs a single HTTP attempt and
returns Err(ModuleError) on 5xx or network errors so that the
surrounding EventEmitter retry+DLQ policy
(configured via retry) applies uniformly across subscriber types.
4xx responses are non-retryable client errors — they are logged at WARN
and reported as Ok to suppress the spec retry loop.
Requires the events cargo feature for actual HTTP delivery.
Fields§
§id: String§url: String§event_pattern: String§headers: HashMap<String, String>§retry_count: u32Deprecated alias for retry.max_attempts. Retained as a
public field for backward-compatible construction; new code should
configure retry instead. When both are present in YAML the spec
requires retry.max_attempts to win — that resolution happens in
build_webhook_subscriber.
timeout_ms: u64§retry: EventRetryConfigRetry policy applied by EventEmitter — see
spec §Event Delivery Semantics (#61).
Implementations§
Source§impl WebhookSubscriber
impl WebhookSubscriber
pub fn new( id: impl Into<String>, url: impl Into<String>, event_pattern: impl Into<String>, ) -> Self
Sourcepub fn with_retry(self, retry: EventRetryConfig) -> Self
pub fn with_retry(self, retry: EventRetryConfig) -> Self
Override the retry policy applied by EventEmitter.
Trait Implementations§
Source§impl Clone for WebhookSubscriber
impl Clone for WebhookSubscriber
Source§fn clone(&self) -> WebhookSubscriber
fn clone(&self) -> WebhookSubscriber
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebhookSubscriber
impl Debug for WebhookSubscriber
Source§impl EventSubscriber for WebhookSubscriber
impl EventSubscriber for WebhookSubscriber
Source§fn subscriber_id(&self) -> &str
fn subscriber_id(&self) -> &str
Source§fn subscriber_type(&self) -> &str
fn subscriber_type(&self) -> &str
apcore.event.delivery_failed
DLQ payloads as subscriber_type (sync finding A-D-029). Read more