fluent-plugin-rabbitmq 0.0.5 → 0.0.6
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/README.md +4 -0
- data/fluent-plugin-rabbitmq.gemspec +1 -1
- data/lib/fluent/plugin/out_rabbitmq.rb +32 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe96873dd049e18d49cf46c8e220635c67b96c22d71fd72c51441f3cc7c794d
|
4
|
+
data.tar.gz: ee06d3de86ca93ac03c540eeac105f18b1ccc99ea897c05c40b46a0aee926d3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e00500844dd157eb22b002ec2d9338c13b516062a0297be5ad90fb2fdf27424d9e443e7e380ac0d58b01ea475b699affdb832a804f8ddcd175c576e30d46a2e
|
7
|
+
data.tar.gz: 5d31f9ce8e15e6337e38d252f9c3a0fe6a65adf05704850ac68d44b7e780b121507406856799f5919391d7bf848eb4537e661e14ff52f401447afa2a083d0010
|
data/README.md
CHANGED
@@ -34,6 +34,8 @@ fluentd >= 0.14.0
|
|
34
34
|
<parse>
|
35
35
|
@type json # or msgpack, ltsv, none
|
36
36
|
</parse>
|
37
|
+
<buffer> # to use in buffered mode
|
38
|
+
</buffer>
|
37
39
|
</source>
|
38
40
|
```
|
39
41
|
|
@@ -78,11 +80,13 @@ fluentd >= 0.14.0
|
|
78
80
|
|persistent|true|false|messages is persistent to disk|
|
79
81
|
|timestamp|true|false|if true, time of record is used as timestamp in AMQP message|
|
80
82
|
|content_type|application/json|nil|message content type|
|
83
|
+
|frame_max|131072|nil|maximum permissible size of a frame|
|
81
84
|
|mandatory||true|nil||
|
82
85
|
|expiration|3600|nil|message time-to-live|
|
83
86
|
|message_type||nil||
|
84
87
|
|priority||nil||
|
85
88
|
|app_id||nil||
|
89
|
+
|id_key|message_id|nil|id to specify message_id|
|
86
90
|
|
87
91
|
### TLS related configurations
|
88
92
|
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "fluent-plugin-rabbitmq"
|
6
|
-
spec.version = "0.0.
|
6
|
+
spec.version = "0.0.6"
|
7
7
|
spec.authors = ["NTT Communications"]
|
8
8
|
spec.email = ["masaki.matsushita@ntt.com"]
|
9
9
|
|
@@ -42,6 +42,7 @@ module Fluent::Plugin
|
|
42
42
|
param == "server" ? :server : Integer(param)
|
43
43
|
end
|
44
44
|
config_param :threaded, :bool, default: true
|
45
|
+
config_param :frame_max, :integer, default: nil
|
45
46
|
|
46
47
|
config_param :tls, :bool, default: false
|
47
48
|
config_param :tls_cert, :string, default: nil
|
@@ -55,9 +56,10 @@ module Fluent::Plugin
|
|
55
56
|
|
56
57
|
config_param :persistent, :bool, default: false
|
57
58
|
config_param :routing_key, :string, default: nil
|
59
|
+
config_param :id_key, :string, default: nil
|
58
60
|
config_param :timestamp, :bool, default: false
|
59
61
|
config_param :content_type, :string, default: nil
|
60
|
-
config_param :
|
62
|
+
config_param :content_encoding, :string, default: nil
|
61
63
|
config_param :expiration, :integer, default: nil
|
62
64
|
config_param :message_type, :integer, default: nil
|
63
65
|
config_param :priority, :integer, default: nil
|
@@ -87,8 +89,8 @@ module Fluent::Plugin
|
|
87
89
|
bunny_options[:recovery_attempts] = @recovery_attempts
|
88
90
|
bunny_options[:auth_mechanism] = @auth_mechanism if @auth_mechanism
|
89
91
|
bunny_options[:heartbeat] = @heartbeat if @heartbeat
|
90
|
-
bunny_options[:threaded] = @threaded
|
91
92
|
bunny_options[:logger] = log
|
93
|
+
bunny_options[:frame_max] = @frame_max if @frame_max
|
92
94
|
|
93
95
|
bunny_options[:tls] = @tls
|
94
96
|
bunny_options[:tls_cert] = @tls_cert if @tls_cert
|
@@ -100,6 +102,7 @@ module Fluent::Plugin
|
|
100
102
|
|
101
103
|
@publish_options = {}
|
102
104
|
@publish_options[:content_type] = @content_type if @content_type
|
105
|
+
@publish_options[:content_encoding] = @content_encoding if @content_encoding
|
103
106
|
@publish_options[:persistent] = @persistent if @persistent
|
104
107
|
@publish_options[:mandatory] = @mandatory if @mandatory
|
105
108
|
@publish_options[:expiration] = @expiration if @expiration
|
@@ -107,13 +110,17 @@ module Fluent::Plugin
|
|
107
110
|
@publish_options[:priority] = @priority if @priority
|
108
111
|
@publish_options[:app_id] = @app_id if @app_id
|
109
112
|
|
110
|
-
@formatter = formatter_create
|
113
|
+
@formatter = formatter_create(default_type: @type)
|
111
114
|
end
|
112
115
|
|
113
116
|
def multi_workers_ready?
|
114
117
|
true
|
115
118
|
end
|
116
119
|
|
120
|
+
def prefer_buffered_processing
|
121
|
+
false
|
122
|
+
end
|
123
|
+
|
117
124
|
def start
|
118
125
|
super
|
119
126
|
@bunny.start
|
@@ -130,26 +137,37 @@ module Fluent::Plugin
|
|
130
137
|
super
|
131
138
|
end
|
132
139
|
|
133
|
-
def
|
140
|
+
def set_publish_options(tag, time, record)
|
141
|
+
@publish_options[:timestamp] = time.to_i if @timestamp
|
142
|
+
|
134
143
|
if @exchange_type != "fanout"
|
135
144
|
@publish_options[:routing_key] = @routing_key ? @routing_key : tag
|
136
145
|
end
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
@
|
146
|
+
|
147
|
+
if @id_key
|
148
|
+
id = record[@id_key]
|
149
|
+
@publish_options[:message_id] = id if id
|
141
150
|
end
|
142
151
|
end
|
143
152
|
|
144
|
-
def
|
145
|
-
|
153
|
+
def process(tag, es)
|
154
|
+
es.each do |time, record|
|
155
|
+
set_publish_options(tag, time, record)
|
156
|
+
record = inject_values_to_record(tag, time, record)
|
157
|
+
buf = @formatter.format(tag, time, record)
|
158
|
+
@bunny_exchange.publish(buf, @publish_options)
|
159
|
+
end
|
146
160
|
end
|
147
161
|
|
148
|
-
|
162
|
+
def write(chunk)
|
163
|
+
tag = chunk.metadata.tag
|
149
164
|
|
150
|
-
|
151
|
-
|
152
|
-
|
165
|
+
chunk.each do |time, record|
|
166
|
+
set_publish_options(tag, time, record)
|
167
|
+
record = inject_values_to_record(tag, time, record)
|
168
|
+
buf = @formatter.format(tag, time, record)
|
169
|
+
@bunny_exchange.publish(buf, @publish_options)
|
170
|
+
end
|
153
171
|
end
|
154
172
|
end
|
155
173
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-rabbitmq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NTT Communications
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|