Search in sources :

Example 1 with CommandRedeliverUnacknowledgedMessages

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

the class Commands method newRedeliverUnacknowledgedMessages.

public static ByteBuf newRedeliverUnacknowledgedMessages(long consumerId, List<MessageIdData> messageIds) {
    BaseCommand cmd = localCmd(Type.REDELIVER_UNACKNOWLEDGED_MESSAGES);
    CommandRedeliverUnacknowledgedMessages req = cmd.setRedeliverUnacknowledgedMessages().setConsumerId(consumerId);
    messageIds.forEach(msgId -> {
        MessageIdData m = req.addMessageId().setLedgerId(msgId.getLedgerId()).setEntryId(msgId.getEntryId());
        if (msgId.hasBatchIndex()) {
            m.setBatchIndex(msgId.getBatchIndex());
        }
    });
    return serializeWithSize(cmd);
}
Also used : MessageIdData(org.apache.pulsar.common.api.proto.MessageIdData) BaseCommand(org.apache.pulsar.common.api.proto.BaseCommand) CommandRedeliverUnacknowledgedMessages(org.apache.pulsar.common.api.proto.CommandRedeliverUnacknowledgedMessages)

Aggregations

BaseCommand (org.apache.pulsar.common.api.proto.BaseCommand)1 CommandRedeliverUnacknowledgedMessages (org.apache.pulsar.common.api.proto.CommandRedeliverUnacknowledgedMessages)1 MessageIdData (org.apache.pulsar.common.api.proto.MessageIdData)1