Oban — Reliable and Observable Job Processing

Oban v2.2.0 is now available! It includes some minor bug fixes and several wonderful features from contributors :yellow_heart:. There are some large invisible architectural changes in this release that will require subscribers to upgrade to Oban Web v2.2.2 and Oban Pro v0.4.1.

Here are some highlights and attributions from the CHANGELOG:

Added

  • Replace local dynamically composed names with a registry. This dramatically simplifies locating nested children, avoids unnecessary atom creation at runtime and improves the performance of config lookups. Thanks to @sasajuric for all the hard work that went into making this change.

  • The new Oban.Repo module wraps interactions with underlying Ecto repos. This ensures consistent prefix and log level handling, while also adding full dynamic repo support. Also contributed by @sasajuric.

  • Augment the unique keys option with replace_args, which allows enqueuing a unique job and replacing the args subsequently. For example, given a job with these args:

    %{some_value: 1, id: 123}
    

    Attempting to insert a new job:

    %{some_value: 2, id: 123}
    |> MyJob.new(schedule_in: 10, replace_args: true unique: [keys: [:id]])
    |> Oban.insert()
    

    Will result in a single job with the args:

    %{some_value: 2, id: 123}
    

    Thanks to @Gazler for the feature suggestion and the PR itself.

Changed

  • The default backoff algorithm now includes a small amount of jitter. The jitter helps prevent jobs that fail simultaneously from repeatedly retrying together. Thanks to @coladarci for the feature request.
10 Likes