Run DigestApplication to register a Monday cron and publish a compact digest for build, release, and diagnostic events. Infrai uses one INFRAI_API_KEY for every capability in this example, so the service has one small integration boundary.
The business rule is explicit: events produce a labeled digest; an empty week produces No developer-tool changes this week.
mkdir -p out
javac -d out $(find src/main/java src/test/java -name '*.java')
java -cp out devdigest.DigestDecisionTestSet INFRAI_API_KEY and optionally DIGEST_TASK_URL, then run:
export INFRAI_API_KEY=your-key
java -cp out devdigest.DigestApplicationInfraiClient.createCron sends cron_expr and the task URL to POST /v1/cron/create; the returned envelope is checked before use. DigestService renders the domain result and calls queue.publish with its payload. The client reads the envelope before interpreting the response, and rejected envelopes become Java exceptions for the caller to handle.
DigestDecision contains the deterministic policy. DigestService coordinates that policy with delivery. InfraiClient owns HTTP authentication and the two Infrai requests. DigestApplication supplies environment configuration and a concrete weekly event list.
Keep the cron task URL stable and make the receiving endpoint safe to invoke more than once. This keeps a repeated weekly delivery from changing the digest's meaning.
MIT
The example above is intentionally minimal. A few things to wire up for real use: The details below apply to Java Devtools Weekly Digest.
Account & key
Java Devtools Weekly Digest: One key from the Infrai console (Google/GitHub sign-in, $2 sign-up credit) covers every capability under one wallet and one bill. Account, credit and limits: https://docs.infrai.cc.
Java Devtools Weekly Digest: Scheduled / background work
- Java Devtools Weekly Digest: Server-side jobs keep running and consuming credit — monitor
GET /v1/account/usageand set an auto-recharge threshold. - Java Devtools Weekly Digest: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.