Search in sources :

Example 1 with CommandUnsubscribe

use of com.yahoo.pulsar.common.api.proto.PulsarApi.CommandUnsubscribe in project pulsar by yahoo.

the class Commands method newUnsubscribe.

public static ByteBuf newUnsubscribe(long consumerId, long requestId) {
    CommandUnsubscribe.Builder unsubscribeBuilder = CommandUnsubscribe.newBuilder();
    unsubscribeBuilder.setConsumerId(consumerId);
    unsubscribeBuilder.setRequestId(requestId);
    CommandUnsubscribe unsubscribe = unsubscribeBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.UNSUBSCRIBE).setUnsubscribe(unsubscribe));
    unsubscribeBuilder.recycle();
    unsubscribe.recycle();
    return res;
}
Also used : CommandUnsubscribe(com.yahoo.pulsar.common.api.proto.PulsarApi.CommandUnsubscribe) UnpooledHeapByteBuf(io.netty.buffer.UnpooledHeapByteBuf) RecyclableDuplicateByteBuf(io.netty.buffer.RecyclableDuplicateByteBuf) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

CommandUnsubscribe (com.yahoo.pulsar.common.api.proto.PulsarApi.CommandUnsubscribe)1 ByteBuf (io.netty.buffer.ByteBuf)1 RecyclableDuplicateByteBuf (io.netty.buffer.RecyclableDuplicateByteBuf)1 UnpooledHeapByteBuf (io.netty.buffer.UnpooledHeapByteBuf)1