        q-url (.getQueueUrl (.getQueueUrl sqs-client q-name))
        ;; create an access policy to allow the topic to publish to the queue
        access-policy (sns-to-sqs-access-policy sns-client sqs-client queue-name exchange-names)
-       q-attrs (java.util.HashMap. {"Policy" access-policy})
+       q-attrs (HashMap. {"Policy" access-policy})
 
        ;; create and empty SetQueueAttributesRequest object and then set the attributes on it
        set-queue-attrs-request (doto (SetQueueAttributesRequest.)

  (memoize -get-queue-url))

(defrecord SQSQueueBroker
 [
   ;; Connection to AWS SNS
   sns-client


  (let [queue-name (normalize-queue-name queue-name)
        sqs-client (get queue-broker :sqs-client)
        queue-url (.getQueueUrl (.getQueueUrl sqs-client queue-name))
        rec-req (ReceiveMessageRequest. queue-url)]
    ;; Only take one message at a time from the queue.
    (.setMaxNumberOfMessages rec-req (Integer. 1))
    ;; Tell SQS how long to wait before returning with no data (long polling).
    (.setWaitTimeSeconds rec-req (Integer. (queue-polling-timeout)))
    (a/thread
      (try
        (u/while-let [rec-result (.receiveMessage sqs-client rec-req)]
          (when-let [msg (first (.getMessages rec-result))]
            (let [msg-body (.getBody msg)
                  msg-content (json/decode msg-body true)]
              (try
                (handler msg-content)
                (.deleteMessage sqs-client queue-url (.getReceiptHandle msg))
                (catch Throwable e
                  (error e "Message processing failed for message" (pr-str msg) "on queue" queue-name))))))
        (catch Throwable e
          (error  e "Async handler for queue" queue-name "completing."))))))

(defn- create-queue
 "Create a queue and its dead-letter-queue if they don't already exist and connect the two."
