ruby-kafka 0.3.13.beta4 → 0.3.14

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
  SHA1:
3
- metadata.gz: 74dfff5457403137f170938a453a12e1288fd3f7
4
- data.tar.gz: 03074ef585e3a46b45b703ed1efa13ef89e32062
3
+ metadata.gz: 9464a030fbaaa71d6b6095fe7519787396afbc2d
4
+ data.tar.gz: f432a7bf7401371251522b75980ff9116c8cb89e
5
5
  SHA512:
6
- metadata.gz: 88a1fc91d4d4b6b1a5aa1250e6f9a5b2a178d1bdb3233531d588ba8440072b64282ae17e866e0812ecbc502ff7ad418d3a0925d04ba710767d28f65af63890e0
7
- data.tar.gz: 5a3a5b05c8d30679c528bf532584946d762a6d8c038f93e62958119db7f79699e503cb7a14164de43d008e9681cf8f6aca14be2f1ed2da0c7d36fdf1b7791573
6
+ metadata.gz: cbedf9f17a00f597700775919f396803f80a77cca6b33ef7c0217569a2c5d05c2f4aa6e834bb005c37b1eb090b3fb4ac994e5b3aef166bd7dc6df471c866d79b
7
+ data.tar.gz: c9d7e0b9a37e2c081e3bbba5ba644997311b167900df4054df4e6204c456d1652fb022019662c4b3d58a86f1f56c660a0e52efefe52e5c5247ee905e3b8e97d9
data/CHANGELOG.md CHANGED
@@ -4,12 +4,9 @@ Changes and additions to the library will be listed here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
- ## v0.3.13.beta4
7
+ ## v0.3.14
8
8
 
9
9
  - Automatically recover from invalid consumer checkpoints.
10
-
11
- ## v0.3.13.beta1
12
-
13
10
  - Minimize the number of times messages are reprocessed after a consumer group resync.
14
11
  - Improve instrumentation of the async producer.
15
12
 
data/README.md CHANGED
@@ -228,6 +228,8 @@ data = JSON.dump(event)
228
228
  producer.produce(data, topic: "events")
229
229
  ```
230
230
 
231
+ There's also an example of [encoding messages with Apache Avro](https://github.com/zendesk/ruby-kafka/wiki/Encoding-messages-with-Avro).
232
+
231
233
  #### Partitioning
232
234
 
233
235
  Kafka topics are partitioned, with messages being assigned to a partition by the client. This allows a great deal of flexibility for the users. This section describes several strategies for partitioning and how they impact performance, data locality, etc.
@@ -125,7 +125,15 @@ module Kafka
125
125
  value: message.value,
126
126
  )
127
127
 
128
- yield message
128
+ begin
129
+ yield message
130
+ rescue => e
131
+ location = "#{message.topic}/#{message.partition} at offset #{message.offset}"
132
+ backtrace = e.backtrace.join("\n")
133
+ @logger.error "Exception raised when processing #{location} -- #{e.class}: #{e}\n#{backtrace}"
134
+
135
+ raise
136
+ end
129
137
  end
130
138
 
131
139
  mark_message_as_processed(message)
@@ -176,7 +184,17 @@ module Kafka
176
184
  message_count: batch.messages.count,
177
185
  )
178
186
 
179
- yield batch
187
+ begin
188
+ yield batch
189
+ rescue => e
190
+ offset_range = batch.empty? ? "N/A" : [batch.first_offset, batch.last_offset].join("..")
191
+ location = "#{batch.topic}/#{batch.partition} in offset range #{offset_range}"
192
+ backtrace = e.backtrace.join("\n")
193
+
194
+ @logger.error "Exception raised when processing #{location} -- #{e.class}: #{e}\n#{backtrace}"
195
+
196
+ raise
197
+ end
180
198
  end
181
199
 
182
200
  mark_message_as_processed(batch.messages.last)
@@ -25,6 +25,14 @@ module Kafka
25
25
  @messages.empty?
26
26
  end
27
27
 
28
+ def first_offset
29
+ if empty?
30
+ nil
31
+ else
32
+ messages.first.offset
33
+ end
34
+ end
35
+
28
36
  def last_offset
29
37
  if empty?
30
38
  highwater_mark_offset - 1
data/lib/kafka/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kafka
2
- VERSION = "0.3.13.beta4"
2
+ VERSION = "0.3.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13.beta4
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -303,9 +303,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
303
303
  version: 2.1.0
304
304
  required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  requirements:
306
- - - ">"
306
+ - - ">="
307
307
  - !ruby/object:Gem::Version
308
- version: 1.3.1
308
+ version: '0'
309
309
  requirements: []
310
310
  rubyforge_project:
311
311
  rubygems_version: 2.4.5.1