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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6a1a6f690380d42108163531fff423dbfec503a
4
- data.tar.gz: 21feec77b221baecb14a51d705bcbffd929f7bce
3
+ metadata.gz: e66cc3de18d3ed620a691c0e308068f471bb89b6
4
+ data.tar.gz: 9c1c1171bec630a9cd8ee843e4299bd5d016707a
5
5
  SHA512:
6
- metadata.gz: 948fe20e4ee8a7c6f4887a603d5458927e8acb76d85a145688018b2d596b25df4d320f390adaccbc8a17f8c668e3f676331b1269685d06023da8598b3601c437
7
- data.tar.gz: c5bffb241c7f4adfbcc0cd5371c06dec45c6c66d789508c93811516d505a77d3278990dc7d62b39cf33a3e8b78d9e0d79d465e996d247680cb6c66b389c9a40a
6
+ metadata.gz: dcb43908793f2254b2839c59cca84f9e74fc11ae8f06739f984398caf550b223c751891376a9af786963a93c97a1814e9d96db1f7a24095e6b02a87c87c71078
7
+ data.tar.gz: 80558b4a81be616687d04ce29e8106c710621db6a4cacb71f1cde3f2a1d9761c785e209fb4dc30738d4da9aaec6d84649d07ba9684fc2bef9745288db03c1d99
@@ -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
- result = @internal.push_single(value, topic, nil)
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, unused)
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
@@ -1,3 +1,3 @@
1
1
  module Hermann
2
- VERSION = '0.21.0'
2
+ VERSION = '0.22.0'
3
3
  end
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.21.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-04 00:00:00.000000000 Z
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