Search in sources :

Example 1 with CommandRedeliverUnacknowledgedMessages

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

the class Commands method newRedeliverUnacknowledgedMessages.

public static ByteBuf newRedeliverUnacknowledgedMessages(long consumerId) {
    CommandRedeliverUnacknowledgedMessages.Builder redeliverBuilder = CommandRedeliverUnacknowledgedMessages.newBuilder();
    redeliverBuilder.setConsumerId(consumerId);
    CommandRedeliverUnacknowledgedMessages redeliver = redeliverBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.REDELIVER_UNACKNOWLEDGED_MESSAGES).setRedeliverUnacknowledgedMessages(redeliverBuilder));
    redeliver.recycle();
    redeliverBuilder.recycle();
    return res;
}
Also used : CommandRedeliverUnacknowledgedMessages(org.apache.pulsar.common.api.proto.PulsarApi.CommandRedeliverUnacknowledgedMessages) ByteBuf(io.netty.buffer.ByteBuf)

Example 2 with CommandRedeliverUnacknowledgedMessages

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

the class Commands method newRedeliverUnacknowledgedMessages.

public static ByteBuf newRedeliverUnacknowledgedMessages(long consumerId, List<MessageIdData> messageIds) {
    CommandRedeliverUnacknowledgedMessages.Builder redeliverBuilder = CommandRedeliverUnacknowledgedMessages.newBuilder();
    redeliverBuilder.setConsumerId(consumerId);
    redeliverBuilder.addAllMessageIds(messageIds);
    CommandRedeliverUnacknowledgedMessages redeliver = redeliverBuilder.build();
    ByteBuf res = serializeWithSize(BaseCommand.newBuilder().setType(Type.REDELIVER_UNACKNOWLEDGED_MESSAGES).setRedeliverUnacknowledgedMessages(redeliverBuilder));
    redeliver.recycle();
    redeliverBuilder.recycle();
    return res;
}
Also used : CommandRedeliverUnacknowledgedMessages(org.apache.pulsar.common.api.proto.PulsarApi.CommandRedeliverUnacknowledgedMessages) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)2 CommandRedeliverUnacknowledgedMessages (org.apache.pulsar.common.api.proto.PulsarApi.CommandRedeliverUnacknowledgedMessages)2