Search in sources :

Example 1 with CommandFlow

use of org.apache.pulsar.common.api.proto.PulsarApi.CommandFlow in project incubator-pulsar by apache.

the class Commands method newFlow.

public static ByteBuf newFlow(long consumerId, int messagePermits) {
    CommandFlow.Builder flowBuilder = CommandFlow.newBuilder();
    flowBuilder.setConsumerId(consumerId);
    flowBuilder.setMessagePermits(messagePermits);
    CommandFlow flow = flowBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.FLOW).setFlow(flowBuilder));
    flow.recycle();
    flowBuilder.recycle();
    return res;
}
Also used : CommandFlow(org.apache.pulsar.common.api.proto.PulsarApi.CommandFlow) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 CommandFlow (org.apache.pulsar.common.api.proto.PulsarApi.CommandFlow)1