fluent-plugin-amq 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-amq.gemspec +1 -1
- data/lib/fluent/plugin/in_amq.rb +15 -17
- 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: cbfc8f05ff186e6a7a6b51e1def230d016185d2d
|
4
|
+
data.tar.gz: d2f94f10d607744c620a30bef43baa47dfc27576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e63728cdc6108b9c20be519102fbc5e591ff5aec05004b4f1c4e135730f08b4cea20a7f3e0e24f2640e4e9e2dc7b1a86f721132631883211ca7ee5af07f0328
|
7
|
+
data.tar.gz: 0022d4437bd9c0b59afc271abb16a92b53bf0d5fb794858331a10f7252f57874458d9f46f6d4ba99925466d994c09f17ac67b183789574547d4e2e9c78eeb215
|
data/fluent-plugin-amq.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-amq"
|
6
|
-
s.version = "0.0.
|
6
|
+
s.version = "0.0.6"
|
7
7
|
s.authors = ["Anton Sherkhonov"]
|
8
8
|
s.email = ["sherkhonov@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/t0ffel/fluent-plugin-amq"
|
data/lib/fluent/plugin/in_amq.rb
CHANGED
@@ -31,7 +31,11 @@ module Fluent
|
|
31
31
|
raise ConfigError, "#{NAME}: '#{@cert}' file is missing" unless File.file?(@cert)
|
32
32
|
raise ConfigError, "#{NAME}: '#{@private_key}' file is missing" unless File.file?(@private_key)
|
33
33
|
@ssl_domain = Qpid::Proton::SSLDomain.new(Qpid::Proton::SSLDomain::MODE_CLIENT)
|
34
|
-
|
34
|
+
begin
|
35
|
+
@ssl_domain.credentials(@cert, @private_key, @key_pass)
|
36
|
+
rescue Exception => e
|
37
|
+
raise ConfigError, "#{NAME}: Unable to create credentials: #{e}"
|
38
|
+
end
|
35
39
|
begin
|
36
40
|
@url = Qpid::Proton::uri @url
|
37
41
|
rescue Exception => e
|
@@ -90,12 +94,16 @@ module Fluent
|
|
90
94
|
@log.debug "Connection secured with #{c.transport.ssl.protocol_name.inspect}"
|
91
95
|
end
|
92
96
|
|
93
|
-
def
|
94
|
-
|
95
|
-
body
|
96
|
-
|
97
|
-
|
98
|
-
|
97
|
+
def build_record(message)
|
98
|
+
begin
|
99
|
+
body = JSON.parse(message.body)
|
100
|
+
rescue => e
|
101
|
+
@log.warn "Error decoding JSON from the body of `#{message}`"
|
102
|
+
body = message.body
|
103
|
+
end
|
104
|
+
record = { body: body,
|
105
|
+
address: message.address,
|
106
|
+
msg_id: message.id }
|
99
107
|
record[:properties] = message.properties if (message.properties and message.properties.size > 0)
|
100
108
|
record[:annotations] = message.annotations if (message.annotations and message.annotations.size > 0)
|
101
109
|
record[:instructions] = message.instructions if (message.instructions and message.instructions.size > 0)
|
@@ -107,16 +115,6 @@ module Fluent
|
|
107
115
|
record
|
108
116
|
end
|
109
117
|
|
110
|
-
def build_record(message)
|
111
|
-
begin
|
112
|
-
record = build_json_record(message)
|
113
|
-
rescue => e
|
114
|
-
@log.warn "Error decoding JSON from the body of `#{message}`"
|
115
|
-
record = { body: message }
|
116
|
-
end
|
117
|
-
record
|
118
|
-
end
|
119
|
-
|
120
118
|
def on_message(delivery, message)
|
121
119
|
record = build_record(message)
|
122
120
|
time = Engine.now
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-amq
|
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
|
- Anton Sherkhonov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|