Skip to content

Instantly share code, notes, and snippets.

@cap10morgan
Last active December 15, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cap10morgan/cb6e2567cd330a11e1424ed2cbe52dd8 to your computer and use it in GitHub Desktop.
Save cap10morgan/cb6e2567cd330a11e1424ed2cbe52dd8 to your computer and use it in GitHub Desktop.
Steps to reproduce RabbitMQ qos admin UI bug
  1. Run docker run --rm -ti -p 5672:5672 -p 15672:15672 rabbitmq:3.6.5-management
  2. Fire up a Clojure REPL w/ langohr available
  3. (require '[langohr.core :as rmq])
  4. (def rconn (rmq/connect))
  5. (require '[langohr.channel :as lch])
  6. (def rch (lch/open rconn))
  7. (require '[langohr.queue :as lq])
  8. (lq/declare rch "foo.bar" {:exclusive false :auto-delete false :durable true})
  9. (require '[langohr.consumers :as lcons])
  10. (lcons/subscribe rch "foo.bar" (fn [_ _ ^bytes m] (println (String. m "UTF-8"))) {:auto-ack true})
  11. Go to http://localhost:15672/ in a web browser
    1. Click on Queues
    2. Click on the foo.bar queue
    3. Expand the Consumers section
    4. Verify that "Prefetch count" is zero in the initial table
    5. Click on the consumer
    6. Verify that "Prefetch count" is zero everywhere on that page too
  12. (require '[langohr.basic :as lb])
  13. (lb/qos rch 12)
  14. Go back to foo.bar queue page in RabbitMQ management UI
  15. Refresh the page and verify that "Prefetch count" is still 0 there
  16. Click on the consumer again and verify that "Prefetch count" is now 12 in the upper "Details" section but still 0 in the Consumers table
  17. Declare another channel & queue but set qos before subscribing
    1. (def rch' (lch/open rconn))
    2. (lq/declare rch' "baz.qux" {:exclusive false :auto-delete false :durable true})
    3. (lb/qos rch' 15)
    4. (lcons/subscribe rch' "baz.qux" (fn [_ _ ^bytes m] (println (String. m "UTF-8"))) {:auto-ack true})
  18. Click into the baz.qux queue in the RabbitMQ management UI
  19. Verify that the "Prefetch count" in the consumers table is 15
  20. Click on the consumer and verify that the same Details -> Prefetch count value is 15 here too but the consumers table also now shows 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment