fluent-plugin-gcloud-pubsub-custom 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -3
- data/CHANGELOG.md +5 -0
- data/README.md +14 -12
- data/fluent-plugin-gcloud-pubsub-custom.gemspec +2 -2
- data/lib/fluent/plugin/gcloud_pubsub/client.rb +2 -2
- data/lib/fluent/plugin/in_gcloud_pubsub.rb +0 -2
- data/lib/fluent/plugin/out_gcloud_pubsub.rb +0 -2
- data/test/plugin/test_in_gcloud_pubsub.rb +0 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cff8f14b950f9ad31d4ff53e99eca09abb58f9e408da1e39d47c09b339b97fff
|
4
|
+
data.tar.gz: 8a95a2fe872bf460727d20d6061616919de0aec557d5383347cdc43a1f261e6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aa9e0201dc0d387bfb3d051ea9e3a5ac797d9452658ede73e063e0ea75db14ec9614abc28e0b2088f49dd2cd2aabbdc45a6c50fa4e8c2dea7059a76ae6855e9
|
7
|
+
data.tar.gz: b044538a4c7e5c20d5b4ab521088d3e44c5f6f1ea318e7b000ebc511e8ca2ae76e9b095fb07db8cc8a86e1c244c7aed736e8ad0405ede26e309cd037555eaa9f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -19,6 +19,10 @@ This plugin is forked from https://github.com/mdoi/fluent-plugin-gcloud-pubsub
|
|
19
19
|
- Add a pull style subscription to the topic
|
20
20
|
- Download your credential (json) or [set scope on GCE instance](https://cloud.google.com/compute/docs/api/how-tos/authorization)
|
21
21
|
|
22
|
+
When using output plugin, you need to grant Pub/Sub Publisher and Pub/Sub Viewer role to IAM.
|
23
|
+
|
24
|
+
Also, when using input plugin, you need to grant Pub/Sub Subscriber and Pub/Sub Viewer role to IAM.
|
25
|
+
|
22
26
|
## Requirements
|
23
27
|
|
24
28
|
| fluent-plugin-gcloud-pubsub-custom | fluentd | ruby |
|
@@ -56,11 +60,13 @@ Use `gcloud_pubsub` output plugin.
|
|
56
60
|
max_messages 1000
|
57
61
|
max_total_size 9800000
|
58
62
|
max_message_size 4000000
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
format
|
63
|
+
<buffer>
|
64
|
+
@type memory
|
65
|
+
flush_interval 1s
|
66
|
+
</buffer>
|
67
|
+
<format>
|
68
|
+
@type json
|
69
|
+
</format>
|
64
70
|
</match>
|
65
71
|
```
|
66
72
|
|
@@ -84,10 +90,6 @@ Use `gcloud_pubsub` output plugin.
|
|
84
90
|
- See https://cloud.google.com/pubsub/quotas#other_limits
|
85
91
|
- `max_message_size` (optional, default: `4000000` = `4MB`)
|
86
92
|
- Messages exceeding `max_message_size` are not published because Pub/Sub clients cannot receive it.
|
87
|
-
- `buffer_type`, `buffer_path`, `flush_interval`, `try_flush_interval`
|
88
|
-
- These are fluentd buffer configuration. See http://docs.fluentd.org/articles/buffer-plugin-overview
|
89
|
-
- `format` (optional, default: `json`)
|
90
|
-
- Set output format. See http://docs.fluentd.org/articles/out_file#format
|
91
93
|
|
92
94
|
### Pull messages
|
93
95
|
|
@@ -105,11 +107,13 @@ Use `gcloud_pubsub` input plugin.
|
|
105
107
|
return_immediately true
|
106
108
|
pull_interval 0.5
|
107
109
|
pull_threads 2
|
108
|
-
format json
|
109
110
|
parse_error_action exception
|
110
111
|
enable_rpc true
|
111
112
|
rpc_bind 0.0.0.0
|
112
113
|
rpc_port 24680
|
114
|
+
<parse>
|
115
|
+
@type json
|
116
|
+
</parse>
|
113
117
|
</source>
|
114
118
|
```
|
115
119
|
|
@@ -139,8 +143,6 @@ Use `gcloud_pubsub` input plugin.
|
|
139
143
|
- Pulling messages by intervals of specified seconds.
|
140
144
|
- `pull_threads` (optional, default: `1`)
|
141
145
|
- Set number of threads to pull messages.
|
142
|
-
- `format` (optional, default: `json`)
|
143
|
-
- Set input format. See format section in http://docs.fluentd.org/articles/in_tail
|
144
146
|
- `parse_error_action` (optional, default: `exception`)
|
145
147
|
- Set error type when parsing messages fails.
|
146
148
|
- `exception`: Raise exception. Messages are not acknowledged.
|
@@ -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 = "1.0.
|
10
|
+
gem.version = "1.0.3"
|
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.14.15", "< 2"]
|
20
|
-
gem.add_runtime_dependency "google-cloud-pubsub", "~> 0.
|
20
|
+
gem.add_runtime_dependency "google-cloud-pubsub", "~> 0.30.0"
|
21
21
|
|
22
22
|
gem.add_development_dependency "bundler"
|
23
23
|
gem.add_development_dependency "rake"
|
@@ -9,7 +9,7 @@ module Fluent
|
|
9
9
|
|
10
10
|
class Publisher
|
11
11
|
def initialize(project, key, topic_name, autocreate_topic)
|
12
|
-
pubsub = Google::Cloud::Pubsub.new
|
12
|
+
pubsub = Google::Cloud::Pubsub.new project_id: project, credentials: key
|
13
13
|
@client = pubsub.topic topic_name
|
14
14
|
if @client.nil?
|
15
15
|
if autocreate_topic
|
@@ -33,7 +33,7 @@ module Fluent
|
|
33
33
|
|
34
34
|
class Subscriber
|
35
35
|
def initialize(project, key, topic_name, subscription_name)
|
36
|
-
pubsub = Google::Cloud::Pubsub.new
|
36
|
+
pubsub = Google::Cloud::Pubsub.new project_id: project, credentials: key
|
37
37
|
topic = pubsub.topic topic_name
|
38
38
|
@client = topic.subscription subscription_name
|
39
39
|
raise Error.new "subscription:#{subscription_name} does not exist." if @client.nil?
|
@@ -37,8 +37,6 @@ module Fluent::Plugin
|
|
37
37
|
config_param :return_immediately, :bool, default: true
|
38
38
|
desc 'Set number of threads to pull messages.'
|
39
39
|
config_param :pull_threads, :integer, default: 1
|
40
|
-
desc 'Set input format.'
|
41
|
-
config_param :format, :string, default: DEFAULT_PARSER_TYPE
|
42
40
|
desc 'Set error type when parsing messages fails.'
|
43
41
|
config_param :parse_error_action, :enum, default: :exception, list: [:exception, :warning]
|
44
42
|
# for HTTP RPC
|
@@ -25,8 +25,6 @@ module Fluent::Plugin
|
|
25
25
|
config_param :max_total_size, :integer, :default => 9800000 # 9.8MB
|
26
26
|
desc 'Limit bytesize per message.'
|
27
27
|
config_param :max_message_size, :integer, :default => 4000000 # 4MB
|
28
|
-
desc 'Set output format.'
|
29
|
-
config_param :format, :string, :default => 'json'
|
30
28
|
|
31
29
|
config_section :buffer do
|
32
30
|
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
@@ -11,8 +11,6 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
|
|
11
11
|
topic topic-test
|
12
12
|
subscription subscription-test
|
13
13
|
key key-test
|
14
|
-
format json
|
15
|
-
json_parser yajl
|
16
14
|
]
|
17
15
|
|
18
16
|
DEFAULT_HOST = '127.0.0.1'
|
@@ -55,7 +53,6 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
|
|
55
53
|
return_immediately true
|
56
54
|
pull_interval 2
|
57
55
|
pull_threads 3
|
58
|
-
format ltsv
|
59
56
|
enable_rpc true
|
60
57
|
rpc_bind 127.0.0.1
|
61
58
|
rpc_port 24681
|
@@ -70,7 +67,6 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
|
|
70
67
|
assert_equal(1000, d.instance.max_messages)
|
71
68
|
assert_equal(true, d.instance.return_immediately)
|
72
69
|
assert_equal(3, d.instance.pull_threads)
|
73
|
-
assert_equal('ltsv', d.instance.format)
|
74
70
|
assert_equal(true, d.instance.enable_rpc)
|
75
71
|
assert_equal('127.0.0.1', d.instance.rpc_bind)
|
76
72
|
assert_equal(24681, d.instance.rpc_port)
|
@@ -82,7 +78,6 @@ class GcloudPubSubInputTest < Test::Unit::TestCase
|
|
82
78
|
assert_equal(100, d.instance.max_messages)
|
83
79
|
assert_equal(true, d.instance.return_immediately)
|
84
80
|
assert_equal(1, d.instance.pull_threads)
|
85
|
-
assert_equal('json', d.instance.format)
|
86
81
|
assert_equal(false, d.instance.enable_rpc)
|
87
82
|
assert_equal('0.0.0.0', d.instance.rpc_bind)
|
88
83
|
assert_equal(24680, d.instance.rpc_port)
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshihiro MIYAI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-29 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.
|
39
|
+
version: 0.30.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.
|
46
|
+
version: 0.30.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.7.3
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Google Cloud Pub/Sub input/output plugin for Fluentd event collector
|