Skip to main content

Delivery Guarantees

By default, LiteJoin operates under a best-effort delivery model. If a sink fails to accept a result (HTTP timeout, Kafka broker unavailable), the result is logged and dropped. When at-least-once delivery is enabled, failed deliveries are captured in a persistent dead-letter queue (DLQ) backed by SQLite and retried automatically with exponential backoff.

Enabling At-Least-Once Delivery

How It Works

  1. The joiner attempts to deliver a result via sink.Send().
  2. If delivery fails, the result is serialized to JSON and written to the DLQ database.
  3. A background RetryWorker periodically scans for entries whose retry time has passed.
  4. On success, the entry is deleted from the DLQ.
  5. On failure, the entry’s retry count and next retry time are updated with exponential backoff.

Configuration Reference

Retry Backoff

Retries use exponential backoff with jitter:
Example progression with max_backoff: 5m:

Eviction Policies

Two independent policies control DLQ growth:
  • TTL-based: Entries older than ttl are deleted on cleanup sweeps.
  • Size-based: When the DLQ exceeds max_size_mb, oldest entries are removed until the file drops below 90% of the limit.

Important Considerations

Ordering is not guaranteed. Retried results may arrive after results produced later. Use the emit_at timestamp for ordering if needed.
Consumers must be idempotent. At-least-once delivery means duplicates are possible (original delivery succeeded but the response was lost, causing a retry). Design your consumers to handle duplicates.

Monitoring the DLQ

Key log messages: