From a2e0919240dce9859787d0cb5fa5a7bc016b5faf Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Wed, 23 Feb 2011 07:08:24 -0500 Subject: [PATCH] fix impl of set-queue-attrs --- src/main/clojure/cemerick/bandalore.clj | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/clojure/cemerick/bandalore.clj b/src/main/clojure/cemerick/bandalore.clj index 73e5726..db88625 100644 --- a/src/main/clojure/cemerick/bandalore.clj +++ b/src/main/clojure/cemerick/bandalore.clj @@ -53,8 +53,11 @@ (defn queue-attrs "Gets or sets the attributes of a queue specified by its URL string. + When setting attributes on a queue, the attribute map must have String keys - and values." + and values. Note that the SQS API only supports setting one queue attribute + per request, so each attribute name/value pair in the provided `attr-map` + will provoke a separate API request." ([^AmazonSQSClient client queue-url] (->> (.withAttributeNames (GetQueueAttributesRequest. queue-url) #{"All"}) @@ -62,8 +65,9 @@ .getAttributes (into {}))) ([^AmazonSQSClient client queue-url attr-map] - (.setQueueAttributes client - (SetQueueAttributesRequest. queue-url attr-map)))) + (doseq [[k v] attr-map] + (.setQueueAttributes client + (SetQueueAttributesRequest. queue-url {(str k) (str v)}))))) (defn send "Sends a new message with the given string body to the queue specified