Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change langohr.queue/declare defaults: :exclusive is now false by def…

…ault
  • Loading branch information...
commit 2d0767d71d590c5101253e96b48bb1c3ea0a67da 1 parent 5088db6
@michaelklishin authored
View
6 ChangeLog.md
@@ -1,6 +1,10 @@
## Changes between Langohr 1.0.0-beta3 and 1.0.0-beta4
-No changes yet.
+### queue.declare :exclusive Default Value Change
+
+`langohr.queue/declare` now uses default value for the `:exclusive` parameter as `false`. The reason for
+this is that exclusive queues are deleted when connection that created them is closed. This caused
+confusion w.r.t. non-auto-deleted queues being deleted in such cases.
View
6 src/clojure/langohr/basic.clj
@@ -57,7 +57,7 @@
&{:keys [^Boolean mandatory ^Boolean immediate ^String content-type ^String ^String content-encoding ^Map headers
^Boolean persistent ^Integer priority ^String correlation-id ^String reply-to ^String expiration ^String message-id
^Date timestamp ^String type ^String user-id ^String app-id ^String cluster-id]
- :or { mandatory false immediate false }}]
+ :or {mandatory false immediate false}}]
(let [payload-bytes (.getBytes payload)
properties-builder (AMQP$BasicProperties$Builder.)
properties (.build (doto properties-builder
@@ -118,8 +118,8 @@
^Boolean :no-local (default false) - flag set to true unless server local buffering is required.
"
- [^Channel channel ^String queue ^Consumer consumer &{ :keys [consumer-tag auto-ack exclusive arguments no-local]
- :or { consumer-tag "" auto-ack false exclusive false no-local false } }]
+ [^Channel channel ^String queue ^Consumer consumer &{:keys [consumer-tag auto-ack exclusive arguments no-local]
+ :or {consumer-tag "" auto-ack false exclusive false no-local false}}]
(.basicConsume ^Channel channel ^String queue ^Boolean auto-ack ^String consumer-tag ^Boolean no-local ^Boolean exclusive ^Map arguments ^Consumer consumer))
View
6 src/clojure/langohr/queue.clj
@@ -39,7 +39,7 @@
(.queueDeclare channel))
([^Channel channel ^String queue]
(.queueDeclare channel queue false true true nil))
- ([^Channel channel ^String queue &{:keys [^Boolean durable ^Boolean exclusive ^Boolean auto-delete arguments] :or {durable false, exclusive true, auto-delete true}}]
+ ([^Channel channel ^String queue &{:keys [^Boolean durable ^Boolean exclusive ^Boolean auto-delete arguments] :or {durable false exclusive false auto-delete true}}]
(.queueDeclare channel queue durable exclusive auto-delete arguments)))
@@ -53,7 +53,7 @@
"Binds a queue to an exchange using queue.bind AMQP method"
([^Channel channel ^String queue ^String exchange]
(.queueBind channel queue exchange ""))
- ([^Channel channel ^String queue ^String exchange &{ :keys [routing-key arguments] :or { routing-key "", arguments nil } }]
+ ([^Channel channel ^String queue ^String exchange &{:keys [routing-key arguments] :or {routing-key "" arguments nil}}]
(.queueBind channel queue exchange routing-key arguments)))
@@ -83,4 +83,4 @@
"Returns a map with two keys: message-count and :consumer-count, for the given queue. Uses queue.declare AMQP method with the :passive attribute set."
[^Channel channel ^String queue]
(let [declare-ok ^AMQP$Queue$DeclareOk (.queueDeclarePassive channel queue)]
- { :message-count (.getMessageCount declare-ok), :consumer-count (.getConsumerCount declare-ok) }))
+ {:message-count (.getMessageCount declare-ok) :consumer-count (.getConsumerCount declare-ok)}))
Please sign in to comment.
Something went wrong with that request. Please try again.