alephant-publisher-queue 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c504f07d7863ff3576e44fdab5fc636f6e605dff
4
- data.tar.gz: 019473a699726070746e77b1afbdd856dc7a00c5
3
+ metadata.gz: 64ba6a3a882e8b61c28648c92feaf5ee17d61297
4
+ data.tar.gz: fbdddb32c3f9b9d2c3fe4824d0b616dd0ffe26a6
5
5
  SHA512:
6
- metadata.gz: 3a39e4ae36d770ad09eaa5def46d679c1b909d16479f69cfbad0299937479ab03346841a8f43c5a3f2c5ae2ef0c2049efd7793402a0f4a30fdd9127786509532
7
- data.tar.gz: 01a491d6cc5b9208b8467c7d19b6ed4c53ae677c6bb7606a753d9e1aef4a39b0eed54a651329017ce08b376a5d1716a8bef841f125ca46fcb034e146bf50f8c7
6
+ metadata.gz: a1cdff714f9c95b679ac478892492d08f0cf72362b3a47176274ee22f4170e872eaf4c2ad6a9f3d4012e41c5c1237f009d54e214c9263e7b06c87614494a2661
7
+ data.tar.gz: d0986167432599fba5159e38790c913f2f074357bf8d10fb7783e0e1fe3311e37c1274077c11bbd076b1921d2b16e1b431e6d3ffe8d8f3ebfed3b6f0c8743b80
data/.gitignore CHANGED
@@ -16,7 +16,6 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  .rspec
19
- .ruby-version
20
19
  /config/*.yaml
21
20
  /config/*.yml
22
21
  /components
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ jruby-1.7
@@ -49,7 +49,7 @@ module Alephant
49
49
  validate type, opts
50
50
  instance.merge! opts
51
51
  rescue Exception => e
52
- logger.metric(:name => "PublisherQueueInvalidKeySpecifiedError", :unit => "Count", :value => 1)
52
+ logger.warn "Publisher::Queue::Options#validate: '#{e.message}'"
53
53
  puts e.message
54
54
  end
55
55
  end
@@ -1,3 +1,4 @@
1
+ require 'alephant/logger'
1
2
  require 'date'
2
3
 
3
4
  module Alephant
@@ -5,6 +6,8 @@ module Alephant
5
6
  module Queue
6
7
  module SQSHelper
7
8
  class Archiver
9
+ include Logger
10
+
8
11
  attr_reader :cache, :async
9
12
 
10
13
  def initialize(cache, async = true)
@@ -24,6 +27,7 @@ module Alephant
24
27
  end
25
28
 
26
29
  def store(m)
30
+ logger.info "Publisher::Queue::SQSHelper::Archiver#store: '#{m.body}' at 'archive/#{date_key}/#{m.id}'"
27
31
  cache.put("archive/#{date_key}/#{m.id}", m.body, meta_for(m))
28
32
  end
29
33
 
@@ -51,4 +51,3 @@ module Alephant
51
51
  end
52
52
  end
53
53
  end
54
-
@@ -1,7 +1,7 @@
1
1
  module Alephant
2
2
  module Publisher
3
3
  module Queue
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
6
6
  end
7
7
  end
@@ -45,12 +45,14 @@ module Alephant
45
45
  end
46
46
 
47
47
  def write(id, view)
48
+ logger.info "Publisher::Queue::Writer#writes: id '#{id}', view '#{view}'"
48
49
  seq_for(id).validate(message) do
49
50
  store(id, view, location_for(id))
50
51
  end
51
52
  end
52
53
 
53
54
  def store(id, view, location)
55
+ logger.info "Publisher::Queue::Writer#store: location '#{location}', message.id '#{message.id}'"
54
56
  cache.put(location, view.render, view.content_type, :msg_id => message.id)
55
57
  lookup.write(id, options, seq_id, location)
56
58
  end
@@ -64,7 +66,7 @@ module Alephant
64
66
  end
65
67
 
66
68
  def batch?
67
- !batch.nil?
69
+ !batch.nil?.tap { |b| logger.info "Publisher::Queue::Writer#batch?: #{b}" }
68
70
  end
69
71
 
70
72
  def seq_for(id)
@@ -11,14 +11,14 @@ require 'json'
11
11
  module Alephant
12
12
  module Publisher
13
13
  module Queue
14
- include Logger
15
-
16
14
  def self.create(opts = {}, processor = nil)
17
15
  processor ||= Processor.new(opts.writer)
18
16
  Publisher.new(opts, processor)
19
17
  end
20
18
 
21
19
  class Publisher
20
+ include Logger
21
+
22
22
  VISIBILITY_TIMEOUT = 60
23
23
  RECEIVE_WAIT_TIME = 15
24
24
 
@@ -58,6 +58,7 @@ module Alephant
58
58
  end
59
59
 
60
60
  def sqs_queue_options
61
+ logger.info "Publisher::Queue::Publisher#sqs_queue_options: AWS Account ID '#{opts.queue[:aws_account_id]}'"
61
62
  opts.queue[:aws_account_id].nil? ? {} : { :queue_owner_aws_account_id => opts.queue[:aws_account_id] }
62
63
  end
63
64
 
@@ -69,4 +70,3 @@ module Alephant
69
70
  end
70
71
  end
71
72
  end
72
-
metadata CHANGED
@@ -1,262 +1,262 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-publisher-queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - revett
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ~>
18
17
  - !ruby/object:Gem::Version
19
18
  version: '1.5'
20
- type: :development
19
+ name: bundler
21
20
  prerelease: false
21
+ type: :development
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - '>='
32
31
  - !ruby/object:Gem::Version
33
32
  version: '0'
34
- type: :development
33
+ name: rspec
35
34
  prerelease: false
35
+ type: :development
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec-nc
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - '>='
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
48
- type: :development
47
+ name: rspec-nc
49
48
  prerelease: false
49
+ type: :development
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: guard
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - '>='
60
59
  - !ruby/object:Gem::Version
61
60
  version: '0'
62
- type: :development
61
+ name: guard
63
62
  prerelease: false
63
+ type: :development
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: guard-rspec
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - '>='
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0'
76
- type: :development
75
+ name: guard-rspec
77
76
  prerelease: false
77
+ type: :development
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: pry
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - '>='
88
87
  - !ruby/object:Gem::Version
89
88
  version: '0'
90
- type: :development
89
+ name: pry
91
90
  prerelease: false
91
+ type: :development
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: pry-remote
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - '>='
102
101
  - !ruby/object:Gem::Version
103
102
  version: '0'
104
- type: :development
103
+ name: pry-remote
105
104
  prerelease: false
105
+ type: :development
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: pry-nav
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - '>='
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0'
118
- type: :development
117
+ name: pry-nav
119
118
  prerelease: false
119
+ type: :development
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rake-rspec
127
126
  requirement: !ruby/object:Gem::Requirement
128
127
  requirements:
129
128
  - - '>='
130
129
  - !ruby/object:Gem::Version
131
130
  version: '0'
132
- type: :development
131
+ name: rake-rspec
133
132
  prerelease: false
133
+ type: :development
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rake
141
140
  requirement: !ruby/object:Gem::Requirement
142
141
  requirements:
143
142
  - - '>='
144
143
  - !ruby/object:Gem::Version
145
144
  version: '0'
146
- type: :runtime
145
+ name: rake
147
146
  prerelease: false
147
+ type: :runtime
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: aws-sdk
155
154
  requirement: !ruby/object:Gem::Requirement
156
155
  requirements:
157
156
  - - ~>
158
157
  - !ruby/object:Gem::Version
159
158
  version: '1.0'
160
- type: :runtime
159
+ name: aws-sdk
161
160
  prerelease: false
161
+ type: :runtime
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: crimp
169
168
  requirement: !ruby/object:Gem::Requirement
170
169
  requirements:
171
170
  - - '>='
172
171
  - !ruby/object:Gem::Version
173
172
  version: '0'
174
- type: :runtime
173
+ name: crimp
175
174
  prerelease: false
175
+ type: :runtime
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
- name: alephant-support
183
182
  requirement: !ruby/object:Gem::Requirement
184
183
  requirements:
185
184
  - - '>='
186
185
  - !ruby/object:Gem::Version
187
186
  version: '0'
188
- type: :runtime
187
+ name: alephant-support
189
188
  prerelease: false
189
+ type: :runtime
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
- name: alephant-sequencer
197
196
  requirement: !ruby/object:Gem::Requirement
198
197
  requirements:
199
198
  - - '>='
200
199
  - !ruby/object:Gem::Version
201
200
  version: '0'
202
- type: :runtime
201
+ name: alephant-sequencer
203
202
  prerelease: false
203
+ type: :runtime
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - '>='
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
- name: alephant-cache
211
210
  requirement: !ruby/object:Gem::Requirement
212
211
  requirements:
213
212
  - - '>='
214
213
  - !ruby/object:Gem::Version
215
214
  version: '0'
216
- type: :runtime
215
+ name: alephant-cache
217
216
  prerelease: false
217
+ type: :runtime
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
- name: alephant-logger
225
224
  requirement: !ruby/object:Gem::Requirement
226
225
  requirements:
227
226
  - - '>='
228
227
  - !ruby/object:Gem::Version
229
228
  version: '0'
230
- type: :runtime
229
+ name: alephant-logger
231
230
  prerelease: false
231
+ type: :runtime
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '>='
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
- name: alephant-lookup
239
238
  requirement: !ruby/object:Gem::Requirement
240
239
  requirements:
241
240
  - - '>='
242
241
  - !ruby/object:Gem::Version
243
242
  version: '0'
244
- type: :runtime
243
+ name: alephant-lookup
245
244
  prerelease: false
245
+ type: :runtime
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '>='
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  - !ruby/object:Gem::Dependency
252
- name: alephant-renderer
253
252
  requirement: !ruby/object:Gem::Requirement
254
253
  requirements:
255
254
  - - ~>
256
255
  - !ruby/object:Gem::Version
257
256
  version: 0.1.0
258
- type: :runtime
257
+ name: alephant-renderer
259
258
  prerelease: false
259
+ type: :runtime
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - ~>
@@ -270,6 +270,7 @@ extensions: []
270
270
  extra_rdoc_files: []
271
271
  files:
272
272
  - .gitignore
273
+ - .ruby-version
273
274
  - .travis.yml
274
275
  - Gemfile
275
276
  - Guardfile
@@ -296,7 +297,7 @@ homepage: https://github.com/BBC-News/alephant-publisher-queue
296
297
  licenses:
297
298
  - MIT
298
299
  metadata: {}
299
- post_install_message:
300
+ post_install_message:
300
301
  rdoc_options: []
301
302
  require_paths:
302
303
  - lib
@@ -311,9 +312,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
312
  - !ruby/object:Gem::Version
312
313
  version: '0'
313
314
  requirements: []
314
- rubyforge_project:
315
- rubygems_version: 2.0.14
316
- signing_key:
315
+ rubyforge_project:
316
+ rubygems_version: 2.1.9
317
+ signing_key:
317
318
  specification_version: 4
318
319
  summary: Static publishing to S3 based on SQS messages
319
320
  test_files: