isimud 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/checksum/isimud-1.4.1.gem.sha512 +1 -0
- data/doc/_index.html +1 -1
- data/doc/file.LICENSE.html +1 -1
- data/doc/file.README.html +4 -2
- data/doc/index.html +4 -2
- data/doc/top-level-namespace.html +1 -1
- data/lib/isimud/bunny_client.rb +5 -2
- data/lib/isimud/client.rb +1 -1
- data/lib/isimud/event.rb +9 -1
- data/lib/isimud/test_client.rb +1 -1
- data/lib/isimud/version.rb +1 -1
- data/release +1 -1
- metadata +2 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00087ddb9c814123247016a8369c981460dd5fe
|
4
|
+
data.tar.gz: 08af358a3d6b7095c7612ac524ac3d02f82b42d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13ddd2631d2f5354489b69aa1ad1e2dfffe2a1ab680f0c5ddffc37bdbe2cc05a9a32aeb40fbc8dc3c3e7e3fdbeec764e5920bc4b9d8e2a075467e4716f41bf0
|
7
|
+
data.tar.gz: 242fb5bca098a9f563d3a87b6b0dc26cebc868d86486af7d479ba23bac9cf06d87b2062363df5a4683aaa1ece0e288edba1f4a058234a2f889c57e13f21a90d7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -120,6 +120,14 @@ the message is not re-queued.
|
|
120
120
|
|
121
121
|
# Changes
|
122
122
|
|
123
|
+
## 1.4.2
|
124
|
+
|
125
|
+
* BunnyClient#publish now accepts additional metadata options
|
126
|
+
* Isimud::Event changes:
|
127
|
+
* Added #timestamp property
|
128
|
+
* Added #message_id for generating unique message IDs
|
129
|
+
* message_id is now added to metadata when publishing
|
130
|
+
|
123
131
|
## 1.4.1
|
124
132
|
|
125
133
|
* Enable conditional re-queuing of messages after an exception is raised (see *Exception Handling* above).
|
@@ -0,0 +1 @@
|
|
1
|
+
a9ffe9f7f70785d88670b9115e349c2f7aedf57278d4a4d5ec6e741e82deef6ec64c75be283d9fe05f9f39d6ee5392ff6376a6a311848687df293191ab8b0e14
|
data/doc/_index.html
CHANGED
data/doc/file.LICENSE.html
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
<div id="content"><div id='filecontents'>Copyright (c) 2016 Welltok Inc.<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the "Software"), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in all<br/>copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE<br/>SOFTWARE.</div></div>
|
65
65
|
|
66
66
|
<div id="footer">
|
67
|
-
Generated on Wed Aug 24
|
67
|
+
Generated on Wed Aug 24 20:16:23 2016 by
|
68
68
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
69
69
|
0.8.7.6 (ruby-2.3.0).
|
70
70
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -217,7 +217,7 @@ falsey, the message is not re-queued.</p>
|
|
217
217
|
|
218
218
|
<h1 id="label-Changes">Changes</h1>
|
219
219
|
|
220
|
-
<h2 id="label-1.4.
|
220
|
+
<h2 id="label-1.4.2">1.4.2</h2>
|
221
221
|
<ul><li>
|
222
222
|
<p>Enable conditional re-queuing of messages after an exception is raised (see
|
223
223
|
<em>Exception Handling</em> above).</p>
|
@@ -225,6 +225,8 @@ falsey, the message is not re-queued.</p>
|
|
225
225
|
<p>Log messages for receipt and ack of messages downgraded to debug level.</p>
|
226
226
|
</li><li>
|
227
227
|
<p>Force manual_ack mode for all queue subscriptions.</p>
|
228
|
+
</li><li>
|
229
|
+
<p>BunnyClient#publish now accepts additional</p>
|
228
230
|
</li></ul>
|
229
231
|
|
230
232
|
<h2 id="label-1.3.8">1.3.8</h2>
|
@@ -552,7 +554,7 @@ feature'</code>)</p>
|
|
552
554
|
</div></div>
|
553
555
|
|
554
556
|
<div id="footer">
|
555
|
-
Generated on Wed Aug 24
|
557
|
+
Generated on Wed Aug 24 20:16:23 2016 by
|
556
558
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
557
559
|
0.8.7.6 (ruby-2.3.0).
|
558
560
|
</div>
|
data/doc/index.html
CHANGED
@@ -217,7 +217,7 @@ falsey, the message is not re-queued.</p>
|
|
217
217
|
|
218
218
|
<h1 id="label-Changes">Changes</h1>
|
219
219
|
|
220
|
-
<h2 id="label-1.4.
|
220
|
+
<h2 id="label-1.4.2">1.4.2</h2>
|
221
221
|
<ul><li>
|
222
222
|
<p>Enable conditional re-queuing of messages after an exception is raised (see
|
223
223
|
<em>Exception Handling</em> above).</p>
|
@@ -225,6 +225,8 @@ falsey, the message is not re-queued.</p>
|
|
225
225
|
<p>Log messages for receipt and ack of messages downgraded to debug level.</p>
|
226
226
|
</li><li>
|
227
227
|
<p>Force manual_ack mode for all queue subscriptions.</p>
|
228
|
+
</li><li>
|
229
|
+
<p>BunnyClient#publish now accepts additional</p>
|
228
230
|
</li></ul>
|
229
231
|
|
230
232
|
<h2 id="label-1.3.8">1.3.8</h2>
|
@@ -552,7 +554,7 @@ feature'</code>)</p>
|
|
552
554
|
</div></div>
|
553
555
|
|
554
556
|
<div id="footer">
|
555
|
-
Generated on Wed Aug 24
|
557
|
+
Generated on Wed Aug 24 20:16:23 2016 by
|
556
558
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
557
559
|
0.8.7.6 (ruby-2.3.0).
|
558
560
|
</div>
|
data/lib/isimud/bunny_client.rb
CHANGED
@@ -141,10 +141,13 @@ module Isimud
|
|
141
141
|
# @param [String] exchange AMQP exchange name
|
142
142
|
# @param [String] routing_key message routing key. This should always be in the form of words separated by dots
|
143
143
|
# e.g. "user.goal.complete"
|
144
|
+
# @param [String] payload message payload
|
145
|
+
# @param [Hash] options additional message options
|
146
|
+
# @see Bunny::Exchange#publish
|
144
147
|
# @see http://rubybunny.info/articles/exchanges.html
|
145
|
-
def publish(exchange, routing_key, payload)
|
148
|
+
def publish(exchange, routing_key, payload, options = {})
|
146
149
|
log "Isimud::BunnyClient#publish: exchange=#{exchange} routing_key=#{routing_key}", :debug
|
147
|
-
channel.topic(exchange, durable: true).publish(payload, routing_key: routing_key, persistent: true)
|
150
|
+
channel.topic(exchange, durable: true).publish(payload, options.merge(routing_key: routing_key, persistent: true))
|
148
151
|
end
|
149
152
|
|
150
153
|
# Close and reopen the AMQP connection
|
data/lib/isimud/client.rb
CHANGED
data/lib/isimud/event.rb
CHANGED
@@ -9,6 +9,7 @@ module Isimud
|
|
9
9
|
class Event
|
10
10
|
include Isimud::Logging
|
11
11
|
attr_accessor :type, :action, :user_id, :occurred_at, :eventful_type, :eventful_id, :attributes, :parameters
|
12
|
+
attr_reader :timestamp
|
12
13
|
attr_writer :exchange
|
13
14
|
|
14
15
|
DEFAULT_TYPE = :model
|
@@ -43,6 +44,7 @@ module Isimud
|
|
43
44
|
else
|
44
45
|
Time.now.utc
|
45
46
|
end
|
47
|
+
@timestamp = Time.now
|
46
48
|
|
47
49
|
eventful_object = options.delete(:eventful)
|
48
50
|
|
@@ -73,6 +75,12 @@ module Isimud
|
|
73
75
|
[type.to_s, eventful_type, eventful_id, action].compact.join('.')
|
74
76
|
end
|
75
77
|
|
78
|
+
# Message ID, which is generated from the exchange, routing_key, user_id, and timestamp. This is practically
|
79
|
+
# guaranteed to be unique across all publishers.
|
80
|
+
def message_id
|
81
|
+
[exchange, routing_key, user_id, timestamp.to_i, timestamp.nsec].join(':')
|
82
|
+
end
|
83
|
+
|
76
84
|
# Return hash of data to be serialized to JSON
|
77
85
|
# @option options [Boolean] :omit_parameters when set, do not include attributes or parameters in data
|
78
86
|
# @return [Hash] data to serialize
|
@@ -112,7 +120,7 @@ module Isimud
|
|
112
120
|
def publish
|
113
121
|
data = self.serialize
|
114
122
|
log "Event#publish: #{self.inspect}"
|
115
|
-
Isimud.client.publish(exchange, routing_key, data)
|
123
|
+
Isimud.client.publish(exchange, routing_key, data, message_id: message_id)
|
116
124
|
end
|
117
125
|
end
|
118
126
|
end
|
data/lib/isimud/test_client.rb
CHANGED
@@ -108,7 +108,7 @@ module Isimud
|
|
108
108
|
queue
|
109
109
|
end
|
110
110
|
|
111
|
-
def publish(exchange, routing_key, payload)
|
111
|
+
def publish(exchange, routing_key, payload, _options = {})
|
112
112
|
log "Isimud::TestClient: Delivering message exchange: #{exchange} key: #{routing_key} payload: #{payload}"
|
113
113
|
call_queues = queues.values.select { |queue| queue.has_matching_key?(exchange, routing_key) }
|
114
114
|
call_queues.each do |queue|
|
data/lib/isimud/version.rb
CHANGED
data/release
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isimud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Feil
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- certs/gfeil.pem
|
116
116
|
- checksum/isimud-1.3.8.gem.sha512
|
117
117
|
- checksum/isimud-1.4.0.gem.sha512
|
118
|
+
- checksum/isimud-1.4.1.gem.sha512
|
118
119
|
- config.ru
|
119
120
|
- config/tddium.yml
|
120
121
|
- doc/Isimud.html
|
metadata.gz.sig
CHANGED
Binary file
|