Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added usage to README

  • Loading branch information...
commit c0495421ecc78478b2e507233a279f7dc1995433 1 parent b0bf20f
@icylisper icylisper authored
Showing with 27 additions and 9 deletions.
  1. +26 −8 README.md
  2. +1 −1  example/test-connection.clj
View
34 README.md
@@ -6,14 +6,33 @@
lein deps
-
-## Usage and API ##
+## API ##
+
+Add [clojure-rabbitmq "0.2.1"] to the dependencies list in your project.clj
+
+ (ns rabbitmq-publisher-test
+ (:require [org.clojars.rabbitmq :as rabbitmq]))
+
+ (defonce conn-map {:username "guest"
+ :password "guest"
+ :host "localhost"
+ :port 5672
+ :virtual-host "/"
+ :type "direct"
+ :exchange "sorting-room"
+ :queue "po-box"
+ :durable true
+ :routing-key "tata"})
+ (defonce connection (connect conn-map))
+ (let [[conn channel] connection]
+ (do
+ (rabbitmq/bind-channel conn-map channel)
+ (println "rabbitmq publishing:" (format "message%d" @c))
+ (rabbitmq/publish conn-map channel (format "message%d" @c))))
+
+
+## Examples ##
- add below to the dependencies list in your project.clj
-
- [clojure-rabbitmq "0.2.1"]
-
-
See `example/publisher.clj` and `example/consumer.clj` for usage.
To test connection to the rabbitmq server, run:
@@ -21,4 +40,3 @@ To test connection to the rabbitmq server, run:
To test publishing of messages, run:
example/publisher.clj
-
View
2  example/test-connection.clj
@@ -3,7 +3,7 @@ exec java -cp "lib/*:$PWD/*" clojure.main "$0" -- "$@"
]
-(use 'org.clojars.rabbitmq)
+ (use 'org.clojars.rabbitmq)
;; example(1)
(defonce conn-map {:username "guest"
Please sign in to comment.
Something went wrong with that request. Please try again.