propono 1.7.0 → 2.0.0.rc1
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
- data/.gitignore +1 -0
- data/.travis.yml +2 -9
- data/CHANGELOG.md +9 -0
- data/Gemfile +0 -2
- data/README.md +35 -91
- data/lib/propono.rb +4 -144
- data/lib/propono/components/aws_client.rb +78 -0
- data/lib/propono/components/aws_config.rb +4 -9
- data/lib/propono/components/client.rb +93 -0
- data/lib/propono/components/queue.rb +4 -6
- data/lib/propono/components/queue_subscription.rb +32 -22
- data/lib/propono/components/sqs_message.rb +3 -6
- data/lib/propono/components/topic.rb +6 -5
- data/lib/propono/configuration.rb +0 -2
- data/lib/propono/services/publisher.rb +21 -44
- data/lib/propono/services/queue_listener.rb +54 -57
- data/lib/propono/version.rb +1 -1
- data/propono.gemspec +3 -2
- data/test/components/aws_config_test.rb +4 -4
- data/test/components/client_test.rb +68 -0
- data/test/components/queue_subscription_test.rb +68 -70
- data/test/components/queue_test.rb +6 -3
- data/test/components/topic_test.rb +4 -2
- data/test/configuration_test.rb +27 -55
- data/test/integration/integration_test.rb +4 -7
- data/test/integration/slow_queue_test.rb +11 -8
- data/test/integration/sns_to_sqs_test.rb +17 -17
- data/test/services/publisher_test.rb +59 -156
- data/test/services/queue_listener_test.rb +96 -103
- data/test/test_helper.rb +21 -48
- metadata +26 -39
- data/lib/propono/components/post_subscription.rb +0 -19
- data/lib/propono/components/sns.rb +0 -11
- data/lib/propono/components/sqs.rb +0 -12
- data/lib/propono/services/queue_creator.rb +0 -29
- data/lib/propono/services/subscriber.rb +0 -12
- data/lib/propono/services/tcp_listener.rb +0 -48
- data/lib/propono/services/topic_creator.rb +0 -23
- data/lib/propono/services/udp_listener.rb +0 -52
- data/test/components/post_subscription_test.rb +0 -29
- data/test/components/sns_test.rb +0 -25
- data/test/components/sqs_test.rb +0 -26
- data/test/integration/tcp_to_sqs_test.rb +0 -53
- data/test/integration/udp_proxy_test.rb +0 -50
- data/test/integration/udp_to_sqs_test.rb +0 -53
- data/test/propono_test.rb +0 -83
- data/test/services/queue_creator_test.rb +0 -61
- data/test/services/subscriber_test.rb +0 -21
- data/test/services/tcp_listener_test.rb +0 -76
- data/test/services/topic_creator_test.rb +0 -40
- data/test/services/udp_listener_test.rb +0 -73
@@ -5,30 +5,45 @@ module Propono
|
|
5
5
|
|
6
6
|
def setup
|
7
7
|
super
|
8
|
-
@
|
8
|
+
@topic_name = "some-topic"
|
9
9
|
|
10
10
|
@receipt_handle1 = "test-receipt-handle1"
|
11
11
|
@receipt_handle2 = "test-receipt-handle2"
|
12
12
|
@message1 = {cat: "Foobar 123"}
|
13
13
|
@message2 = "Barfoo 543"
|
14
14
|
@message1_id = "abc123"
|
15
|
-
@
|
15
|
+
@message2_id = "987whf"
|
16
16
|
@body1 = {id: @message1_id, message: @message1}
|
17
17
|
@body2 = {id: @message2_id, message: @message2}
|
18
|
-
@sqs_message1 = { "ReceiptHandle" => @receipt_handle1, "Body" => {"Message" => @body1.to_json}.to_json}
|
19
|
-
@sqs_message2 = { "ReceiptHandle" => @receipt_handle2, "Body" => {"Message" => @body2.to_json}.to_json}
|
20
|
-
@messages = { "Message" => [ @sqs_message1, @sqs_message2 ] }
|
21
|
-
@sqs_response = mock().tap{|m|m.stubs(body: @messages)}
|
22
|
-
@sqs = mock()
|
23
|
-
@sqs.stubs(receive_message: @sqs_response)
|
24
|
-
@sqs.stubs(:delete_message)
|
25
18
|
|
26
|
-
@
|
27
|
-
@
|
19
|
+
@sqs_message1 = mock
|
20
|
+
@sqs_message1.stubs(receipt_handle: @receipt_handle1, body: {"Message" => @body1.to_json}.to_json)
|
21
|
+
@sqs_message2 = mock
|
22
|
+
@sqs_message2.stubs(receipt_handle: @receipt_handle2, body: {"Message" => @body2.to_json}.to_json)
|
28
23
|
|
29
|
-
|
24
|
+
@queue = mock.tap {|q| q.stubs(url: "foobar", arn: "qarn") }
|
25
|
+
@topic = mock.tap {|t| t.stubs(arn: "tarn") }
|
26
|
+
aws_client.stubs(
|
27
|
+
create_queue: @queue,
|
28
|
+
create_topic: @topic
|
29
|
+
)
|
30
|
+
aws_client.stubs(:subscribe_sqs_to_sns)
|
31
|
+
aws_client.stubs(:set_sqs_policy)
|
30
32
|
|
31
|
-
|
33
|
+
@messages = [@sqs_message1, @sqs_message2]
|
34
|
+
aws_client.stubs(read_from_sqs: @messages)
|
35
|
+
aws_client.stubs(:delete_from_sqs)
|
36
|
+
|
37
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) {}
|
38
|
+
|
39
|
+
@slow_queue = mock
|
40
|
+
@slow_queue.stubs(url: "some_queue_url")
|
41
|
+
@failed_queue = mock
|
42
|
+
@corrupt_queue = mock
|
43
|
+
@listener.stubs(slow_queue: @slow_queue, corrupt_queue: @corrupt_queue, failed_queue: @failed_queue)
|
44
|
+
|
45
|
+
propono_config.num_messages_per_poll = 14
|
46
|
+
propono_config.max_retries = 0
|
32
47
|
end
|
33
48
|
|
34
49
|
def test_listen_should_loop
|
@@ -37,88 +52,70 @@ module Propono
|
|
37
52
|
end
|
38
53
|
|
39
54
|
def test_listen_raises_with_nil_topic
|
40
|
-
listener = QueueListener.new(nil) {}
|
55
|
+
listener = QueueListener.new(aws_client, propono_config, nil) {}
|
41
56
|
assert_raises ProponoError do
|
42
57
|
listener.listen
|
43
58
|
end
|
44
59
|
end
|
45
60
|
|
46
61
|
def test_drain_should_continue_if_queue_empty
|
47
|
-
@listener.expects(:
|
62
|
+
@listener.expects(:read_messages_from_queue).with(@slow_queue, 10, long_poll: false).returns(false)
|
63
|
+
@listener.expects(:read_messages_from_queue).with(@queue, 10, long_poll: false).returns(false)
|
48
64
|
@listener.drain
|
49
65
|
assert true
|
50
66
|
end
|
51
67
|
|
52
68
|
def test_drain_raises_with_nil_topic
|
53
|
-
listener = QueueListener.new(nil) {}
|
69
|
+
listener = QueueListener.new(aws_client, propono_config, nil) {}
|
54
70
|
assert_raises ProponoError do
|
55
71
|
listener.drain
|
56
72
|
end
|
57
73
|
end
|
58
74
|
|
59
75
|
def test_read_messages_should_subscribe
|
60
|
-
|
76
|
+
queue = mock
|
77
|
+
queue.stubs(:url)
|
78
|
+
QueueSubscription.expects(:create).with(aws_client, propono_config, @topic_name).returns(mock(queue: queue))
|
61
79
|
@listener.send(:read_messages)
|
62
80
|
end
|
63
81
|
|
64
82
|
def test_read_message_from_sqs
|
65
83
|
max_number_of_messages = 5
|
66
|
-
|
67
|
-
|
68
|
-
@sqs.expects(:receive_message).with(queue_url, options).returns(@sqs_response)
|
69
|
-
@listener.send(:read_messages_from_queue, queue_url, max_number_of_messages)
|
84
|
+
aws_client.expects(:read_from_sqs).with(@queue, max_number_of_messages, long_poll: true)
|
85
|
+
@listener.send(:read_messages_from_queue, @queue, max_number_of_messages)
|
70
86
|
end
|
71
87
|
|
72
88
|
def test_log_message_from_sqs
|
73
|
-
|
74
|
-
|
75
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
89
|
+
propono_config.logger.expects(:info).with() {|x| x == "Propono [#{@message1_id}]: Received from sqs."}
|
90
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
76
91
|
end
|
77
92
|
|
78
93
|
def test_read_messages_calls_process_message_for_each_msg
|
79
|
-
|
80
|
-
|
81
|
-
@listener.
|
82
|
-
@listener.expects(:process_raw_message).with(@sqs_message2, queue_url)
|
83
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
94
|
+
@listener.expects(:process_raw_message).with(@sqs_message1, @queue)
|
95
|
+
@listener.expects(:process_raw_message).with(@sqs_message2, @queue)
|
96
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
84
97
|
end
|
85
98
|
|
86
99
|
def test_read_messages_does_not_call_process_messages_if_there_are_none
|
87
|
-
|
88
|
-
@sqs_response.stubs(body: {"Message" => []})
|
100
|
+
aws_client.stubs(read_from_sqs: [])
|
89
101
|
@listener.expects(:process_message).never
|
90
|
-
@listener.send(:read_messages_from_queue,
|
102
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
91
103
|
end
|
92
104
|
|
93
105
|
def test_exception_from_sqs_is_logged
|
94
|
-
|
95
|
-
|
96
|
-
@
|
97
|
-
Propono.config.logger.expects(:error).with("Unexpected error reading from queue http://example.com")
|
98
|
-
Propono.config.logger.expects(:error).with() {|x| x.is_a?(StandardError)}
|
99
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
100
|
-
end
|
101
|
-
|
102
|
-
def test_forbidden_error_is_logged_and_re_raised
|
103
|
-
queue_url = "http://example.com"
|
104
|
-
@listener.stubs(queue_url: queue_url)
|
105
|
-
@sqs.stubs(:receive_message).raises(Excon::Errors::Forbidden.new(nil, nil, nil))
|
106
|
-
Propono.config.logger.expects(:error).with("Forbidden error caught and re-raised. http://example.com")
|
107
|
-
Propono.config.logger.expects(:error).with() {|x| x.is_a?(Excon::Errors::Forbidden)}
|
108
|
-
assert_raises Excon::Errors::Forbidden do
|
109
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
110
|
-
end
|
106
|
+
aws_client.stubs(:read_from_sqs).raises(StandardError)
|
107
|
+
propono_config.logger.expects(:error).with("Unexpected error reading from queue #{@queue.url}")
|
108
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
111
109
|
end
|
112
110
|
|
113
111
|
def test_exception_from_sqs_returns_false
|
114
|
-
|
112
|
+
aws_client.stubs(:read_from_sqs).raises(StandardError)
|
115
113
|
refute @listener.send(:read_messages)
|
116
114
|
end
|
117
115
|
|
118
116
|
def test_each_message_processor_is_yielded
|
119
117
|
messages_yielded = []
|
120
|
-
@listener = QueueListener.new(@
|
121
|
-
@listener.stubs(sqs: @sqs)
|
118
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) { |m, _| messages_yielded.push(m) }
|
122
119
|
@listener.send(:read_messages)
|
123
120
|
|
124
121
|
assert_equal messages_yielded.size, 2
|
@@ -126,120 +123,116 @@ module Propono
|
|
126
123
|
assert messages_yielded.include?(@message2)
|
127
124
|
end
|
128
125
|
|
126
|
+
def test_ok_if_message_processor_is_nil
|
127
|
+
messages_yielded = []
|
128
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name)
|
129
|
+
|
130
|
+
@listener.send(:process_message, "")
|
131
|
+
assert_equal messages_yielded.size, 0
|
132
|
+
end
|
133
|
+
|
129
134
|
def test_each_message_processor_context
|
130
|
-
|
131
|
-
@listener = QueueListener.new(@
|
132
|
-
@listener.stubs(sqs: @sqs)
|
135
|
+
ids = []
|
136
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) { |_, context| ids << context[:id] }
|
133
137
|
@listener.send(:read_messages)
|
134
138
|
|
135
|
-
assert_equal
|
136
|
-
assert
|
137
|
-
assert
|
139
|
+
assert_equal ids.size, 2
|
140
|
+
assert ids.include?(@message1_id)
|
141
|
+
assert ids.include?(@message2_id)
|
138
142
|
end
|
139
143
|
|
140
144
|
def test_each_message_is_deleted
|
141
|
-
|
145
|
+
queue = "test-queue-url"
|
142
146
|
|
143
|
-
|
144
|
-
|
147
|
+
aws_client.expects(:delete_from_sqs).with(queue, @receipt_handle1)
|
148
|
+
aws_client.expects(:delete_from_sqs).with(queue, @receipt_handle2)
|
145
149
|
|
146
|
-
@listener.stubs(
|
147
|
-
@listener.send(:read_messages_from_queue,
|
150
|
+
@listener.stubs(queue: queue)
|
151
|
+
@listener.send(:read_messages_from_queue, queue, propono_config.num_messages_per_poll)
|
148
152
|
end
|
149
153
|
|
150
154
|
def test_messages_are_deleted_if_there_is_an_exception_processing
|
151
|
-
|
152
|
-
|
153
|
-
@sqs.expects(:delete_message).with(queue_url, @receipt_handle1)
|
154
|
-
@sqs.expects(:delete_message).with(queue_url, @receipt_handle2)
|
155
|
+
aws_client.expects(:delete_from_sqs).with(@queue, @receipt_handle1)
|
156
|
+
aws_client.expects(:delete_from_sqs).with(@queue, @receipt_handle2)
|
155
157
|
|
156
158
|
exception = StandardError.new("Test Error")
|
157
|
-
@listener = QueueListener.new(@
|
158
|
-
@listener.stubs(queue_url: queue_url)
|
159
|
-
@listener.stubs(sqs: @sqs)
|
159
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) { raise exception }
|
160
160
|
@listener.stubs(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message1), exception)
|
161
161
|
@listener.stubs(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message2), exception)
|
162
|
-
@listener.send(:read_messages_from_queue,
|
162
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
163
163
|
end
|
164
164
|
|
165
165
|
def test_messages_are_retried_or_abandoned_on_failure
|
166
|
-
queue_url = "test-queue-url"
|
167
|
-
|
168
166
|
exception = StandardError.new("Test Error")
|
169
|
-
@listener = QueueListener.new(@
|
167
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) { raise exception }
|
170
168
|
@listener.expects(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message1), exception)
|
171
169
|
@listener.expects(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message2), exception)
|
172
|
-
@listener.
|
173
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
170
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
174
171
|
end
|
175
172
|
|
176
173
|
def test_failed_on_moving_to_failed_queue_does_not_delete
|
177
|
-
queue_url = "test-queue-url"
|
178
|
-
|
179
174
|
exception = StandardError.new("Test Error")
|
180
|
-
@listener = QueueListener.new(@
|
175
|
+
@listener = QueueListener.new(aws_client, propono_config, @topic_name) { raise exception }
|
181
176
|
@listener.stubs(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message1), exception).raises(StandardError.new("failed to move"))
|
182
177
|
@listener.stubs(:requeue_message_on_failure).with(SqsMessage.new(@sqs_message2), exception).raises(StandardError.new("failed to move"))
|
183
178
|
@listener.expects(:delete_message).with(@sqs_message1).never
|
184
179
|
@listener.expects(:delete_message).with(@sqs_message2).never
|
185
|
-
@listener.
|
186
|
-
@listener.send(:read_messages_from_queue, queue_url, Propono.config.num_messages_per_poll)
|
180
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
187
181
|
end
|
188
182
|
|
189
183
|
def test_messages_are_moved_to_corrupt_queue_if_there_is_an_parsing_exception
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
@messages[
|
194
|
-
@messages["Message"][1] = sqs_message2
|
184
|
+
sqs_message1 = mock(body: "foobar", receipt_handle: "123")
|
185
|
+
sqs_message2 = mock(body: "barfoo", receipt_handle: "321")
|
186
|
+
@messages[0] = sqs_message1
|
187
|
+
@messages[1] = sqs_message2
|
195
188
|
|
196
189
|
@listener.expects(:move_to_corrupt_queue).with(sqs_message1)
|
197
190
|
@listener.expects(:move_to_corrupt_queue).with(sqs_message2)
|
198
|
-
@listener.send(:read_messages_from_queue,
|
191
|
+
@listener.send(:read_messages_from_queue, @queue, propono_config.num_messages_per_poll)
|
199
192
|
end
|
200
193
|
|
201
194
|
def test_message_moved_to_failed_queue_if_there_is_an_exception_and_retry_count_is_zero
|
202
|
-
|
195
|
+
aws_client.expects(:send_to_sqs).with(@failed_queue, anything)
|
203
196
|
@listener.send(:requeue_message_on_failure, SqsMessage.new(@sqs_message1), StandardError.new)
|
204
197
|
end
|
205
198
|
|
206
199
|
def test_message_requeued_if_there_is_an_exception_but_failure_count_less_than_retry_count
|
207
|
-
|
200
|
+
propono_config.max_retries = propono_config.num_messages_per_poll
|
208
201
|
message = SqsMessage.new(@sqs_message1)
|
209
202
|
message.stubs(failure_count: 4)
|
210
|
-
|
203
|
+
aws_client.expects(:send_to_sqs).with(@queue, anything)
|
211
204
|
@listener.send(:requeue_message_on_failure, message, StandardError.new)
|
212
205
|
end
|
213
206
|
|
214
207
|
def test_message_requeued_if_there_is_an_exception_but_failure_count_exceeds_than_retry_count
|
215
|
-
|
208
|
+
propono_config.max_retries = propono_config.num_messages_per_poll
|
216
209
|
message = SqsMessage.new(@sqs_message1)
|
217
|
-
message.stubs(failure_count:
|
218
|
-
|
210
|
+
message.stubs(failure_count: propono_config.num_messages_per_poll)
|
211
|
+
aws_client.expects(:send_to_sqs).with(@failed_queue, anything)
|
219
212
|
@listener.send(:requeue_message_on_failure, message, StandardError.new)
|
220
213
|
end
|
221
214
|
|
222
215
|
def test_move_to_corrupt_queue
|
223
|
-
|
216
|
+
aws_client.expects(:send_to_sqs).with(@corrupt_queue, @sqs_message1.body)
|
224
217
|
@listener.send(:move_to_corrupt_queue, @sqs_message1)
|
225
218
|
end
|
226
219
|
|
227
220
|
def test_if_no_messages_read_from_normal_queue_read_from_slow_queue
|
228
|
-
|
229
|
-
@listener.stubs(
|
230
|
-
|
231
|
-
@listener.stubs(
|
221
|
+
main_queue = mock
|
222
|
+
@listener.stubs(main_queue: main_queue)
|
223
|
+
slow_queue = mock
|
224
|
+
@listener.stubs(slow_queue: slow_queue)
|
232
225
|
|
233
|
-
@listener.expects(:read_messages_from_queue).with(
|
234
|
-
@listener.expects(:read_messages_from_queue).with(
|
226
|
+
@listener.expects(:read_messages_from_queue).with(main_queue, propono_config.num_messages_per_poll).returns(false)
|
227
|
+
@listener.expects(:read_messages_from_queue).with(slow_queue, 1)
|
235
228
|
@listener.send(:read_messages)
|
236
229
|
end
|
237
230
|
|
238
231
|
def test_if_read_messages_from_normal_do_not_read_from_slow_queue
|
239
|
-
|
240
|
-
@listener.stubs(
|
232
|
+
main_queue = mock
|
233
|
+
@listener.stubs(main_queue: main_queue)
|
241
234
|
|
242
|
-
@listener.expects(:read_messages_from_queue).with(
|
235
|
+
@listener.expects(:read_messages_from_queue).with(main_queue, propono_config.num_messages_per_poll).returns(true)
|
243
236
|
@listener.send(:read_messages)
|
244
237
|
end
|
245
238
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require "codeclimate-test-reporter"
|
2
|
-
CodeClimate::TestReporter.start
|
3
|
-
|
4
1
|
gem "minitest"
|
5
2
|
require "minitest/autorun"
|
6
3
|
require "minitest/pride"
|
@@ -14,55 +11,31 @@ require "propono"
|
|
14
11
|
|
15
12
|
class Minitest::Test
|
16
13
|
def setup
|
17
|
-
Fog.mock!
|
18
|
-
Propono.config do |config|
|
19
|
-
config.access_key = "test-access-key"
|
20
|
-
config.secret_key = "test-secret-key"
|
21
|
-
config.queue_region = "us-east-1"
|
22
|
-
config.application_name = "MyApp"
|
23
|
-
config.queue_suffix = ""
|
24
|
-
|
25
|
-
config.logger.stubs(:debug)
|
26
|
-
config.logger.stubs(:info)
|
27
|
-
config.logger.stubs(:error)
|
28
|
-
end
|
29
14
|
end
|
30
|
-
end
|
31
15
|
|
32
|
-
|
33
|
-
|
34
|
-
def create_topic(*args)
|
35
|
-
foo = Object.new
|
36
|
-
class << foo
|
37
|
-
def body
|
38
|
-
{"TopicArn" => "FoobarFromTheMock"}
|
39
|
-
end
|
40
|
-
end
|
41
|
-
foo
|
42
|
-
end
|
16
|
+
def propono_config
|
17
|
+
return @propono_config if @propono_config
|
43
18
|
|
44
|
-
|
45
|
-
|
46
|
-
|
19
|
+
@propono_config = Propono::Configuration.new
|
20
|
+
@propono_config.access_key = "test-access-key"
|
21
|
+
@propono_config.secret_key = "test-secret-key"
|
22
|
+
@propono_config.queue_region = "us-east-1"
|
23
|
+
@propono_config.application_name = "MyApp"
|
24
|
+
@propono_config.queue_suffix = ""
|
47
25
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
{"QueueUrls" => []}
|
54
|
-
end
|
55
|
-
end
|
56
|
-
foo
|
57
|
-
end
|
58
|
-
def create_queue(*args)
|
26
|
+
@propono_config.logger.stubs(:debug)
|
27
|
+
@propono_config.logger.stubs(:info)
|
28
|
+
@propono_config.logger.stubs(:error)
|
29
|
+
|
30
|
+
@propono_config
|
59
31
|
end
|
60
|
-
|
32
|
+
|
33
|
+
def aws_client
|
34
|
+
return @aws_client if @aws_client
|
35
|
+
|
36
|
+
@aws_client = Propono::AwsClient.new(mock)
|
37
|
+
@aws_client.stubs(:sns_client)
|
38
|
+
@aws_client.stubs(:sqs_client)
|
39
|
+
@aws_client
|
61
40
|
end
|
62
41
|
end
|
63
|
-
|
64
|
-
Fog::AWS::SQS::Mock::QueueUrl = 'https://meducation.net/foobar'
|
65
|
-
Fog::AWS::SQS::Mock::QueueArn = 'FoobarArn'
|
66
|
-
data = {'Attributes' => {"QueueArn" => Fog::AWS::SQS::Mock::QueueArn}}
|
67
|
-
queues = Fog::AWS::SQS::Mock.data["us-east-1"]["test-access-key"][:queues]
|
68
|
-
queues[Fog::AWS::SQS::Mock::QueueUrl] = data
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: propono
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MalcyL
|
@@ -9,10 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: aws-sdk-sns
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: aws-sdk-sqs
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|
17
31
|
requirements:
|
18
32
|
- - ">="
|
@@ -97,8 +111,9 @@ dependencies:
|
|
97
111
|
version: 5.0.8
|
98
112
|
description: Pub / Sub Library using Amazon Web Services
|
99
113
|
email:
|
114
|
+
- jez.walker@gmail.com
|
115
|
+
- c.p.care@gmail.com
|
100
116
|
- malcolm@landonsonline.me.uk
|
101
|
-
- jeremy@meducation.net
|
102
117
|
executables: []
|
103
118
|
extensions: []
|
104
119
|
extra_rdoc_files: []
|
@@ -112,51 +127,34 @@ files:
|
|
112
127
|
- README.md
|
113
128
|
- Rakefile
|
114
129
|
- lib/propono.rb
|
130
|
+
- lib/propono/components/aws_client.rb
|
115
131
|
- lib/propono/components/aws_config.rb
|
116
|
-
- lib/propono/components/
|
132
|
+
- lib/propono/components/client.rb
|
117
133
|
- lib/propono/components/queue.rb
|
118
134
|
- lib/propono/components/queue_subscription.rb
|
119
|
-
- lib/propono/components/sns.rb
|
120
|
-
- lib/propono/components/sqs.rb
|
121
135
|
- lib/propono/components/sqs_message.rb
|
122
136
|
- lib/propono/components/topic.rb
|
123
137
|
- lib/propono/configuration.rb
|
124
138
|
- lib/propono/logger.rb
|
125
139
|
- lib/propono/propono_error.rb
|
126
140
|
- lib/propono/services/publisher.rb
|
127
|
-
- lib/propono/services/queue_creator.rb
|
128
141
|
- lib/propono/services/queue_listener.rb
|
129
|
-
- lib/propono/services/subscriber.rb
|
130
|
-
- lib/propono/services/tcp_listener.rb
|
131
|
-
- lib/propono/services/topic_creator.rb
|
132
|
-
- lib/propono/services/udp_listener.rb
|
133
142
|
- lib/propono/utils.rb
|
134
143
|
- lib/propono/version.rb
|
135
144
|
- propono.gemspec
|
136
145
|
- test/components/aws_config_test.rb
|
137
|
-
- test/components/
|
146
|
+
- test/components/client_test.rb
|
138
147
|
- test/components/queue_subscription_test.rb
|
139
148
|
- test/components/queue_test.rb
|
140
|
-
- test/components/sns_test.rb
|
141
|
-
- test/components/sqs_test.rb
|
142
149
|
- test/components/topic_test.rb
|
143
150
|
- test/config.yml.example
|
144
151
|
- test/configuration_test.rb
|
145
152
|
- test/integration/integration_test.rb
|
146
153
|
- test/integration/slow_queue_test.rb
|
147
154
|
- test/integration/sns_to_sqs_test.rb
|
148
|
-
- test/integration/tcp_to_sqs_test.rb
|
149
|
-
- test/integration/udp_proxy_test.rb
|
150
|
-
- test/integration/udp_to_sqs_test.rb
|
151
155
|
- test/logger_test.rb
|
152
|
-
- test/propono_test.rb
|
153
156
|
- test/services/publisher_test.rb
|
154
|
-
- test/services/queue_creator_test.rb
|
155
157
|
- test/services/queue_listener_test.rb
|
156
|
-
- test/services/subscriber_test.rb
|
157
|
-
- test/services/tcp_listener_test.rb
|
158
|
-
- test/services/topic_creator_test.rb
|
159
|
-
- test/services/udp_listener_test.rb
|
160
158
|
- test/test_helper.rb
|
161
159
|
- test/utils/hash_test.rb
|
162
160
|
homepage: ''
|
@@ -174,40 +172,29 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
172
|
version: '0'
|
175
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
174
|
requirements:
|
177
|
-
- - "
|
175
|
+
- - ">"
|
178
176
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
177
|
+
version: 1.3.1
|
180
178
|
requirements: []
|
181
179
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.6.
|
180
|
+
rubygems_version: 2.6.13
|
183
181
|
signing_key:
|
184
182
|
specification_version: 4
|
185
183
|
summary: General purpose pub/sub library built on top of AWS SNS and SQS
|
186
184
|
test_files:
|
187
185
|
- test/components/aws_config_test.rb
|
188
|
-
- test/components/
|
186
|
+
- test/components/client_test.rb
|
189
187
|
- test/components/queue_subscription_test.rb
|
190
188
|
- test/components/queue_test.rb
|
191
|
-
- test/components/sns_test.rb
|
192
|
-
- test/components/sqs_test.rb
|
193
189
|
- test/components/topic_test.rb
|
194
190
|
- test/config.yml.example
|
195
191
|
- test/configuration_test.rb
|
196
192
|
- test/integration/integration_test.rb
|
197
193
|
- test/integration/slow_queue_test.rb
|
198
194
|
- test/integration/sns_to_sqs_test.rb
|
199
|
-
- test/integration/tcp_to_sqs_test.rb
|
200
|
-
- test/integration/udp_proxy_test.rb
|
201
|
-
- test/integration/udp_to_sqs_test.rb
|
202
195
|
- test/logger_test.rb
|
203
|
-
- test/propono_test.rb
|
204
196
|
- test/services/publisher_test.rb
|
205
|
-
- test/services/queue_creator_test.rb
|
206
197
|
- test/services/queue_listener_test.rb
|
207
|
-
- test/services/subscriber_test.rb
|
208
|
-
- test/services/tcp_listener_test.rb
|
209
|
-
- test/services/topic_creator_test.rb
|
210
|
-
- test/services/udp_listener_test.rb
|
211
198
|
- test/test_helper.rb
|
212
199
|
- test/utils/hash_test.rb
|
213
200
|
has_rdoc:
|