Skip to content
Weik.ioUniversity
Try Weik.io

Running an integration on a schedule

Patterns 3 · 3:15

A cron expression in the route runs the hello integration at set times, and one line lets one copy lead while a second copy on another agent stands by. Each environment has its own cron value.

Download the mp4Recorded on 2026.2

What it covers

  • Two agents in devtest, so every hello log line appears twice
  • A Quartz route with a six-field cron expression from the variable hello-cron
  • singleton: true as the one new line in the integration's file
  • A cron value per environment, every minute in devtest and two at night in production
  • Leader and standby in weikio get fleet, and the leader's lines in weikio logs
  • The leader and the standby in the Placement row of hello's page in the admin UI

Commands in this video

Terminal
$ weikio status sandbox/hello
$ weikio logs sandbox/hello --since 15s
$ weikio variable set sandbox/hello-cron '0 * * * * ?' --env devtest
$ weikio variable set sandbox/hello-cron '0 0 2 * * ?' --env production
$ weikio run ./hello --no-logs
$ weikio get fleet --env devtest
$ weikio logs sandbox/hello --since 67s --query 'hello again'
Transcript
  1. 0:01A job must run at set times, and only once.
  2. 0:05Two agents run hello, so it logs twice.
  3. 0:12Hello runs in the devtest environment, reading a variable and a secret.
  4. 0:20An admin added dev2 so devtest runs if dev goes away.
  5. 0:27weikio status shows the devtest deployment.
  6. 0:31Its version reads 0.1.4 on both agents.
  7. 0:36The log holds every message twice, once per agent.
  8. 0:40Both copies log on their own timers.
  9. 0:46The route now starts from Quartz, the scheduler Camel uses for a cron.
  10. 0:51Its cron is six fields with seconds first.
  11. 0:54The cron comes from the variable hello-cron.
  12. 0:58The integration file adds singleton: true as its one new line.
  13. 1:02That line lets one copy run the schedule while the other waits.
  14. 1:07Each environment can hold its own value for the cron.
  15. 1:12In devtest the schedule runs every minute.
  16. 1:20When hello runs in production it reads two at night.
  17. 1:24Both values go in before the run, because a value arrives at the next start.
  18. 1:30The run builds a new version and the deployment follows it.
  19. 1:37Both copies restart on 0.1.5, and the schedule waits for its minute.
  20. 1:47weikio get fleet lists every copy of every deployment.
  21. 1:51The ROLE column reads leader for dev and standby for dev2.
  22. 1:56The leader runs the schedule.
  23. 1:58The standby waits and takes over if the leader's agent goes away.
  24. 2:04weikio logs reads the log since the run.
  25. 2:09The two lines sit one minute apart, at second 00.
  26. 2:14Both lines come from dev, the copy that leads.
  27. 2:17Each line names its route and then its agent.
  28. 2:25hello's page in the admin UI reads dev leads in its Environments strip.
  29. 2:30The Runs row says one copy at a time, set by the integration.
  30. 2:35The Placement row names the leader and the standby.
  31. 2:41The Variables and secrets section shows both values of hello-cron.
  32. 2:46The section gives each environment its own column.
  33. 2:49Production holds the value and runs nothing.
  34. 2:56The route starts from Quartz with a cron.
  35. 2:59The cron comes from a variable with its own value in each environment.
  36. 3:03singleton: true lets one copy lead while the standby waits.

Next in this track

Patterns 4 · 3:49 React to database changes Watched