fluent-plugin-amqp 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/fluent/plugin/in_amqp.rb +18 -8
  3. metadata +6 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e93fe77ace14180d097374471e736a137036749d
4
- data.tar.gz: 6cb705baeaa7630379a9796a0ebb72e8f4c3cba7
2
+ SHA256:
3
+ metadata.gz: 83133837639cc240c17c319ddc075ff365e4ed599e393439216f00a7ba62ec12
4
+ data.tar.gz: 51005871d326dd9ee209f77e96c602892e2ef8bda5a126753007bd5e82770470
5
5
  SHA512:
6
- metadata.gz: 2e426235e9caaa1b2f33ee7684820e48b2e73fcdb1c82bebe5e018e343924f6e61fcfb8064f4ff99b4e77bcc148e88f557290007e0d0bddb6c36108728f8bba9
7
- data.tar.gz: 6bf70391454be18dc1ef97e157bc2dcd87ec8da28e95103e5a04c42d01feed1dcb22fc899ef922e3c1f5ee52af1a5161973634f4c4106bf08441722713f14cc5
6
+ metadata.gz: 8bd4d7ca5e802b74fcee42bd7050dc63e20d4ee0fdbbf15ab8b3084df3c302ec674b1452ada1ff19ba48a0d4c59affc191f71bd93f35277b115d0aff42fef228
7
+ data.tar.gz: 88494f525f1b9c6d3b211068e1a3a5ee04b4dc03a34dded4415534046e6329fe9ad480e04cc12d4ea08104c3837d8f2ae7c4f70d0fd09d64a76b1f5930a70b6d
@@ -44,6 +44,8 @@ module Fluent::Plugin
44
44
  config_param :bind_exchange, :bool, default: false
45
45
  config_param :exchange, :string, default: ""
46
46
  config_param :routing_key, :string, default: "#" # The routing key used to bind queue to exchange - # = matches all, * matches section (tag.*.info)
47
+ config_param :include_headers, :bool, default: false
48
+ config_param :auth_mechanism, :string, default: nil
47
49
 
48
50
  def configure(conf)
49
51
  conf['format'] ||= conf['payload_format'] # legacy
@@ -83,8 +85,10 @@ module Fluent::Plugin
83
85
  end
84
86
 
85
87
  q.subscribe do |delivery, meta, msg|
86
- log.debug "Recieved message #{@msg}"
87
- payload = parse_payload(msg)
88
+ log.debug "Recieved message #{msg}"
89
+ log.debug "Recieved message MetaData #{meta}"
90
+ payload = parse_payload(msg, meta)
91
+ log.debug "Parsed Payload #{payload}"
88
92
  router.emit(parse_tag(delivery, meta), parse_time(meta), payload)
89
93
  end
90
94
  end # AMQPInput#run
@@ -100,20 +104,25 @@ module Fluent::Plugin
100
104
  end
101
105
 
102
106
  private
103
- def parse_payload(msg)
107
+ def parse_payload(msg, meta)
108
+ parsed = nil
104
109
  if @parser
105
- parsed = nil
106
110
  @parser.parse msg do |_, payload|
107
111
  if payload.nil?
108
112
  log.warn "failed to parse #{msg}"
109
- parsed = { "message" => msg }
113
+ parsed = { 'message' => msg }
110
114
  else
111
115
  parsed = payload
112
116
  end
113
117
  end
114
- parsed
115
118
  else
116
- { "message" => msg }
119
+ parsed = { 'message' => msg }
120
+ end
121
+ if @include_headers
122
+ log.debug 'Adding headers'
123
+ { 'headers' => meta[:headers] }.merge(parsed)
124
+ else
125
+ parsed
117
126
  end
118
127
  end
119
128
 
@@ -142,7 +151,8 @@ module Fluent::Plugin
142
151
  pass: @pass, user: @user, ssl: @ssl,
143
152
  verify_ssl: @verify_ssl, heartbeat: @heartbeat,
144
153
  tls: @tls,
145
- verify_peer: @tls_verify_peer
154
+ verify_peer: @tls_verify_peer,
155
+ auth_mechanism: @auth_mechanism
146
156
  }
147
157
  # Include additional optional TLS configurations
148
158
  opts[:tls_key] = @tls_key if @tls_key
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiromi Ishii
8
8
  - Team Giraffi
9
9
  - HiganWorks LLC
10
10
  - Toby Jackson
11
- autorequire:
11
+ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-02-24 00:00:00.000000000 Z
14
+ date: 2020-07-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fluentd
@@ -151,7 +151,7 @@ homepage: http://github.com/giraffi/fluent-plugin-amqp
151
151
  licenses:
152
152
  - Apache License, Version 2.0
153
153
  metadata: {}
154
- post_install_message:
154
+ post_install_message:
155
155
  rdoc_options: []
156
156
  require_paths:
157
157
  - lib
@@ -166,9 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 2.5.1
171
- signing_key:
169
+ rubygems_version: 3.1.2
170
+ signing_key:
172
171
  specification_version: 4
173
172
  summary: AMQP input/output plugin or fluentd
174
173
  test_files: []