use of com.yahoo.pulsar.common.api.proto.PulsarApi.CommandSend in project pulsar by yahoo.
the class Commands method newSend.
public static ByteBuf newSend(long producerId, long sequenceId, int numMessages, ChecksumType checksumType, MessageMetadata messageData, ByteBuf payload) {
CommandSend.Builder sendBuilder = CommandSend.newBuilder();
sendBuilder.setProducerId(producerId);
sendBuilder.setSequenceId(sequenceId);
if (numMessages > 1) {
sendBuilder.setNumMessages(numMessages);
}
CommandSend send = sendBuilder.build();
ByteBuf res = serializeCommandSendWithSize(BaseCommand.newBuilder().setType(Type.SEND).setSend(send), checksumType, messageData, payload);
send.recycle();
sendBuilder.recycle();
return res;
}
Aggregations