fluent-plugin-gcloud-pubsub-custom 0.4.0 → 0.4.1

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: a8daf09e1eeb0af707c9fc9fda10284540c73555
4
- data.tar.gz: c61879a204d49e5c1e11a630e5274916d3b8e507
3
+ metadata.gz: ce4671f1f14d950d6c5eed9b5c86fab28c0c0e4e
4
+ data.tar.gz: d6b615131cdf7f4a3e64d4f37918f22aafe18c57
5
5
  SHA512:
6
- metadata.gz: 3de06b045e2f552038d2102c35cc127af05ee67d97138c428c5159f34db5f6f2d552215f8f3f882bab8c1c462f242bc7de21c723ee82e0f9a0e202af6802f0f9
7
- data.tar.gz: 17502d7a5df5570848fcfb40de28522618825b5f31dc51674c2ded054827a0082a18b36e373ec375398a2c3ca3797dc11559755fc213996bc58fb054096c23c6
6
+ metadata.gz: 5e0d49b85278cf8f9faa5fbf9f490930131e769130fb7124aa8cf6991eedb0fc68c5ece236c54047f117ce698de75fa225279e760f1a33e1d7be2fd9261aa766
7
+ data.tar.gz: a83690434bc3b5ee2a45c2bd0a244fbb1f21ec0d81516fe42661a33f0d1e08452b4df5ead99201bf2b27ba51125b5fe15f9eeec23e344d05ef06ae3a10eae704
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## ChangeLog
2
2
 
3
+ ### Release 0.4.1 - 2017/02/02
4
+
5
+ - Bump up google-cloud-pubsub to v0.22.x
6
+ - Input plugin
7
+ - Rescue 50x errors on acknowledge api
8
+
3
9
  ### Release 0.4.0 - 2017/01/21
4
10
 
5
11
  - Input plugin
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
data/Gemfile.v0.12 CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gem 'fluentd', '~> 0.12.0'
4
4
 
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.license = "MIT"
8
8
  gem.homepage = "https://github.com/mia-0032/fluent-plugin-gcloud-pubsub-custom"
9
9
  gem.summary = gem.description
10
- gem.version = "0.4.0"
10
+ gem.version = "0.4.1"
11
11
  gem.authors = ["Yoshihiro MIYAI"]
12
12
  gem.email = "msparrow17@gmail.com"
13
13
  gem.has_rdoc = false
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.require_paths = ['lib']
18
18
 
19
19
  gem.add_runtime_dependency "fluentd", [">= 0.10.58", "< 2"]
20
- gem.add_runtime_dependency "google-cloud-pubsub", "~> 0.21.0"
20
+ gem.add_runtime_dependency "google-cloud-pubsub", "~> 0.22.0"
21
21
 
22
22
  gem.add_development_dependency "bundler"
23
23
  gem.add_development_dependency "rake"
@@ -37,11 +37,13 @@ module Fluent
37
37
  def pull(immediate, max)
38
38
  @client.pull immediate: immediate, max: max
39
39
  rescue Google::Cloud::UnavailableError, Google::Cloud::DeadlineExceededError, Google::Cloud::InternalError => ex
40
- raise RetryableError.new "Google api returns error:#{ex.class.to_s} message:#{ex.to_s}"
40
+ raise RetryableError.new "Google pull api returns error:#{ex.class.to_s} message:#{ex.to_s}"
41
41
  end
42
42
 
43
43
  def acknowledge(messages)
44
44
  @client.acknowledge messages
45
+ rescue Google::Cloud::UnavailableError, Google::Cloud::DeadlineExceededError, Google::Cloud::InternalError => ex
46
+ raise RetryableError.new "Google acknowledge api returns error:#{ex.class.to_s} message:#{ex.to_s}"
45
47
  end
46
48
  end
47
49
  end
@@ -236,11 +236,11 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
236
236
  assert_equal(true, d.emits.empty?)
237
237
  end
238
238
 
239
- test 'retry if raised RetryableError' do
239
+ test 'retry if raised RetryableError on pull' do
240
240
  @subscriber.pull(immediate: true, max: 100).twice { raise Google::Cloud::UnavailableError.new('TEST') }
241
241
  @subscriber.acknowledge.times(0)
242
242
 
243
- d = create_driver(CONFIG + 'pull_interval 0.5')
243
+ d = create_driver("#{CONFIG}\npull_interval 0.5")
244
244
  d.run {
245
245
  sleep 0.1 # + 0.5s
246
246
  }
@@ -249,6 +249,25 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
249
249
  assert_equal(true, d.emits.empty?)
250
250
  end
251
251
 
252
+ test 'retry if raised RetryableError on acknowledge' do
253
+ messages = Array.new(1, DummyMessage.new)
254
+ @subscriber.pull(immediate: true, max: 100).twice { messages }
255
+ @subscriber.acknowledge(messages).twice { raise Google::Cloud::UnavailableError.new('TEST') }
256
+
257
+ d = create_driver("#{CONFIG}\npull_interval 0.5")
258
+ d.run {
259
+ sleep 0.1 # + 0.5s
260
+ }
261
+ emits = d.emits
262
+
263
+ # not acknowledged, but already emitted to engine.
264
+ assert_equal(2, emits.length)
265
+ emits.each do |tag, time, record|
266
+ assert_equal("test", tag)
267
+ assert_equal({"foo" => "bar"}, record)
268
+ end
269
+ end
270
+
252
271
  test 'stop by http rpc' do
253
272
  messages = Array.new(1, DummyMessage.new)
254
273
  @subscriber.pull(immediate: true, max: 100).once { messages }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-gcloud-pubsub-custom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshihiro MIYAI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-21 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.21.0
39
+ version: 0.22.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.21.0
46
+ version: 0.22.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement