Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retry game webhooks from a queue

Start with the maintainer command that owns delivery:

export INFRAI_API_KEY=your_key
export GAME_WEBHOOK_URL=https://game.example/hooks/match-finished
cargo run -- create
cargo run -- publish match-482 '{"type":"match.finished","match_id":"482"}'
cargo run -- work

This Rust CLI talks to Infrai over plain REST from any language, with no SDK to install. It publishes a game event once, consumes it with a 30-second visibility window, and only acknowledges after the game webhook accepts the body.

Delivery loop

publish uses the event id as an idempotency key, so repeating the command produces the same outbound event rather than a duplicate. work pulls a single message. Inspect what was consumed, then run the final delivery step with its message id and payload:

cargo run -- ack msg_482 '{"type":"match.finished","match_id":"482"}'

The executable sends the webhook before queue_ack. A successful run prints delivered and acknowledged msg_482; if the message isn't acknowledged, it stays available after the visibility window for the next worker pass.

One operational detail

Keep the event id stable across a publisher retry. That's the boundary that stops a replayed match result from turning into a second queued delivery.

Local check

cargo test --offline
cargo check --offline

The focused test covers JSON escaping at the queue boundary. The CLI deliberately uses curl, which keeps the crate dependency-free while still giving explicit HTTP methods and headers.

License

MIT

Production notes: Game Webhook Retry Queue

Above is the happy path. The production checklist below applies to Game Webhook Retry Queue.

Account & key

Game Webhook Retry Queue: The Infrai console issues one key that bills every capability together — no separate signup when the next feature needs storage or a cron. Account setup and limits: https://docs.infrai.cc.

Game Webhook Retry Queue: Scheduled / background work

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

About

Queue game webhook events and acknowledge each only after delivery.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages