fluent-plugin-rabbitmq 0.0.9 → 0.1.1

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: bb39b34d1e433753ccc9147fb471c96eca6a99c683529711be46556224fe8efd
4
- data.tar.gz: 0e5339fbc5edf3e1e37d22a7e8cd6b49fcf8a7a28e374e8cfbf7ad9ed4acac13
3
+ metadata.gz: 0fa22768ed1823cd072d1e226c9f6ea44cd3b0b2396e90066edcc76ae552124f
4
+ data.tar.gz: bf85c005c06eef232a104e561ef5cd6e90c35618099f957c4c401adbf226d899
5
5
  SHA512:
6
- metadata.gz: c1c6d8e9987b7d52e72137c2e63af0c63290c0bad884a4aa277ea744bbac54c7b761f25da41349e423f945e08f918be20277f6436303f3c66c91f1bea2207782
7
- data.tar.gz: f935b733e4fe986cf17d190d1eccc002c08507254c2a4cb82f0a50c321411474368e31dfe86947bc83c30d94084926b3e8263aa78a990db5f26553d6fbd64ac7
6
+ metadata.gz: 9cae2d54e168c4f6158f8d0c32e114a1b136d5e596ed8ec64afc2cef1767c8ea6a7e6958a57b15a0f84b5a464ad7378fb7c1cc2fdbf191a45942ab59d110f37c
7
+ data.tar.gz: b2668f14ef34eaffaefed06b3a80394a7f2a404a3d0c94c002dd91a5c42e1fd2ef5597002e2e06504b5a0cf4633042a777bf4395195d73c6b18cac30502e90e5
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # fluent-plugin-rabbitmq
2
2
 
