Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #2 from duck1123/master

ClassNotFound errors
  • Loading branch information...
commit bd3aa50c0009d68bab5f21318390ac6771686b6a 2 parents 19b298e + d834401
Michael Klishin michaelklishin authored
18 src/langohr/basic.clj
@@ -102,7 +102,7 @@
102 102
103 103
104 104
105   -(defn consume
  105 +(defn ^String consume
106 106 "Adds new consumer to a queue using basic.consume AMQP method.
107 107
108 108 Called with default parameters, starts non-nolocal, non-exclusive consumer with explicit acknowledgement and server-generated consumer tag.
@@ -118,9 +118,9 @@
118 118 ^Boolean :no-local (default false) - flag set to true unless server local buffering is required.
119 119
120 120 "
121   - (^String [^Channel channel, ^String queue, ^Consumer consumer, &{ :keys [consumer-tag auto-ack exclusive arguments no-local]
122   - :or { consumer-tag "", auto-ack false, exclusive false, no-local false } }]
123   - (.basicConsume ^Channel channel ^String queue ^Boolean auto-ack ^String consumer-tag ^Boolean no-local ^Boolean exclusive ^Map arguments ^Consumer consumer)))
  121 + [^Channel channel, ^String queue, ^Consumer consumer, &{ :keys [consumer-tag auto-ack exclusive arguments no-local]
  122 + :or { consumer-tag "", auto-ack false, exclusive false, no-local false } }]
  123 + (.basicConsume ^Channel channel ^String queue ^Boolean auto-ack ^String consumer-tag ^Boolean no-local ^Boolean exclusive ^Map arguments ^Consumer consumer))
124 124
125 125
126 126 (defn cancel
@@ -129,12 +129,12 @@
129 129 (.basicCancel ^Channel channel ^String consumer-tag))
130 130
131 131
132   -(defn get
  132 +(defn ^GetResponse get
133 133 "Fetches a message from a queue using basic.get AMQP method"
134   - (^GetResponse [^Channel channel, ^String queue]
135   - (.basicGet channel queue true))
136   - (^GetResponse [^Channel channel, ^String queue, ^Boolean auto-ack]
137   - (.basicGet channel queue auto-ack)))
  134 + ([^Channel channel, ^String queue]
  135 + (.basicGet channel queue true))
  136 + ([^Channel channel, ^String queue, ^Boolean auto-ack]
  137 + (.basicGet channel queue auto-ack)))
138 138
139 139
140 140
18 src/langohr/channel.clj
@@ -15,10 +15,10 @@
15 15 ;; API
16 16 ;;
17 17
18   -(defn open
  18 +(defn ^Channel open
19 19 "Opens a new channel on given connection using channel.open AMQP method"
20   - (^Channel [^Connection connection]
21   - (.createChannel connection)))
  20 + [^Connection connection]
  21 + (.createChannel connection))
22 22
23 23
24 24 (defn close
@@ -35,13 +35,13 @@
35 35 (.isOpen channel))
36 36
37 37
38   -(defn flow?
  38 +(defn ^Boolean flow?
39 39 "Returns true if flow is active on given channel. Uses channel.flow AMQP method."
40   - (^Boolean [^Channel channel]
41   - (.getActive (.getFlow channel))))
  40 + ([^Channel channel]
  41 + (.getActive (.getFlow channel))))
42 42
43 43
44   -(defn flow
  44 +(defn ^AMQP$Channel$FlowOk flow
45 45 "Enables or disables channel flow using channel.flow AMQP method"
46   - (^AMQP$Channel$FlowOk [^Channel channel ^Boolean on]
47   - (.flow channel on)))
  46 + ([^Channel channel ^Boolean on]
  47 + (.flow channel on)))
