use of org.apache.pulsar.common.api.proto.PulsarApi.CommandSend in project incubator-pulsar by apache.
the class Commands method newSend.
public static ByteBufPair 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();
ByteBufPair res = serializeCommandSendWithSize(BaseCommand.newBuilder().setType(Type.SEND).setSend(send), checksumType, messageData, payload);
send.recycle();
sendBuilder.recycle();
return res;
}
Aggregations