jruby-kafka 3.5.0-java → 3.6.0-java

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: e090e7d3d7297c0b37e2bd081d1f15e7b4ab4f94
4
- data.tar.gz: 7f17226190ec5d6e83b0d8401f344beca18c562c
3
+ metadata.gz: 9d8fdbebd2f39eba13f22716efe6ac0990dbae13
4
+ data.tar.gz: bf25abedad67986fa5bb6f104b20379ec3d38278
5
5
  SHA512:
6
- metadata.gz: 43dbafa9aeb186189fe8496ebeb504e21eb4b4268f3c7306e264c6c604c8376af417be1a710cddb960cd4dc6d2242e926a2ffa814ced45386397001e6df7f9bb
7
- data.tar.gz: 41e942c170f21a85ff3d0eda9442d07ceb19253ee5df9f56370f50427e35ebf87279efe83bee55967edf8b046c5450bee6648ea5c7e9242baf8a095c2df0f165
6
+ metadata.gz: 465f4bb1157d0a52567c39eea2901cb58238e2225182e7eab219265b72aa9f1a79efe9069230866fbd678ea325438318239cb10551c9536e6f590856eee2fe57
7
+ data.tar.gz: 499db546da7bf4b87331cf46378cd14836256a01a5b6f53d3a46e10d40adfc5512d5cc50d4d34c508e009ca91688cb505a8595a3c3aa15a2c580aa2cae172226
@@ -46,7 +46,13 @@ class Kafka::Consumer
46
46
  @key_decoder = @properties.delete(:key_decoder) || 'kafka.serializer.DefaultDecoder'
47
47
  @msg_decoder = @properties.delete(:msg_decoder) || 'kafka.serializer.DefaultDecoder'
48
48
  @reset_beginning = @properties.delete :reset_beginning
49
+ @consumer = nil
50
+ end
49
51
 
52
+ # Create connection to Kafka and Zookeeper.
53
+ #
54
+ # @return void
55
+ def connect
50
56
  @consumer = Consumer.createJavaConsumerConnector ConsumerConfig.new Kafka::Utility.java_properties @properties
51
57
  end
52
58
 
@@ -60,6 +66,7 @@ class Kafka::Consumer
60
66
  #
61
67
  # @note KafkaStreams instances are not thread-safe.
62
68
  def message_streams
69
+ connect if @consumer.nil?
63
70
  begin
64
71
  if @reset_beginning == 'from-beginning'
65
72
  ZkUtils.maybeDeletePath(@properties[:zookeeper_connect], "/consumers/#{@properties[:group_id]}")
@@ -104,11 +111,11 @@ class Kafka::Consumer
104
111
  # @return void
105
112
  def shutdown
106
113
  @consumer.shutdown if @consumer
114
+ @consumer = nil
107
115
  nil
108
116
  end
109
117
 
110
118
  private
111
-
112
119
  def validate_arguments(options)
113
120
  [:zookeeper_connect, :group_id].each do |opt|
114
121
  raise ArgumentError, "Parameter :#{opt} is required." unless options[opt]
@@ -125,4 +132,3 @@ class Kafka::Consumer
125
132
  end
126
133
  end
127
134
  end
128
-
@@ -1,4 +1,4 @@
1
1
  module Kafka
2
- VERSION = '3.5.0'.freeze
2
+ VERSION = '3.6.0'.freeze
3
3
  JAR_DEPENDENCIES_VERSION = '0.3.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: java
6
6
  authors:
7
7
  - Joseph Lawson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement