Liking cljdoc? Tell your friends :D


Test & Lint Workflow Clojars Project cljdoc badge

The Next-Level background job processing library for Clojure.

Simple. Pluggable. Reliable. Extensible. Scalable.


Please refer to the Benchmarking section.


Getting Started

Clojars Project

Add Goose as a dependency

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

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


(ns my-app
    [ :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))


(ns my-worker
    [ :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, Periodic 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


Why the name "Goose"?

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



Can you improve this documentation? These fine people already did:
akshat, Alisha Mohanty, Akshay Gupta, Shivam, Atharva Raykar & Akshat
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close