4 src/langohr/consumers.clj
@@ -19,9 +19,9 @@
19 19 ;; API
20 20 ;;
21 21
22   -(defn create-default
  22 +(defn ^Consumer create-default
23 23 "Instantiates and returns a new consumer that handles various consumer life cycle events. See also langohr.basic/consume."
24   - ^Consumer [^Channel channel &{ :keys [consume-ok-fn cancel-fn cancel-ok-fn shutdown-signal-fn recover-ok-fn handle-delivery-fn] }]
  24 + [^Channel channel &{ :keys [consume-ok-fn cancel-fn cancel-ok-fn shutdown-signal-fn recover-ok-fn handle-delivery-fn] }]
25 25 (proxy [DefaultConsumer] [^Channel channel]
26 26 (handleConsumeOk [^String consumer-tag]
27 27 (when consume-ok-fn
22 src/langohr/core.clj
@@ -55,21 +55,21 @@
55 55 ;;
56 56
57 57 (declare create-connection-factory)
58   -(defn connect
  58 +(defn ^Connection connect
59 59 "Creates and returns a new connection to RabbitMQ."
60 60 ;; defaults
61   - (^Connection []
62   - (let [conn-factory (ConnectionFactory.)]
63   - (.newConnection conn-factory)))
  61 + ([]
  62 + (let [conn-factory (ConnectionFactory.)]
  63 + (.newConnection conn-factory)))
64 64 ;; settings
65   - (^Connection [settings]
66   - (let [^ConnectionFactory conn-factory (create-connection-factory settings)]
67   - (.newConnection conn-factory))))
  65 + ([settings]
  66 + (let [^ConnectionFactory conn-factory (create-connection-factory settings)]
  67 + (.newConnection conn-factory))))
68 68
69 69
70   -(defn create-channel
  70 +(defn ^Channel create-channel
71 71 "Delegates to langohr.channel/open, kept for backwards compatibility"
72   - ^Channel [& args]
  72 + [& args]
73 73 (apply langohr.channel/open args))
74 74
75 75
@@ -102,9 +102,9 @@
102 102 (merge (env-config (:uri config (System/getenv "RABBITMQ_URL")))
103 103 config))
104 104
105   -(defn- create-connection-factory
  105 +(defn- ^ConnectionFactory create-connection-factory
106 106 "Creates connection factory from given attributes"
107   - ^ConnectionFactory [config]
  107 + [config]
108 108 (let [{:keys [host port username password vhost]} (get-config config)]
109 109 (doto (ConnectionFactory.)
110 110 (.setUsername username)
18 src/langohr/exchange.clj
@@ -16,7 +16,7 @@
16 16 ;; API
17 17 ;;
18 18
19   -(defn declare
  19 +(defn ^AMQP$Exchange$DeclareOk declare
20 20 "Declares an exchange using exchange.declare AMQP method.
21 21
22 22 By default declares non-autodeleted non-durable exchanges.
@@ -35,13 +35,13 @@
35 35 :auto-delete (default: false): If set when creating a new exchange, the exchange will be marked as durable. Durable exchanges remain active when a server restarts. Non-durable exchanges (transient exchanges) are purged if/when a server restarts.
36 36 :durable (default: false): indicates wether the exchange is durable. Information about Durable Exchanges is persisted and restored after server restart. Non-durable (transient) exchanges do not survive the server restart.
37 37 :internal (default: false): If set, the exchange may not be used directly by publishers, but only when bound to other exchanges. Internal exchanges are used to construct wiring that is not visible to applications."
38   - (^AMQP$Exchange$DeclareOk [^Channel channel ^String name ^String type]
  38 + ([^Channel channel ^String name ^String type]
39 39 (.exchangeDeclare channel name type))
40   - (^AMQP$Exchange$DeclareOk [^Channel channel ^String name ^String type &{ :keys [durable auto-delete internal arguments] :or {durable false, auto-delete false, internal false} }]
  40 + ([^Channel channel ^String name ^String type &{ :keys [durable auto-delete internal arguments] :or {durable false, auto-delete false, internal false} }]
41 41 (.exchangeDeclare channel name type durable auto-delete internal arguments)))
42 42
43 43
44   -(defn delete
  44 +(defn ^AMQP$Exchange$DeleteOk delete
45 45 "Deletes an exchange using exchange.delete AMQP method. When an exchange is deleted all queue bindings on the exchange are cancelled.
46 46
47 47 Options:
@@ -52,19 +52,19 @@
52 52 (lhe/delete channel exchange true)
53 53
54 54 "
55   - (^AMQP$Exchange$DeleteOk [^Channel channel ^String name]
  55 + ([^Channel channel ^String name]
56 56 (.exchangeDelete channel name))
57   - (^AMQP$Exchange$DeleteOk [^Channel channel ^String name if-unused]
  57 + ([^Channel channel ^String name if-unused]
58 58 (.exchangeDelete channel name if-unused)))
59 59
60 60
61   -(defn bind
  61 +(defn ^AMQP$Exchange$BindOk bind
62 62 "Binds a queue to an exchange using exchange.bind AMQP method (a RabbitMQ-specific extension)
63 63
64 64 Options:
65 65 :routing-key (default: \"\"): Specifies the routing key for the binding. The routing key is used for routing messages depending on the exchange configuration. Not all exchanges use a routing key - refer to the specific exchange documentation.
66 66 :arguments (default: nil): A hash of optional arguments with the declaration. Headers exchange type uses these metadata attributes for routing matching. In addition, brokers may implement AMQP extensions using x-prefixed declaration arguments."
67   - (^AMQP$Exchange$BindOk [^Channel channel ^String destination ^String source]
  67 + ([^Channel channel ^String destination ^String source]
68 68 (.exchangeBind channel destination source ""))
69   - (^AMQP$Exchange$BindOk [^Channel channel ^String destination ^String source &{ :keys [routing-key arguments] :or { routing-key "", arguments nil } }]
  69 + ([^Channel channel ^String destination ^String source &{ :keys [routing-key arguments] :or { routing-key "", arguments nil } }]
70 70 (.exchangeBind channel destination source routing-key arguments)))
30 src/langohr/queue.clj
@@ -16,13 +16,13 @@
16 16 ;; API
17 17 ;;
18 18
19   -(defn declare
  19 +(defn ^AMQP$Queue$DeclareOk declare
20 20 "Declares a queue using queue.declare AMQP method"
21   - (^AMQP$Queue$DeclareOk [^Channel channel]
  21 + ([^Channel channel]
22 22 (.queueDeclare channel))
23   - (^AMQP$Queue$DeclareOk [^Channel channel ^String queue]
  23 + ([^Channel channel ^String queue]
24 24 (.queueDeclare channel queue false true true nil))
25   - (^AMQP$Queue$DeclareOk [^Channel channel ^String queue &{:keys [durable exclusive auto-delete arguments] :or {durable false, exclusive true, auto-delete true}}]
  25 + ([^Channel channel ^String queue &{:keys [durable exclusive auto-delete arguments] :or {durable false, exclusive true, auto-delete true}}]
26 26 (.queueDeclare channel queue durable exclusive auto-delete arguments)))
27 27
28 28
@@ -32,33 +32,33 @@
32 32 (.queueDeclarePassive channel queue))
33 33
34 34
35   -(defn bind
  35 +(defn ^AMQP$Queue$BindOk bind
36 36 "Binds a queue to an exchange using queue.bind AMQP method"
37   - (^AMQP$Queue$BindOk [^Channel channel ^String queue ^String exchange]
  37 + ([^Channel channel ^String queue ^String exchange]
38 38 (.queueBind channel queue exchange ""))
39   - (^AMQP$Queue$BindOk [^Channel channel ^String queue ^String exchange &{ :keys [routing-key arguments] :or { routing-key "", arguments nil } }]
  39 + ([^Channel channel ^String queue ^String exchange &{ :keys [routing-key arguments] :or { routing-key "", arguments nil } }]
40 40 (.queueBind channel queue exchange routing-key arguments)))
41 41
42 42
43   -(defn unbind
  43 +(defn ^AMQP$Queue$UnbindOk unbind
44 44 "Unbinds a queue from an exchange using queue.bind AMQP method"
45   - (^AMQP$Queue$UnbindOk [^Channel channel ^String queue ^String exchange ^String routing-key]
  45 + ([^Channel channel ^String queue ^String exchange ^String routing-key]
46 46 (.queueUnbind channel queue exchange routing-key))
47   - (^AMQP$Queue$UnbindOk[^Channel channel ^String queue ^String exchange ^String routing-key ^Map arguments]
  47 + ([^Channel channel ^String queue ^String exchange ^String routing-key ^Map arguments]
48 48 (.queueUnbind channel queue exchange routing-key arguments)))
49 49
50 50
51   -(defn delete
  51 +(defn ^AMQP$Queue$DeleteOk delete
52 52 "Deletes a queue using queue.delete AMQP method"
53   - (^AMQP$Queue$DeleteOk [^Channel channel ^String queue]
  53 + ([^Channel channel ^String queue]
54 54 (.queueDelete channel queue))
55   - (^AMQP$Queue$DeleteOk[^Channel channel ^String queue if-unused if-empty]
  55 + ([^Channel channel ^String queue if-unused if-empty]
56 56 (.queueDelete channel queue if-unused if-empty)))
57 57
58 58
59   -(defn purge
  59 +(defn ^AMQP$Queue$PurgeOk purge
60 60 "Purges a queue using queue.purge AMQP method"
61   - ^AMQP$Queue$PurgeOk [^Channel channel ^String queue]
  61 + [^Channel channel ^String queue]
62 62 (.queuePurge channel queue))
63 63
64 64

0 comments on commit bd3aa50

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