3
- [![Build Status](https://travis-ci.org/nttcom/fluent-plugin-rabbitmq.svg?branch=master)](https://travis-ci.org/nttcom/fluent-plugin-rabbitmq)
4
-
5
3
  ## Overview
6
4
 
7
5
  This repository includes input/output plugins for RabbitMQ.
@@ -14,6 +12,11 @@ fluentd >= 0.14.0
14
12
 
15
13
  $ fluent-gem install fluent-plugin-rabbitmq
16
14
 
15
+ ## Testing
16
+
17
+ $ rabbitmq-server
18
+ $ rake test
19
+
17
20
  ## Configuration
18
21
 
19
22
  ### Input
@@ -34,8 +37,6 @@ fluentd >= 0.14.0
34
37
  <parse>
35
38
  @type json # or msgpack, ltsv, none
36
39
  </parse>
37
- <buffer> # to use in buffered mode
38
- </buffer>
39
40
  </source>
40
41
  ```
41
42
 
@@ -56,6 +57,10 @@ fluentd >= 0.14.0
56
57
  |exchange_type|direct|topic|type of created exchange|
57
58
  |exchange_routing_key|hoge|nil|created exchange routing key|
58
59
  |exchange_durable|true|false|durability of create exchange|
60
+ |manual_ack|true|false|manual ACK|
61
+ |queue_mode|"lazy"|nil|queue mode|
62
+ |queue_type|"quorum"|nil|queue type|
63
+
59
64
 
60
65
  ### Output
61
66
 
@@ -76,6 +81,8 @@ fluentd >= 0.14.0
76
81
  <format>
77
82
  @type json # or msgpack, ltsv, none
78
83
  </format>
84
+ <buffer> # to use in buffered mode
85
+ </buffer>
79
86
  </match>
80
87
  ```
81
88
 
@@ -1,9 +1,9 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
2
2
  $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.9"
6
+ spec.version = "0.1.1"
7
7
  spec.authors = ["NTT Communications"]
8
8
  spec.email = ["masaki.matsushita@ntt.com"]
9
9
 
@@ -15,13 +15,15 @@ Gem::Specification.new do |spec|
15
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
16
  spec.require_paths = ["lib"]
17
17
 
18
+ spec.required_ruby_version = ">= 2.5"
19
+
18
20
  spec.add_development_dependency "bundler"
19
21
  spec.add_development_dependency "rake"
20
22
  spec.add_development_dependency "test-unit"
21
23
  spec.add_development_dependency "ltsv"
22
24
  spec.add_development_dependency "msgpack"
23
25
 
24
- spec.add_runtime_dependency "fluentd", ">= 0.14.0"
26
+ spec.add_runtime_dependency "fluentd", ">= 1.0.0"
25
27
 
26
28
  spec.add_dependency "bunny", "~> 2.14.4"
27
29
  end
@@ -71,6 +71,9 @@ module Fluent::Plugin
71
71
  config_param :include_delivery_info, :bool, default: false
72
72
  config_param :headers_key, :string, default: "headers"
73
73
  config_param :delivery_info_key, :string, default: "delivery_info"
74
+ config_param :manual_ack, :bool, default: false
75
+ config_param :queue_mode, :string, default: nil
76
+ config_param :queue_type, :string, default: nil
74
77
 
75
78
  def initialize
76
79
  super
@@ -102,6 +105,7 @@ module Fluent::Plugin
102
105
  bunny_options[:tls_key] = @tls_key if @tls_key
103
106
  bunny_options[:tls_ca_certificates] = @tls_ca_certificates if @tls_ca_certificates
104
107
  bunny_options[:verify_peer] = @verify_peer
108
+ bunny_options[:logger] = log
105
109
 
106
110
  @parser = parser_create
107
111
 
@@ -124,7 +128,10 @@ module Fluent::Plugin
124
128
  @bunny_exchange.bind(@exchange_to_bind, routing_key: @exchange_routing_key)
125
129
  end
126
130
  end
127
- queue_arguments = {"x-message-ttl" => @ttl} if @ttl
131
+ queue_arguments = {}
132
+ queue_arguments["x-message-ttl"] = @ttl if @ttl
133
+ queue_arguments["x-queue-mode"] = @queue_mode if @queue_mode
134
+ queue_arguments["x-queue-type"] = @queue_type if @queue_type
128
135
  queue = channel.queue(
129
136
  @queue,
130
137
  durable: @durable,
@@ -135,7 +142,7 @@ module Fluent::Plugin
135
142
  if @exchange
136
143
  queue.bind(@exchange, routing_key: @routing_key)
137
144
  end
138
- queue.subscribe do |delivery_info, properties, payload|
145
+ queue.subscribe(manual_ack: @manual_ack) do |delivery_info, properties, payload|
139
146
  @parser.parse(payload) do |time, record|
140
147
  time = if properties[:timestamp]
141
148
  Fluent::EventTime.from_time(properties[:timestamp])
@@ -150,6 +157,7 @@ module Fluent::Plugin
150
157
  end
151
158
  router.emit(@tag, time, record)
152
159
  end
160
+ channel.ack(delivery_info.delivery_tag) if @manual_ack
153
161
  end
154
162
  end
155
163
 
@@ -41,7 +41,6 @@ module Fluent::Plugin
41
41
  config_param :heartbeat, default: nil do |param|
42
42
  param == "server" ? :server : Integer(param)
43
43
  end
44
- config_param :threaded, :bool, default: true
45
44
  config_param :frame_max, :integer, default: nil
46
45
 
47
46
  config_param :tls, :bool, default: false
@@ -61,7 +60,7 @@ module Fluent::Plugin
61
60
  config_param :content_type, :string, default: nil
62
61
  config_param :content_encoding, :string, default: nil
63
62
  config_param :expiration, :integer, default: nil
64
- config_param :message_type, :integer, default: nil
63
+ config_param :message_type, :string, default: nil
65
64
  config_param :priority, :integer, default: nil
66
65
  config_param :app_id, :string, default: nil
67
66
 
@@ -96,6 +95,7 @@ module Fluent::Plugin
96
95
  bunny_options[:tls_key] = @tls_key if @tls_key
97
96
  bunny_options[:tls_ca_certificates] = @tls_ca_certificates if @tls_ca_certificates
98
97
  bunny_options[:verify_peer] = @verify_peer
98
+ bunny_options[:logger] = log
99
99
 
100
100
  @bunny = Bunny.new(bunny_options)
101
101
 
@@ -105,7 +105,7 @@ module Fluent::Plugin
105
105
  @publish_options[:persistent] = @persistent if @persistent
106
106
  @publish_options[:mandatory] = @mandatory if @mandatory
107
107
  @publish_options[:expiration] = @expiration if @expiration
108
- @publish_options[:message_type] = @message_type if @message_type
108
+ @publish_options[:type] = @message_type if @message_type
109
109
  @publish_options[:priority] = @priority if @priority
110
110
  @publish_options[:app_id] = @app_id if @app_id
111
111
 
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.9
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NTT Communications
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-09 00:00:00.000000000 Z
11
+ date: 2023-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.14.0
89
+ version: 1.0.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.14.0
96
+ version: 1.0.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bunny
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -129,7 +129,7 @@ homepage: https://github.com/nttcom/fluent-plugin-rabbitmq
129
129
  licenses:
130
130
  - Apache-2.0
131
131
  metadata: {}
132
- post_install_message:
132
+ post_install_message:
133
133
  rdoc_options: []
134
134
  require_paths:
135
135
  - lib
@@ -137,15 +137,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
- version: '0'
140
+ version: '2.5'
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.1.2
148
- signing_key:
147
+ rubygems_version: 3.4.22
148
+ signing_key:
149
149
  specification_version: 4
150
150
  summary: fluent plugin for rabbitmq (AMQP)
151
151
  test_files: []