fluent-plugin-mqtt-io 0.3.9 → 0.3.10
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 +2 -1
- data/fluent-plugin-mqtt-io.gemspec +1 -1
- data/lib/fluent/plugin/mqtt_proxy.rb +2 -0
- data/lib/fluent/plugin/out_mqtt.rb +11 -1
- data/test/plugin/test_out_mqtt.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d7e986a8afcf6c7a526c13cfaea4a80804dc441
|
4
|
+
data.tar.gz: e916f2585a275b982060ea8e8b6b4ec191a37c69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dda7025caf66c87d2d35ef1e3071822b9e286710c7e173218d1d6217275c5cb1ab141788196cf6ed014b7fc2f244470758d901cf25a56c50a85b8d835841c93e
|
7
|
+
data.tar.gz: fcca2b61a66583ca4e0544624d08e88d15b4f1e0b146c88fb11fe42fd6ea111a2bcff23fd650425f92053f023fe26f07eb52e0ccfa0682f65bd0195ddc93df1d
|
data/README.md
CHANGED
@@ -123,7 +123,8 @@ For fluent-plugin-mqtt-io ~> v0.3.0
|
|
123
123
|
```
|
124
124
|
|
125
125
|
The options are basically the same as Input Plugin except for "format" and "bulk_trans" (only for Input). Additional options for Output Plugin are the following.
|
126
|
-
|
126
|
+
- **qos**: Quality of Service (QoS) for message publishing, 0 or 1 is valid. 2 is not supported by mqtt client. Default is 1.
|
127
|
+
- **retain**: If set true the broker will keep the message even after sending it to all current subscribers. Default is false
|
127
128
|
- **time_key**: An attribute name used for timestamp field genarated from fluentd time field. Default is nil (omitted).
|
128
129
|
If this option is omitted, timestamp field is not appended to the output record.
|
129
130
|
- **time_format**: Output format of timestamp field. Default is ISO8601. You can specify your own format by using TimeParser.
|
@@ -110,6 +110,8 @@ module Fluent::Plugin
|
|
110
110
|
retry_connect(e, "System call error occurs.")
|
111
111
|
rescue StandardError=> e
|
112
112
|
retry_connect(e, "The other error occurs.")
|
113
|
+
rescue MQTT::NotConnectedException=> e
|
114
|
+
retry_connect(e, "MQTT not connected exception occurs.")
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
@@ -18,6 +18,11 @@ module Fluent::Plugin
|
|
18
18
|
desc 'Topic rewrite replacement string.'
|
19
19
|
config_param :topic_rewrite_replacement, :string, default: nil
|
20
20
|
|
21
|
+
desc 'Retain option which publishing'
|
22
|
+
config_param :retain, :bool, default: false
|
23
|
+
desc 'QoS option which publishing'
|
24
|
+
config_param :qos, :integer, default: 1
|
25
|
+
|
21
26
|
config_section :format do
|
22
27
|
desc 'The format to publish'
|
23
28
|
config_param :@type, :string, default: 'single_value'
|
@@ -139,7 +144,12 @@ module Fluent::Plugin
|
|
139
144
|
chunk.each do |tag, time, record|
|
140
145
|
rescue_disconnection do
|
141
146
|
log.debug "MqttOutput#write: #{rewrite_tag(rewrite_tag(tag))}, #{time}, #{add_send_time(record)}"
|
142
|
-
@client.publish(
|
147
|
+
@client.publish(
|
148
|
+
rewrite_tag(tag),
|
149
|
+
@formatter.format(tag, time, add_send_time(record)),
|
150
|
+
@retain,
|
151
|
+
@qos
|
152
|
+
)
|
143
153
|
end
|
144
154
|
end
|
145
155
|
end
|
@@ -21,6 +21,8 @@ class MqttOutputTest < Test::Unit::TestCase
|
|
21
21
|
host 127.0.0.1
|
22
22
|
port 1300
|
23
23
|
client_id aa-bb-cc-dd
|
24
|
+
retain true
|
25
|
+
qos 2
|
24
26
|
<format>
|
25
27
|
@type json
|
26
28
|
</format>
|
@@ -39,6 +41,8 @@ class MqttOutputTest < Test::Unit::TestCase
|
|
39
41
|
assert_equal '127.0.0.1', d.instance.host
|
40
42
|
assert_equal 1300, d.instance.port
|
41
43
|
assert_equal true, d.instance.monitor.send_time
|
44
|
+
assert_equal true, d.instance.retain
|
45
|
+
assert_equal 2, d.instance.qos
|
42
46
|
assert_equal 'aa-bb-cc-dd', d.instance.client_id
|
43
47
|
|
44
48
|
assert_equal true, d.instance.security.use_tls
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mqtt-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toyokazu Akiyama
|
8
8
|
autorequire:
|
9
9
|
bindir: []
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|