Search in sources :

Example 1 with StoreRequestBuilder

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);
}
Also used : StoreRequestBuilder(io.cdap.cdap.messaging.client.StoreRequestBuilder)

Aggregations

StoreRequestBuilder (io.cdap.cdap.messaging.client.StoreRequestBuilder)1