Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use source directory structure other CLJW projects use

  • Loading branch information...
commit ad183f82d74cae5c1faa0dd0fe6bdab7353f513a 1 parent 544b0c6
@michaelklishin authored
View
2  project.clj
@@ -7,6 +7,8 @@
:profiles {:dev { :dependencies [[org.clojure/tools.cli "0.2.1" :exclusions [org.clojure/clojure]]] }
:1.4 { :dependencies [[org.clojure/clojure "1.4.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.0-master-SNAPSHOT"]]}}
+ :source-paths ["src/clojure"]
+ :java-source-paths ["src/java"]
:url "https://github.com/michaelklishin/langohr"
:repositories {"sonatype" {:url "http://oss.sonatype.org/content/repositories/releases"
:snapshots false
View
12 src/langohr/basic.clj → src/clojure/langohr/basic.clj
@@ -1,4 +1,4 @@
-;; Copyright (c) 2011 Michael S. Klishin
+;; Copyright (c) 2011-2012 Michael S. Klishin
;;
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
@@ -53,11 +53,11 @@
(lhb/publish channel exchange queue payload :priority 8, :message-id msg-id, :content-type content-type, :headers { \"see you soon\" \"à bientôt\" })
"
- [^Channel channel, ^String exchange, ^String routing-key, ^String payload
+ [^Channel channel ^String exchange ^String routing-key ^String payload
&{: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
@@ -95,8 +95,8 @@
"
[^clojure.lang.IFn handler-fn]
(reify ReturnListener
- (handleReturn [this, reply-code, reply-text, exchange, routing-key, properties, body]
- (handler-fn reply-code, reply-text, exchange, routing-key, properties, (String. ^bytes body)))))
+ (handleReturn [this reply-code reply-text exchange routing-key properties body]
+ (handler-fn reply-code reply-text exchange routing-key properties (String. ^bytes body)))))
@@ -125,7 +125,7 @@
(defn cancel
"Cancels consumer using basic.cancel AMQP method"
- [^Channel channel, ^String consumer-tag]
+ [^Channel channel ^String consumer-tag]
(.basicCancel ^Channel channel ^String consumer-tag))
View
0  src/langohr/channel.clj → src/clojure/langohr/channel.clj
File renamed without changes
View
0  src/langohr/confirm.clj → src/clojure/langohr/confirm.clj
File renamed without changes
View
0  src/langohr/consumers.clj → src/clojure/langohr/consumers.clj
File renamed without changes
View
0  src/langohr/conversion.clj → src/clojure/langohr/conversion.clj
File renamed without changes
View
0  src/langohr/core.clj → src/clojure/langohr/core.clj
File renamed without changes
View
0  src/langohr/examples/basic_consume.clj → ...lojure/langohr/examples/basic_consume.clj
File renamed without changes
View
23 src/langohr/examples/basic_publish.clj → ...lojure/langohr/examples/basic_publish.clj
@@ -1,29 +1,28 @@
(ns langohr.examples.basic-publish
+ (:require [langohr.channel :as lch])
(:use [langohr.core :only [connect close]] [langohr.basic :only [publish]]))
(defn default-attributes
[& arguments]
(let [conn (connect)
- ch (.createChannel conn)
+ ch (lch/open conn)
payload (or (first arguments) "¡Hola! de Clojure! à bientôt")
routing-key (or (second arguments) "langohr.examples.hello_world")
exchange ""]
- (do
- (println (str "Going to publish " payload))
- (publish ch exchange routing-key payload {})
- (close ch)
- (close conn))))
+ (println (str "Going to publish " payload))
+ (publish ch exchange routing-key payload {})
+ (close ch)
+ (close conn)))
(defn with-type-and-priority
[& arguments]
(let [conn (langohr.core/connect)
- ch (.createChannel conn)
+ ch (lch/open conn)
payload (or (first arguments) "¡Hola! de Clojure! à bientôt")
routing-key (or (second arguments) "langohr.examples.hello_world")
exchange ""]
- (do
- (println (str "Going to publish " payload))
- (publish ch exchange routing-key payload { :type "simple.message", :priority 7, :persistent true })
- (close ch)
- (close conn))))
+ (println (str "Going to publish " payload))
+ (publish ch exchange routing-key payload { :type "simple.message", :priority 7, :persistent true })
+ (close ch)
+ (close conn)))
View
0  src/langohr/examples/connection.clj → src/clojure/langohr/examples/connection.clj
File renamed without changes
View
0  src/langohr/examples/exchange_declare.clj → ...ure/langohr/examples/exchange_declare.clj
File renamed without changes
View
0  src/langohr/examples/queue_bind.clj → src/clojure/langohr/examples/queue_bind.clj
File renamed without changes
View
0  src/langohr/examples/queue_declare.clj → ...lojure/langohr/examples/queue_declare.clj
File renamed without changes
View
0  src/langohr/exchange.clj → src/clojure/langohr/exchange.clj
File renamed without changes
View
0  src/langohr/queue.clj → src/clojure/langohr/queue.clj
File renamed without changes
View
0  src/langohr/tx.clj → src/clojure/langohr/tx.clj
File renamed without changes
View
0  src/langohr/util.clj → src/clojure/langohr/util.clj
File renamed without changes
View
0  src/java/.gitkeep
No changes.

0 comments on commit ad183f8

Please sign in to comment.
Something went wrong with that request. Please try again.