fluent-plugin-rabbitmq 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbe96873dd049e18d49cf46c8e220635c67b96c22d71fd72c51441f3cc7c794d
4
- data.tar.gz: ee06d3de86ca93ac03c540eeac105f18b1ccc99ea897c05c40b46a0aee926d3e
3
+ metadata.gz: ba10e05d65915a58bac7723586f08bab88d3eb265a44cdc2a4fbf60d3153dead
4
+ data.tar.gz: 7c74417e879e6332f70c943b9c732e7628526687ec8e5613b45767835e36bcd5
5
5
  SHA512:
6
- metadata.gz: 8e00500844dd157eb22b002ec2d9338c13b516062a0297be5ad90fb2fdf27424d9e443e7e380ac0d58b01ea475b699affdb832a804f8ddcd175c576e30d46a2e
7
- data.tar.gz: 5d31f9ce8e15e6337e38d252f9c3a0fe6a65adf05704850ac68d44b7e780b121507406856799f5919391d7bf848eb4537e661e14ff52f401447afa2a083d0010
6
+ metadata.gz: 11358bb5ae097666f025d6eafd3a975fa3295772ab97701c5084bb79d889db624e873d36088ff629015ffe99415ea0d3e2f5971216ce5ed4e10424284783cfd7
7
+ data.tar.gz: f07b05667ca3593c0d7c858b356d4ed39ab7b7451100493bf8c9cc52e79e728d974b1afa664693db7278a79d0ed3bf6dac7a8baee286c172c60a3251b2e29a92
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .gem
11
+ .idea
@@ -1,7 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4
3
+ - 2.6
4
4
  cache: bundler
5
5
  dist: xenial
6
+ sudo: true
6
7
  services:
7
8
  - rabbitmq
9
+ addons:
10
+ apt:
11
+ packages:
12
+ - rabbitmq-server
data/README.md CHANGED
@@ -46,10 +46,16 @@ fluentd >= 0.14.0
46
46
  |durable|true|false|set durable flag of the queue|
47
47
  |exclusive|true|false|set exclusive flag of the queue|
48
48
  |auto_delete|true|false|set auto_delete flag of the queue|
49
+ |ttl|60000|nil|queue ttl in ms|
49
50
  |prefetch_count|10|nil||
50
51
  |consumer_pool_size|5|nil||
51
52
  |include_headers|true|false|include headers in events|
52
53
  |headers_key|string|header|key name of headers|
54
+ |create_exchange|true|false|create exchange or not|
55
+ |exchange_to_bind|string|nil|exchange to bind created exchange|
56
+ |exchange_type|direct|topic|type of created exchange|
57
+ |exchange_routing_key|hoge|nil|created exchange routing key|
58
+ |exchange_durable|true|false|durability of create exchange|
53
59
 
54
60
  ### Output
55
61
 
@@ -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"
6
+ spec.version = "0.0.7"
7
7
  spec.authors = ["NTT Communications"]
8
8
  spec.email = ["masaki.matsushita@ntt.com"]
9
9
 
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_runtime_dependency "fluentd", ">= 0.14.0"
25
25
 
26
- spec.add_dependency "bunny", "~> 2.13.0"
26
+ spec.add_dependency "bunny", "~> 2.14.2"
27
27
  end
@@ -34,7 +34,7 @@ module Fluent::Plugin
34
34
  config_param :user, :string, default: nil
35
35
  config_param :pass, :string, default: nil, secret: true
36
36
  config_param :vhost, :string, default: nil
37
- config_param :exchange, :string, default: nil
37
+
38
38
  config_param :routing_key, :string, default: nil
39
39
  config_param :connection_timeout, :time, default: nil
40
40
  config_param :continuation_timeout, :integer, default: nil
@@ -47,6 +47,13 @@ module Fluent::Plugin
47
47
  end
48
48
  config_param :consumer_pool_size, :integer, default: nil
49
49
 
50
+ config_param :exchange, :string, default: nil
51
+ config_param :create_exchange, :bool, default: false
52
+ config_param :exchange_to_bind, :string, default: nil
53
+ config_param :exchange_type, :string, default: "topic"
54
+ config_param :exchange_routing_key, :string, default: nil
55
+ config_param :exchange_durable, :bool, default: false
56
+
50
57
  config_param :tls, :bool, default: false
51
58
  config_param :tls_cert, :string, default: nil
52
59
  config_param :tls_key, :string, default: nil
@@ -57,8 +64,8 @@ module Fluent::Plugin
57
64
  config_param :durable, :bool, default: false
58
65
  config_param :exclusive, :bool, default: false
59
66
  config_param :auto_delete, :bool, default: false
60
-
61
67
  config_param :prefetch_count, :integer, default: nil
68
+ config_param :ttl, :integer, default: nil
62
69
 
63
70
  config_param :include_headers, :bool, default: false
64
71
  config_param :headers_key, :string, default: "headers"
@@ -106,11 +113,23 @@ module Fluent::Plugin
106
113
  @bunny.start
107
114
  channel = @bunny.create_channel(nil, @consumer_pool_size)
108
115
  channel.prefetch(@prefetch_count) if @prefetch_count
116
+ if @create_exchange
117
+ exchange_options = {
118
+ durable: @exchange_durable,
119
+ auto_delete: @auto_delete
120
+ }
121
+ @bunny_exchange = Bunny::Exchange.new(channel, @exchange_type, @exchange, exchange_options)
122
+ if @exchange_to_bind
123
+ @bunny_exchange.bind(@exchange_to_bind, routing_key: @exchange_routing_key)
124
+ end
125
+ end
126
+ queue_arguments = {"x-message-ttl" => @ttl} if @ttl
109
127
  queue = channel.queue(
110
128
  @queue,
111
129
  durable: @durable,
112
130
  exclusive: @exclusive,
113
- auto_delete: @auto_delete
131
+ auto_delete: @auto_delete,
132
+ arguments: queue_arguments
114
133
  )
115
134
  if @exchange
116
135
  queue.bind(@exchange, routing_key: @routing_key)
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.6
4
+ version: 0.0.7
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-02-02 00:00:00.000000000 Z
11
+ date: 2019-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 2.13.0
103
+ version: 2.14.2
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 2.13.0
110
+ version: 2.14.2
111
111
  description: fluent plugin for rabbitmq (AMQP)
112
112
  email:
113
113
  - masaki.matsushita@ntt.com
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.0.2
147
+ rubygems_version: 3.0.3
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: fluent plugin for rabbitmq (AMQP)