fluent-plugin-rabbitmq 0.1.2 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac5b853f32cd0a93b55e91812bdad1b113bd82388beb431119da0d377b8996bc
4
- data.tar.gz: 2332f9a8474caa93c17d27d7d07a4c9451691357164f86ed011624747c817b75
3
+ metadata.gz: 976e5bca2df7402adf2d3a8ec78776c18d875711901d9043c94c3ad0fec43143
4
+ data.tar.gz: 23428a5b0a5f80a75dfec1deb8c78c82e07618a9c51583ddb288d3aef7d6890a
5
5
  SHA512:
6
- metadata.gz: 7844293f4266134e4ecf186f37e3c889e5e99f6ec6944d5819a24cfce479c6a6b25a933cafbedf41406c54b40d4888895d3805e078d2163a7b74f4a826e25b69
7
- data.tar.gz: '076086578fba89026c4fc431f35e45b840ddb18b9e38510d53db1ababb4468f4cd70eadb9ab968247967406e6bc31719dfc1cc9d9f708c56b81c14b07e2f9954'
6
+ metadata.gz: ed027afd80649651f7b64136fc97fb5f44b995c396a66e00fa11c6060822316a089b92ed1ede709a7e25b4ed1a5b4bbd1a6bfb51a176c0334d02ac9710345826
7
+ data.tar.gz: c873ad03d0233ca3b91bdef9fad657a2a654926ce035d9e5f7c92d630353ed85419bb1dc54d318d8fd714a483d71e7a270414e642988f94cb1b86ee289374f79
@@ -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.1.2"
6
+ spec.version = "0.1.4"
7
7
  spec.authors = ["NTT Communications"]
8
8
  spec.email = ["masaki.matsushita@ntt.com"]
9
9
 
@@ -142,21 +142,26 @@ module Fluent::Plugin
142
142
  queue.bind(@exchange, routing_key: @routing_key)
143
143
  end
144
144
  queue.subscribe(manual_ack: @manual_ack) do |delivery_info, properties, payload|
145
- @parser.parse(payload) do |time, record|
146
- time = if properties[:timestamp]
147
- Fluent::EventTime.from_time(properties[:timestamp])
148
- else
149
- time
150
- end
151
- if @include_headers
152
- record[@headers_key] = properties.headers
145
+ begin
146
+ @parser.parse(payload) do |time, record|
147
+ time = if properties[:timestamp]
148
+ Fluent::EventTime.from_time(properties[:timestamp])
149
+ else
150
+ time
151
+ end
152
+ if @include_headers
153
+ record[@headers_key] = properties.headers
154
+ end
155
+ if @include_delivery_info
156
+ record[@delivery_info_key] = delivery_info
157
+ end
158
+ router.emit(@tag, time, record)
153
159
  end
154
- if @include_delivery_info
155
- record[@delivery_info_key] = delivery_info
156
- end
157
- router.emit(@tag, time, record)
160
+ rescue Fluent::Plugin::Parser::ParserError => e
161
+ log.error "Parser error: #{e.message}", error: e, payload: payload, tag: @tag
162
+ ensure
163
+ channel.ack(delivery_info.delivery_tag) if @manual_ack
158
164
  end
159
- channel.ack(delivery_info.delivery_tag) if @manual_ack
160
165
  end
161
166
  end
162
167
 
@@ -52,6 +52,7 @@ module Fluent::Plugin
52
52
  config_param :exchange, :string
53
53
  config_param :exchange_type, :string
54
54
  config_param :exchange_durable, :bool, default: false
55
+ config_param :exchange_no_declare, :bool, default: false
55
56
 
56
57
  config_param :persistent, :bool, default: false
57
58
  config_param :routing_key, :string, default: nil
@@ -125,7 +126,8 @@ module Fluent::Plugin
125
126
  @channel = @bunny.create_channel
126
127
  exchange_options = {
127
128
  durable: @exchange_durable,
128
- auto_delete: @exchange_auto_delete
129
+ auto_delete: @exchange_auto_delete,
130
+ no_declare: @exchange_no_declare
129
131
  }
130
132
  @bunny_exchange = Bunny::Exchange.new(@channel, @exchange_type, @exchange, exchange_options)
131
133
  end
@@ -139,7 +141,7 @@ module Fluent::Plugin
139
141
  @publish_options[:timestamp] = time.to_i if @timestamp
140
142
 
141
143
  if @exchange_type != "fanout"
142
- @publish_options[:routing_key] = @routing_key ? @routing_key : tag
144
+ @publish_options[:routing_key] = @routing_key || tag
143
145
  end
144
146
 
145
147
  if @id_key
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-rabbitmq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - NTT Communications
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-11-28 00:00:00.000000000 Z
10
+ date: 2025-02-01 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -129,7 +128,6 @@ homepage: https://github.com/nttcom/fluent-plugin-rabbitmq
129
128
  licenses:
130
129
  - Apache-2.0
131
130
  metadata: {}
132
- post_install_message:
133
131
  rdoc_options: []
134
132
  require_paths:
135
133
  - lib
@@ -144,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
142
  - !ruby/object:Gem::Version
145
143
  version: '0'
146
144
  requirements: []
147
- rubygems_version: 3.4.22
148
- signing_key:
145
+ rubygems_version: 3.6.3
149
146
  specification_version: 4
150
147
  summary: fluent plugin for rabbitmq (AMQP)
151
148
  test_files: []