I also concur with this, having an Optional in the type makes it very clear 
what’s going on and better signifies an absence of value (or in this case the 
broadcast value).

--
Matthew de Detrich
Aiven Deutschland GmbH
Immanuelkirchstraße 26, 10405 Berlin
Amtsgericht Charlottenburg, HRB 209739 B

Geschäftsführer: Oskari Saarenmaa & Hannu Valtonen
m: +491603708037
w: aiven.io e: matthew.dedetr...@aiven.io
On 24. Aug 2022, 14:19 +0200, dev@kafka.apache.org, wrote:
>
> 2.
> I would prefer changing the return type of partitions() to
> Optional<List<Integer>> and using Optional.empty() as the broadcast
> value. IMO, The chances that an implementation returns null due to a bug
> is much higher than that an implementation returns an empty Optional due
> to a bug.

Reply via email to