fluent-plugin-amqp 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/fluent/plugin/out_amqp.rb +23 -9
  2. metadata +3 -3
@@ -87,19 +87,33 @@ module Fluent
87
87
  end
88
88
 
89
89
  def write(chunk)
90
- chunk.msgpack_each do |(tag, time, data)|
91
- begin
92
- data = JSON.dump( data ) unless data.is_a?( String )
93
- log.debug "Sending message #{data}, :key => #{routing_key( tag)} :headers => #{headers(tag,time)}"
94
- @exch.publish(data, :key => routing_key( tag ), :persistent => @persistent, :headers => headers( tag, time ))
95
- rescue JSON::GeneratorError => e
96
- log.error "Failure converting data object to json string: #{e.message}"
97
- # Debug only - otherwise we may pollute the fluent logs with unparseable events and loop
98
- log.debug "JSON.dump failure converting [#{data}]"
90
+ begin
91
+ chunk.msgpack_each do |(tag, time, data)|
92
+ begin
93
+ data = JSON.dump( data ) unless data.is_a?( String )
94
+ log.debug "Sending message #{data}, :key => #{routing_key( tag)} :headers => #{headers(tag,time)}"
95
+ @exch.publish(data, :key => routing_key( tag ), :persistent => @persistent, :headers => headers( tag, time ))
96
+ rescue JSON::GeneratorError => e
97
+ log.error "Failure converting data object to json string: #{e.message}"
98
+ # Debug only - otherwise we may pollute the fluent logs with unparseable events and loop
99
+ log.debug "JSON.dump failure converting [#{data}]"
100
+ rescue StandardError => e
101
+ # This protects against invalid byteranges and other errors at a per-message level
102
+ log.error "Unexpected error during message publishing: #{e.message}"
103
+ log.debug "Failure in publishing message [#{data}]"
104
+ end
99
105
  end
106
+ rescue MessagePack::MalformedFormatError => e
107
+ # This has been observed when a server has filled the partition containing
108
+ # the buffer files, and during replay the chunks were malformed
109
+ log.error "Malformed msgpack in chunk - Did your server run out of space during buffering? #{e.message}"
110
+ rescue StandardError => e
111
+ # Just in case theres any other errors during chunk loading.
112
+ log.error "Unexpected error during message publishing: #{e.message}"
100
113
  end
101
114
  end
102
115
 
116
+
103
117
  def routing_key( tag )
104
118
  if @tag_key
105
119
  tag
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-amqp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-09-07 00:00:00.000000000 Z
15
+ date: 2016-09-15 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: fluentd
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 337161649261298881
186
+ hash: 2580055022007987297
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements: