fluent-plugin-amqp 0.1.0 → 0.2.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 +15 -0
  2. data/lib/fluent/plugin/in_amqp.rb +12 -11
  3. metadata +14 -73
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWZmMGY0OWViZGNkMjRhMDBhODAwZDBhNmI3OWQxNGU1ZDQ0YmFlZA==
5
+ data.tar.gz: !binary |-
6
+ ZDc0YTQ1Yzk5ZTIzZThjYzI0MGQzMzVjOTZjNjgzZDAxOTMxZjFiMQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YjNkN2M4NjZiYjM2MmZjNmVlZTEzNmM2YTQxYzk1NmM4OTdmMjgzNGRkYjkx
10
+ N2JmMTUzMWU0MDg5ZjNkOWI0MjJlNjczZjZlOGU0ZmMyZWRhMmMzZmY1YWM0
11
+ OTdlM2U5OTIxYmRjYmRiNWZhOWNlZDYyNzIwMzg2ZDQ4NTE0ZWM=
12
+ data.tar.gz: !binary |-
13
+ NmExOTMwOTM5ODg1MWUxNjUxYWIwOWE4MWFjZGRlM2JkZDZlZjY2NmI1NDc4
14
+ MzhmMWFlZGUyMmI0MTVmZTZjMWFhNjQ0YTBlMTgxNDgzYTQ3MzRiMzlkNWRm
15
+ OTFiZmJmODljZjNkMmYzMDcxODEwNDc3ZWY4YTgxOWY2ZGVjYzQ=
@@ -11,6 +11,7 @@ module Fluent
11
11
  config_param :port, :integer, :default => 5672
12
12
  config_param :ssl, :bool, :default => false
13
13
  config_param :verify_ssl, :bool, :default => false
14
+ config_param :heartbeat, :integer, :default => 0
14
15
  config_param :queue, :string, :default => nil
15
16
  config_param :durable, :bool, :default => false
16
17
  config_param :exclusive, :bool, :default => false
@@ -21,11 +22,10 @@ module Fluent
21
22
  def initialize
22
23
  require 'bunny'
23
24
  require "json" if @payload_format == "json"
24
-
25
+
25
26
  super
26
27
  end
27
28
 
28
-
29
29
  def configure(conf)
30
30
  super
31
31
  @conf = conf
@@ -33,25 +33,26 @@ module Fluent
33
33
  raise ConfigError, "'host' and 'queue' must be all specified."
34
34
  end
35
35
  @bunny = Bunny.new(:host => @host, :port => @port, :vhost => @vhost,
36
- :pass => @pass, :user => @user, :ssl => @ssl, :verify_ssl => @verify_ssl)
36
+ :pass => @pass, :user => @user, :ssl => @ssl,
37
+ :verify_ssl => @verify_ssl, :heartbeat => @heartbeat)
37
38
  end
38
-
39
+
39
40
  def start
40
41
  super
41
42
  @thread = Thread.new(&method(:run))
42
43
  end
43
-
44
+
44
45
  def shutdown
45
46
  @bunny.stop
46
47
  @thread.join
47
48
  super
48
49
  end
49
-
50
+
50
51
  def run
51
52
  @bunny.start
52
53
  q = @bunny.queue(@queue, :passive => @passive, :durable => @durable,
53
54
  :exclusive => @exclusive, :auto_delete => @auto_delete)
54
- q.subscribe do |msg|
55
+ q.subscribe do |_, _, msg|
55
56
  payload = parse_payload(msg)
56
57
  Engine.emit(@tag, Time.new.to_i, payload)
57
58
  end
@@ -59,16 +60,16 @@ module Fluent
59
60
 
60
61
  private
61
62
  def parse_payload(msg)
62
- ret = { payload: msg[:payload] }
63
-
63
+ ret = { 'payload' => msg }
64
+
64
65
  begin
65
66
  case @payload_format
66
67
  when "json"
67
- ret = JSON.parse(msg[:payload])
68
+ ret = JSON.parse(msg)
68
69
  end
69
70
  rescue => e
70
71
  # should raises a error to ovserver?
71
- $log.error "parse payload error: #{e}, payload: #{msg[:payload]}"
72
+ $log.error "parse payload error: #{e}, payload: #{msg}"
72
73
  end
73
74
 
74
75
  ret
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Hiromi Ishii
@@ -16,87 +15,34 @@ dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: fluentd
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ! '>='
22
- - !ruby/object:Gem::Version
23
- version: 0.10.5
24
- type: :runtime
25
- prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ! '>='
30
- - !ruby/object:Gem::Version
31
- version: 0.10.5
32
- - !ruby/object:Gem::Dependency
33
- name: bunny
34
- requirement: !ruby/object:Gem::Requirement
35
- none: false
36
- requirements:
37
- - - ! '>='
38
- - !ruby/object:Gem::Version
39
- version: 0.7.8
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: 0.7.8
48
- - !ruby/object:Gem::Dependency
49
- name: shoulda
50
- requirement: !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ! '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- type: :development
57
- prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
- requirements:
61
- - - ! '>='
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- - !ruby/object:Gem::Dependency
65
- name: bundler
66
- requirement: !ruby/object:Gem::Requirement
67
- none: false
68
18
  requirements:
69
19
  - - ~>
70
20
  - !ruby/object:Gem::Version
71
- version: 1.0.0
72
- type: :development
21
+ version: 0.10.0
22
+ type: :runtime
73
23
  prerelease: false
74
24
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
25
  requirements:
77
26
  - - ~>
78
27
  - !ruby/object:Gem::Version
79
- version: 1.0.0
28
+ version: 0.10.0
80
29
  - !ruby/object:Gem::Dependency
81
- name: jeweler
30
+ name: bunny
82
31
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
32
  requirements:
85
33
  - - ~>
86
34
  - !ruby/object:Gem::Version
87
- version: 1.6.4
88
- type: :development
35
+ version: 1.1.0
36
+ type: :runtime
89
37
  prerelease: false
90
38
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
39
  requirements:
93
40
  - - ~>
94
41
  - !ruby/object:Gem::Version
95
- version: 1.6.4
42
+ version: 1.1.0
96
43
  - !ruby/object:Gem::Dependency
97
- name: rcov
44
+ name: shoulda
98
45
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
46
  requirements:
101
47
  - - ! '>='
102
48
  - !ruby/object:Gem::Version
@@ -104,7 +50,6 @@ dependencies:
104
50
  type: :development
105
51
  prerelease: false
106
52
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
53
  requirements:
109
54
  - - ! '>='
110
55
  - !ruby/object:Gem::Version
@@ -117,36 +62,32 @@ extra_rdoc_files:
117
62
  - LICENSE.txt
118
63
  - README.rdoc
119
64
  files:
120
- - lib/fluent/plugin/in_amqp.rb
121
- - lib/fluent/plugin/out_amqp.rb
122
65
  - LICENSE.txt
123
66
  - README.rdoc
67
+ - lib/fluent/plugin/in_amqp.rb
68
+ - lib/fluent/plugin/out_amqp.rb
124
69
  homepage: http://github.com/giraffi/fluent-plugin-amqp
125
70
  licenses:
126
71
  - Apache License, Version 2.0
72
+ metadata: {}
127
73
  post_install_message:
128
74
  rdoc_options: []
129
75
  require_paths:
130
76
  - lib
131
77
  required_ruby_version: !ruby/object:Gem::Requirement
132
- none: false
133
78
  requirements:
134
79
  - - ! '>='
135
80
  - !ruby/object:Gem::Version
136
81
  version: '0'
137
- segments:
138
- - 0
139
- hash: -2560613937427210027
140
82
  required_rubygems_version: !ruby/object:Gem::Requirement
141
- none: false
142
83
  requirements:
143
84
  - - ! '>='
144
85
  - !ruby/object:Gem::Version
145
86
  version: '0'
146
87
  requirements: []
147
88
  rubyforge_project:
148
- rubygems_version: 1.8.25
89
+ rubygems_version: 2.2.0
149
90
  signing_key:
150
- specification_version: 3
91
+ specification_version: 4
151
92
  summary: AMQP input/output plugin or fluentd
152
93
  test_files: []