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 +4 -4
- data/lib/jruby-kafka/consumer.rb +8 -2
- data/lib/jruby-kafka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d8fdbebd2f39eba13f22716efe6ac0990dbae13
|
4
|
+
data.tar.gz: bf25abedad67986fa5bb6f104b20379ec3d38278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465f4bb1157d0a52567c39eea2901cb58238e2225182e7eab219265b72aa9f1a79efe9069230866fbd678ea325438318239cb10551c9536e6f590856eee2fe57
|
7
|
+
data.tar.gz: 499db546da7bf4b87331cf46378cd14836256a01a5b6f53d3a46e10d40adfc5512d5cc50d4d34c508e009ca91688cb505a8595a3c3aa15a2c580aa2cae172226
|
data/lib/jruby-kafka/consumer.rb
CHANGED
@@ -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
|
-
|
data/lib/jruby-kafka/version.rb
CHANGED
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.
|
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-
|
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
|