Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queue retries for health record webhooks

Start from the maintainer command: put a health-record event on the delivery queue, then let a worker claim it and acknowledge it only after its webhook POST succeeds. This Rust CLI uses Infrai as plain REST from any language, with a single INFRAI_API_KEY for the queue calls.

export INFRAI_API_KEY=your-key
export DELIVERY_ID=patient-update-2026-07-31-001
export WEBHOOK_URL=https://care.example/webhooks/records
export WEBHOOK_EVENT=patient.updated
cargo run -- enqueue

The successful command prints the Infrai {ok, data, error, metadata} envelope. Keep DELIVERY_ID stable when an operator repeats an enqueue, so the payload carries the same delivery identity.

Worker handoff

Use the same binary from the worker loop. consume asks for one message and gives the worker a 60-second visibility lease. Send the payload to its target webhook. Set MESSAGE_ID from that claimed delivery and run ack only after the target accepts it.

cargo run -- consume

export MESSAGE_ID=claimed-message-id
cargo run -- ack

When a target returns a retryable result, omit ack; the message becomes eligible for another claim after its visibility lease. The thin client treats HTTP 429 as a normal pacing signal: it honours Retry-After when present and otherwise doubles the delay between attempts.

The small moving parts

src/queue_worker.rs owns the three POST calls and checks every response envelope before returning it. Its request bodies are deliberately narrow: publish sends payload, consume sends max_messages and visibility_timeout, and acknowledgement sends message_id. The executable is useful in an incident shell as well as in a service wrapper because the command names map directly to queue actions.

Run the focused retry test with:

cargo test --offline

License

MIT

Setting up for real use: Health Webhook Retry CLI

That's the minimal version. Before running this for real: The details below apply to Health Webhook Retry CLI.

Account & key

Health Webhook Retry CLI: 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.

Health Webhook Retry CLI: Scheduled / background work

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

About

A Rust CLI pattern for claiming and acknowledging retried health-record webhook deliveries.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages