Scheduled calls

Every service has work that runs at night: close the day, purge what expired, fetch a partner's file, remind a customer three days after they left a basket. Each team then installs the same things: a cron container per service, a service account whose password never changes, a lock so two replicas do not run it twice, and logs that say what happened only to whoever finds them.

With Meerkat, the service asks to be called later: a route, a path, and when. At that hour, the gateway makes the call through its own front door, with an identity, and keeps what answered. The service exposes an endpoint, as it already does; no library, no broker, nothing to install.

Every edition. Scheduled calls are in the Community edition, with nothing held back for Enterprise.

When: a calendar, an interval, or one date

{
  "name": "monday report",
  "routeId": "orders-api",
  "method": "POST",
  "path": "/jobs/report",
  "cron": "0 3 * * MON",
  "timezone": "Europe/Paris",
  "role": "orders-report"
}

No account behind the call

The call carries the roles the schedule asks for, and reaches exactly what those roles reach. Everything in front of the service applies to it as to a person: the route's rules, the per-endpoint security, the tenant's hours. There is no service account to create, and none to keep up to date. A schedule asking for the wrong role is not a hole: it is a call refused every night, with the sentence that says why on the console.

Headers the service expects can be added, a secret among them, written as a reference to the vault: it is read at the moment of the call, and neither the database, the API nor the console ever shows it.

At least once, and resumed after a crash

Every call carries a run identifier, the same on every attempt, so the service can ignore one it has already seen. A gateway that stops in the middle of a call is not the end of it: another sends the same run again. A call that meets a service still starting, a role not yet loaded or no answer at all is tried again thirty seconds later, then two minutes later. And a service that depends on something not there yet says so, with the hour to come back.

Long jobs report their progress

A job that takes an hour does not hold a request open for an hour. The service answers that it accepted the work, then reports as it goes: how far it is, a line in words ("7 233 / 9 882 records"), then how it ended. The console shows it live, as a bar along the row. A run that goes quiet is marked lost, or sent again identical, if the service said that is safe for it.

Close the quarter running: the bar along its row and in its drawer, the service's own words, 1 204 / 3 310 invoices locked, Cancel run, and the run before it, refused by the service, kept in Runs

Stopped, paused, run again

An operator cancels the run in flight, or pauses a schedule: the service learns it in the answer to its next report, and stops. A schedule can be brought forward to now, and a past run started again, with today's payload. A service can pause or resume all of its own schedules at once, by the labels it put on them.

What the operator sees

One live screen lists everything scheduled, filtered by tenant and service, with what each is for, its next run and its last. Its drawer keeps the history of every run: when, how it ended, what answered, which attempt it was. The audit trail records when a schedule starts failing and when it recovers, and nothing in between, so the trail says when it broke without drowning in every night's run.

There is no button to create one, on purpose: a schedule belongs to the service that needs it, which writes it through the API, from inside the cluster. Who may do that is decided on the screen's Access drawer.

The Scheduler screen: a cadence, a cron line and one date, each with what it is for under its name, its next run and its last

The Access drawer of the Scheduler: the three modes with Meerkat token chosen, its Mint a token button, and Only these services with the orders-api token listed

What it is not

A message queue: no fan-out to several consumers, no dead letters. One schedule, one call, at least once. If you need the other thing, you need a broker.

Go further