Search in sources :

Example 1 with CommandUnsubscribe

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

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(org.apache.pulsar.common.api.proto.PulsarApi.CommandUnsubscribe) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

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