jruby-kafka 3.3-java → 3.4-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/kafka-consumer.rb +4 -25
- data/lib/jruby-kafka/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e2ecdaa822edd2ccb270f43d2c70cb9b4446bd4
|
4
|
+
data.tar.gz: 6f21ccc8ed81336ddc0221fec8a393ffd00acf11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed86326cd196b0f3371284422cd7abcc7c996a23841c6680e71be71b504d29d7cc94bf1f064464ae02da1a92e1c7279111a154be8a2fdb34d1359b07a6ce3440
|
7
|
+
data.tar.gz: 1f40d89646837b695b8fc5a0bd23d5a21e00cb36a40ef9835547e2bcd24093cedd4a56e06f52af38a21213b2236736c23e4462362931a1e6428faad495b451fb
|
@@ -3,13 +3,12 @@ require 'jruby-kafka/namespace'
|
|
3
3
|
require 'concurrent'
|
4
4
|
require 'jruby-kafka/utility'
|
5
5
|
|
6
|
-
class Kafka::KafkaConsumer
|
6
|
+
class Kafka::KafkaConsumer < Java::org.apache.kafka.clients.consumer.KafkaConsumer
|
7
7
|
|
8
8
|
REQUIRED = [
|
9
9
|
:bootstrap_servers, :key_deserializer, :value_deserializer
|
10
10
|
]
|
11
11
|
|
12
|
-
KAFKA_CONSUMER = Java::org.apache.kafka.clients.consumer.KafkaConsumer
|
13
12
|
# Create a Kafka high-level consumer.
|
14
13
|
#
|
15
14
|
# @param [Hash] config the consumer configuration.
|
@@ -27,39 +26,19 @@ class Kafka::KafkaConsumer
|
|
27
26
|
def initialize(config={})
|
28
27
|
Kafka::Utility.validate_arguments REQUIRED, config
|
29
28
|
@properties = config.clone
|
30
|
-
@topics = @properties.delete :topics
|
31
29
|
@stop_called = Concurrent::AtomicBoolean.new(false)
|
32
|
-
|
33
|
-
@subscribed = false
|
34
|
-
subscribe
|
30
|
+
super Kafka::Utility.java_properties @properties
|
35
31
|
end
|
36
32
|
|
37
|
-
attr_reader :properties
|
33
|
+
attr_reader :properties
|
38
34
|
|
39
35
|
def stop
|
40
36
|
@stop_called.make_true
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
# Subscribe to topics
|
45
|
-
def subscribe
|
46
|
-
@consumer.subscribe(@topics)
|
47
|
-
@subscribed = true
|
48
|
-
nil
|
37
|
+
self.wakeup
|
49
38
|
end
|
50
39
|
|
51
40
|
# stop? should never be overriden
|
52
41
|
def stop?
|
53
42
|
@stop_called.value
|
54
43
|
end
|
55
|
-
|
56
|
-
# Fetch data for the topics or partitions specified using one of the subscribe/assign APIs.
|
57
|
-
def poll(timeout)
|
58
|
-
@consumer.poll timeout
|
59
|
-
end
|
60
|
-
|
61
|
-
def close
|
62
|
-
@consumer.close
|
63
|
-
end
|
64
44
|
end
|
65
|
-
|
data/lib/jruby-kafka/version.rb
CHANGED