-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathprotocol.clj
40 lines (29 loc) · 904 Bytes
/
protocol.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(ns bunnicula.protocol)
(defprotocol Monitoring
(with-tracking
[this args]
"Should evaluate body. Can add time tracking etc.")
(on-success
[this args]
"Called when message is succesfully processed")
(on-timeout
[this args]
"Called when messsage processing timeouts.")
(on-retry
[this args]
"Called when consumer fails because of known behviour
and we want to retry.")
(on-error
[this args]
"Called when consumer fails because of known behavior
and we error out ourselves.")
(on-exception
[this args]
"Called when consumer fails because of an uncontrollable error
(e.g. network, bug), basically an exception"))
(defprotocol Publisher
(publish
[this routing-key body]
[this routing-key body options]
[this exchange-name routing-key body options]
"Publish body to RabbitMQ using exchange & routing-key"))