-
Notifications
You must be signed in to change notification settings - Fork 9
Redis
akshat edited this page Nov 7, 2022
·
7 revisions
NOTE: Minimum version is 6.2.0, because multiple commands are deprecated post that.
Redis Message Broker supports all the features of Goose.
Redis connection opts need :url
& :pool-opts
.
Pool Opts can be :none
, a map of Jedis pool configs, or satisfy IConnectionPool protocol of Carmine
(ns redis-broker
(:require
[goose.brokers.redis.broker :as redis]
[goose.client :as c]
[goose.worker :as w]))
(let [url "redis://username:password@my-redis.host:6379"
pool-opts {:max-total-per-key 10
:max-idle-per-key 10
:min-idle-per-key 2}
conn-opts {:url url :pool-opts pool-opts}
redis-producer (redis/new-producer conn-opts)
scheduler-polling-interval-sec 15
redis-consumer (redis/new-consumer conn-opts scheduler-polling-interval-sec)
;; Use client/worker opts for enqueuing/dequeuing jobs.
client-opts (assoc c/default-opts :broker redis-producer)
worker-opts (assoc w/default-opts :broker redis-consumer)])
Previous: RabbitMQ Next: Guide to Message Broker Integration
Home | Getting Started | RabbitMQ | Redis | Error Handling | Monitoring | Production Readiness | Troubleshooting
Need help? Open an issue or ping us on #goose @Clojurians slack.