use of io.cdap.cdap.messaging.client.StoreRequestBuilder in project cdap by caskdata.
the class BasicMessagePublisher method publish.
@Override
public void publish(TopicId topicId, Iterator<byte[]> payloads) throws IOException, TopicNotFoundException, UnauthorizedException {
if (transaction == null) {
directMessagePublisher.publish(topicId, payloads);
return;
}
StoreRequestBuilder builder = txPublishRequests.get(topicId);
if (builder == null) {
builder = StoreRequestBuilder.of(topicId);
builder.setTransaction(transaction.getWritePointer());
txPublishRequests.put(topicId, builder);
}
builder.addPayloads(payloads);
}
Aggregations