From ff0a42e47df3b370e9dd074d84ea90cc96e53664 Mon Sep 17 00:00:00 2001 From: Nikolay Perfilov Date: Tue, 9 Jan 2024 18:32:29 +0300 Subject: [PATCH] Add comment mentioning experimental feature and improve error message --- .../main/java/tech/ydb/topic/settings/ReaderSettings.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/topic/src/main/java/tech/ydb/topic/settings/ReaderSettings.java b/topic/src/main/java/tech/ydb/topic/settings/ReaderSettings.java index 49120b656..10bb08aee 100644 --- a/topic/src/main/java/tech/ydb/topic/settings/ReaderSettings.java +++ b/topic/src/main/java/tech/ydb/topic/settings/ReaderSettings.java @@ -92,6 +92,11 @@ public Builder setConsumerName(String consumerName) { return this; } + /** + * Experimental feature. Interface may change in future + * Explicitly require reading without a consumer. Reading progress will not be saved on server this way. + * @return settings builder + */ public Builder withoutConsumer() { this.readWithoutConsumer = true; return this; @@ -152,7 +157,8 @@ public Builder setDecompressionExecutor(Executor decompressionExecutor) { public ReaderSettings build() { if (consumerName == null) { if (!readWithoutConsumer) { - throw new IllegalArgumentException("Missing consumer name for read settings"); + throw new IllegalArgumentException("Missing consumer name for read settings. " + + "Use withoutConsumer option explicitly if you want to read without a consumer"); } } else { if (readWithoutConsumer) {