Skip to content

Commit

Permalink
Add comment mentioning experimental feature and improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
pnv1 committed Jan 9, 2024
1 parent ace33b8 commit ff0a42e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ff0a42e

Please sign in to comment.