hermann 0.21.0-java → 0.22.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/hermann/producer.rb +3 -1
- data/lib/hermann/provider/java_producer.rb +2 -2
- data/lib/hermann/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: e66cc3de18d3ed620a691c0e308068f471bb89b6
|
4
|
+
data.tar.gz: 9c1c1171bec630a9cd8ee843e4299bd5d016707a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb43908793f2254b2839c59cca84f9e74fc11ae8f06739f984398caf550b223c751891376a9af786963a93c97a1814e9d96db1f7a24095e6b02a87c87c71078
|
7
|
+
data.tar.gz: 80558b4a81be616687d04ce29e8106c710621db6a4cacb71f1cde3f2a1d9761c785e209fb4dc30738d4da9aaec6d84649d07ba9684fc2bef9745288db03c1d99
|
data/lib/hermann/producer.rb
CHANGED
@@ -50,6 +50,7 @@ module Hermann
|
|
50
50
|
# @param [Object] value A single object to push
|
51
51
|
# @param [Hash] opts to pass to push method
|
52
52
|
# @option opts [String] :topic The topic to push messages to
|
53
|
+
# :partition_key The string to partition by
|
53
54
|
#
|
54
55
|
# @return [Hermann::Result] A future-like object which will store the
|
55
56
|
# result from the broker
|
@@ -62,7 +63,8 @@ module Hermann
|
|
62
63
|
end
|
63
64
|
|
64
65
|
if Hermann.jruby?
|
65
|
-
|
66
|
+
key = opts.has_key?(:partition_key) ? opts[:partition_key].to_java : nil
|
67
|
+
result = @internal.push_single(value, topic, key)
|
66
68
|
unless result.nil?
|
67
69
|
@children << result
|
68
70
|
end
|
@@ -44,9 +44,9 @@ module Hermann
|
|
44
44
|
# @return +Concurrent::Promise+ Representa a promise to send the
|
45
45
|
# data to the kafka broker. Upon execution the Promise's status
|
46
46
|
# will be set
|
47
|
-
def push_single(msg, topic,
|
47
|
+
def push_single(msg, topic, key)
|
48
48
|
Concurrent::Promise.execute {
|
49
|
-
data = ProducerUtil::KeyedMessage.new(topic, msg.to_java_bytes)
|
49
|
+
data = ProducerUtil::KeyedMessage.new(topic, nil, key, msg.to_java_bytes)
|
50
50
|
begin
|
51
51
|
@producer.send(data)
|
52
52
|
rescue Java::KafkaCommon::FailedToSendMessageException => jexc
|
data/lib/hermann/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hermann
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- R. Tyler Croy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-04-
|
13
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|