Home

Awesome

Goose

Test & Lint Workflow Clojars Project cljdoc badge

The Next-Level background job processing library for Clojure.

Simple. Pluggable. Reliable. Extensible. Scalable.

Announcement 🔈

We are excited to announce that 5 companies are using Goose successfully and reliably in production environments. With the release of the Jobs Management Console, Goose has reached a level of maturity, offering a feature-rich, stable, and production-ready background job processing solution.

We plan to release Goose 1.0.0 on February 1st, 2025, marking API stability and ensuring backward-compatibility, with no downtime during upgrades.

We welcome feedback from current and new users, especially if you’d like to request features or suggest changes to the API or implementation before the 1.0.0 release. Please review our Architecture Decisions and Wiki for more context, and share your thoughts via GitHub Issues or the Clojurians Slack.

Performance

Please refer to the Benchmarking section.

Features

Getting Started

Clojars Project

Add Goose as a dependency

;;; Clojure CLI/deps.edn
com.nilenso/goose {:mvn/version "0.6.0"}

;;; Leiningen/Boot
[com.nilenso/goose "0.6.0"]

Client

(ns my-app
  (:require
    [goose.brokers.rmq.broker :as rmq]
    [goose.client :as c]))

(defn my-fn
  [arg1 arg2]
  (println "my-fn called with" arg1 arg2))

(let [rmq-producer (rmq/new-producer rmq/default-opts)
      ;; Along with RabbitMQ, Goose supports Redis as well.
      client-opts (assoc c/default-opts :broker rmq-producer)]
  ;; Supply a fully-qualified function symbol for enqueuing.
  ;; Args to perform-async are variadic.
  (c/perform-async client-opts `my-fn "foo" :bar)
  (c/perform-in-sec client-opts 900 `my-fn "foo" :bar)
  ;; When shutting down client...
  (rmq/close rmq-producer))

Worker

(ns my-worker
  (:require
    [goose.brokers.rmq.broker :as rmq]
    [goose.worker :as w]))

;;; 'my-app' namespace should be resolvable by worker.
(let [rmq-consumer (rmq/new-consumer rmq/default-opts)
      ;; Along with RabbitMQ, Goose supports Redis as well.
      worker-opts (assoc w/default-opts :broker rmq-consumer)
      worker (w/start worker-opts)]
  ;; When shutting down worker...
  (w/stop worker) ; Performs graceful shutsdown.
  (rmq/close rmq-consumer))

Refer to wiki for Redis, Cron Jobs, Error Handling, Monitoring, Production Readiness, etc.

Getting Help

Get help on Slack

Please open an issue or ping us on #goose @Clojurians slack.

Companies using Goose in Production

<a href="https://aspect-analytics.com/"> <img src="logo/aspect-analytics.png" title="Aspect Analytics" width="150" height="150" /> </a> <a href="https://beecastle.com/"> <img src="logo/beecastle.png" title="BeeCastle" width="150" height="150" /> </a>

Contributing

Why the name "Goose"?

<p align="center"> <img src="logo/goose-round@2x.png" title="Goose" width="360" height="360" /> </p>

Named after LT Nick 'Goose' Bradshaw, the sidekick to Captain Pete 'Maverick' Mitchell in Top Gun.

License

Licence