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;
}
Aggregations