@Override public Map<String, String> getProperties() { if (singleMessageMetadata != null && singleMessageMetadata.getPropertiesCount() > 0) { return singleMessageMetadata.getPropertiesList().stream() .collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue)); } else if (msgMetadata.get().getPropertiesCount() > 0) { return msgMetadata.get().getPropertiesList().stream() .collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue)); } else { return Collections.emptyMap(); } }
MessageImpl(String topic, MessageIdImpl messageId, MessageMetadata msgMetadata, ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount) { this.msgMetadataBuilder = MessageMetadata.newBuilder(msgMetadata); this.messageId = messageId; this.topic = topic; this.cnx = cnx; this.redeliveryCount = redeliveryCount; // Need to make a copy since the passed payload is using a ref-count buffer that we don't know when could // release, since the Message is passed to the user. Also, the passed ByteBuf is coming from network and is // backed by a direct buffer which we could not expose as a byte[] this.payload = Unpooled.copiedBuffer(payload); this.encryptionCtx = encryptionCtx; if (msgMetadata.getPropertiesCount() > 0) { this.properties = Collections.unmodifiableMap(msgMetadataBuilder.getPropertiesList().stream() .collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue))); } else { properties = Collections.emptyMap(); } this.schema = schema; }
MessageImpl(String topic, MessageIdImpl messageId, MessageMetadata msgMetadata, ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema) { this.msgMetadataBuilder = MessageMetadata.newBuilder(msgMetadata); this.messageId = messageId; this.topic = topic; this.cnx = cnx; // Need to make a copy since the passed payload is using a ref-count buffer that we don't know when could // release, since the Message is passed to the user. Also, the passed ByteBuf is coming from network and is // backed by a direct buffer which we could not expose as a byte[] this.payload = Unpooled.copiedBuffer(payload); this.encryptionCtx = encryptionCtx; if (msgMetadata.getPropertiesCount() > 0) { this.properties = Collections.unmodifiableMap(msgMetadataBuilder.getPropertiesList().stream() .collect(Collectors.toMap(KeyValue::getKey, KeyValue::getValue))); } else { properties = Collections.emptyMap(); } this.schema = schema; }
return false; for (int i = 0; i < getPropertiesCount(); i++) { if (!getProperties(i).isInitialized()) { memoizedIsInitialized = 0;
return false; for (int i = 0; i < getPropertiesCount(); i++) { if (!getProperties(i).isInitialized()) { memoizedIsInitialized = 0;