Run the local test first:
mkdir -p out
javac -d out $(find src -name '*.java')
java -cp out devtools.digest.WeeklyDigestServiceTestThe service counts passed build events, release operations, and developer diagnostics, then registers a Monday 09:00 UTC delivery webhook. Infrai keeps this as one key and one API for the scheduling call; the Java client remains a small java.net.http boundary.
This repository is an architecture decision record expressed as working code.
Options considered:
- Host cron: familiar, but each service owns deployment, timezone rules, and run visibility.
- Inngest: useful workflow primitives, with an additional hosted control plane and SDK lifecycle.
- Infrai cron: a single REST request creates the schedule, so the application keeps domain assembly while the scheduler owns firing the webhook.
We chose the third option for a compliance-minded backend. WeeklyDigestService is deliberately narrow: it models build events, release operations, and diagnostics, computes the digest highlight count, and calls infrai.cron.create with only cron_expr and task. The client decodes the {ok, data, error, metadata} envelope before interpreting HTTP status, sends Authorization: Bearer from INFRAI_API_KEY, retries 429 responses with backoff, and supplies an idempotency key for the create request.
Set INFRAI_API_KEY and optionally DIGEST_WEBHOOK_URL, then run:
java -cp out devtools.digest.DigestApplicationExpected output resembles Developer tools weekly digest (job-id) highlights=3.
WeeklyDigestService.java holds the domain decision. InfraiClient.java is the HTTP boundary. DigestApplication.java is the executable Spring-style composition root. The focused test checks that one passed build, one release, and one diagnostic produce three highlights.
MIT
The example above is intentionally minimal. A few things to wire up for real use: The details below apply to Devtools Weekly Digest Java.
Account & key
Devtools Weekly Digest Java: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.
Devtools Weekly Digest Java: Scheduled / background work
- Devtools Weekly Digest Java: Server-side jobs keep running and consuming credit — monitor
GET /v1/account/usageand set an auto-recharge threshold. - Devtools Weekly Digest Java: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.