msgMetadata.getEncryptionParam().copyTo(encParam, 0); Optional<Integer> batchSize = Optional .ofNullable(msgMetadata.hasNumMessagesInBatch() ? msgMetadata.getNumMessagesInBatch() : null); encryptionCtx.setKeys(keys); encryptionCtx.setParam(encParam);
if (isMessageUndecryptable || (numMessages == 1 && !msgMetadata.hasNumMessagesInBatch())) { final MessageImpl<T> message = new MessageImpl<>(topicName.toString(), msgId, msgMetadata, uncompressedPayload,
refCntMsgMetadata = new ReferenceCountedObject<>(msgMetadata, (x) -> x.recycle()); if (numMessages == 1 && !msgMetadata.hasNumMessagesInBatch()) { processor.process( RawMessageImpl.get(refCntMsgMetadata, null, uncompressedPayload, ledgerId, entryId, 0));
if (isMessageUndecryptable || (numMessages == 1 && !msgMetadata.hasNumMessagesInBatch())) { final MessageImpl<T> message = new MessageImpl<>(topicName.toString(), msgId, msgMetadata, uncompressedPayload,
responseBuilder.header("X-Pulsar-event-time", DateFormatter.format(metadata.getEventTime())); if (metadata.hasNumMessagesInBatch()) { responseBuilder.header("X-Pulsar-num-batch-message", metadata.getNumMessagesInBatch());
setUncompressedSize(other.getUncompressedSize()); if (other.hasNumMessagesInBatch()) { setNumMessagesInBatch(other.getNumMessagesInBatch());
if (numMessages == 1 && !msgMetadata.hasNumMessagesInBatch()) { final MessageImpl<?> message = new MessageImpl<>(topicName.toString(), msgId, msgMetadata, uncompressedPayload,
msgMetadata.getEncryptionParam().copyTo(encParam, 0); Optional<Integer> batchSize = Optional .ofNullable(msgMetadata.hasNumMessagesInBatch() ? msgMetadata.getNumMessagesInBatch() : null); encryptionCtx.setKeys(keys); encryptionCtx.setParam(encParam);
public static boolean isReadableBatch(RawMessage msg) { ByteBuf payload = msg.getHeadersAndPayload(); MessageMetadata metadata = Commands.parseMessageMetadata(payload); try { return metadata.hasNumMessagesInBatch() && metadata.getEncryptionKeysCount() == 0; } finally { metadata.recycle(); } }
setUncompressedSize(other.getUncompressedSize()); if (other.hasNumMessagesInBatch()) { setNumMessagesInBatch(other.getNumMessagesInBatch());