Backend Batch Adapter
Adapter that delivers events to a first-party backend endpoint as batched HTTP POST requests.
Events are persisted to the local Room database before any network attempt. This adapter's deliver is a no-op — the dispatcher already wrote the event to the database as EventState.QUEUED. The actual network send happens in flush, which is triggered by FlushScheduler.
Retry policy: truncated exponential backoff with full jitter. Events that exhaust maxRetries are moved atomically to the dead-letter table. HTTP 400 responses move events to the DLQ immediately (the payload is structurally broken and will keep failing). HTTP 429 responses additionally halve the next batch size to reduce load on a recovering server.
Since
1.0.0
Parameters
Full URL of the batch ingest endpoint, e.g. "https://api.example.com/v1/events".
Bearer token for the Authorization header, if required.
Properties
Functions
Decide whether this adapter wants the given event.
No-op: the event is already in the DB as QUEUED when this is called.
Drains the queue: reads batches of effectiveBatchSize and POSTs them until the queue is empty or a non-retryable error halts further sends.
Called once during in.singhangad.eventtracker.EventTracker.initialize. Use this to initialise any underlying SDK, open connections, or set up resources.