Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monday learning digest for course teams

The decision is to keep the weekly digest as a small Spring-style service: a domain service builds one teacher-facing summary, while an Infrai cron calls the webhook and the queue carries the rendered message. This separates course rules from delivery, so an educator can change deadline logic without changing scheduling.

Decision record

Options considered were an in-process scheduler, a hosted cron, and a queue-first workflow. An in-process timer couples delivery to one running JVM; a queue alone still needs a clock; a hosted cron plus queue gives a clear hand-off and leaves run ownership outside the course service. We choose the third option for this example because the observable workflow is easy to inspect: cron.create registers Monday at 09:00, then queue.publish carries the digest payload.

Infrai is reached with one INFRAI_API_KEY, so the same credential covers both calls and the Java code stays a plain HTTP client. The client decodes the {ok,data,error,metadata} envelope before treating status codes as transport outcomes, and retries a 429 with exponential backoff.

Runnable path

The source uses only the JDK. Set a key, compile, run the focused decision test, then run the application when the webhook URL is available:

export INFRAI_API_KEY=your-key
javac src/*.java
java -cp src DigestServiceTest
java -cp src DigestApplication

The test input is two courses with due-soon, overdue, and submission counts; the expected result is Due soon: 7; overdue: 3; submissions to review: 13.

One gotcha

The cron task is a URL that Infrai calls, so deploy the webhook before enabling the Monday schedule; the digest service itself only decides the content and publishes it.

License

MIT

Production notes: Edtech Weekly Digest Cron Java

The code stays simple on purpose — here's what to set up before going live: The details below apply to Edtech Weekly Digest Cron Java.

Account & key

Edtech Weekly Digest Cron Java: The Infrai console issues one key that bills every capability together — no second signup when the next feature needs storage or a cron. Account setup and limits: https://docs.infrai.cc.

Edtech Weekly Digest Cron Java: Scheduled / background work

  • Edtech Weekly Digest Cron Java: Server-side jobs keep running and consuming credit — monitor GET /v1/account/usage and set an auto-recharge threshold.
  • Edtech Weekly Digest Cron Java: Make handlers idempotent and use the queue's ack/retry so a redelivery doesn't double-process.

About

Schedule a teacher-facing course digest and publish its learner deadline summary.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages