|Modifier and Type||Method and Description|
Adds the given message to the message set, partitioned with the given partition key.
Sends all the messages being added through the
KafkaPublisher.Preparer add(ByteBuffer message, Object partitionKey)
message- Remaining bytes in the ByteBuffer will be used as message payload. This method would consume the ByteBuffer, meaning after this method returns, the remaining bytes in the ByteBuffer would be
partitionKey- Key for computing the partition Id to publish to. The
Object.hashCode()method will be invoke to compute the id.
ListenableFuturethat will be completed when the send action is done. If publish is succeeded, it returns number of messages published, otherwise the failure reason will be carried in the future. The
Future.cancel(boolean)method has no effect on the publish action.
Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.