[
https://issues.apache.org/jira/browse/KAFKA-8666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16888684#comment-16888684
]
Alexander Zafirov commented on KAFKA-8666:
------------------------------------------
Makes sense, Matthias. Yet currently as described in the issue we are facing a
controversy - we are throwing away information that the user already provided
if they choose to build their object. That should not be the case.
Before going into solution mode I'd like to agree on something - we _do_ want
the described functionality to be available, right? As you said we are using
the `builder pattern` for that reason. Because in the commit message of the
code says
_Add a `with(Serde keySerde, Serde valSerde)` to `Materialized` for cases where
people don't care about the state store name._
That leads me to believe that maybe that the code is working as it is supposed
and we should focus and highlighting that to the developer rather than finding
a way to comply with the request in this issue.
If we do want continue `building` the the `Materialized` object please
enlighten me what is the standard practise with Kafka APIs with regards to
backwards compatibility? My intuition was that we shouldn't break code that
relies on the current implementation - which will happen if we attempt to
provide a fix for the way the current `with(keySerde, valueSerde)` is done. If
that is not the case then a way to fix the problem is to remove the `static`
identifier of the method. That will allows us to access previously provided
`storeName`.
> Improve Documentation on usage of Materialized config object
> ------------------------------------------------------------
>
> Key: KAFKA-8666
> URL: https://issues.apache.org/jira/browse/KAFKA-8666
> Project: Kafka
> Issue Type: Improvement
> Components: documentation, streams
> Reporter: Bill Bejeck
> Priority: Major
> Labels: newbie
>
> When using the Materialized object if the user wants to name the statestore
> with
> {code:java}
> Materialized.as("MyStoreName"){code}
> then subsequently provide the key and value serde the calls to do so must
> take the form of
> {code:java}
> Materialized.as("MyStoreName").withKeySerde(keySerde).withValueSerde(valueSerde)
> {code}
> If users do the following
> {code:java}
> Materialized.as("MyStoreName").with(keySerde, valueSerde)
> {code}
> the Materialized instance created by the "as(storeName)" call is replaced by
> a new Materialized instance resulting from the "with(...)" call and any
> configuration on the first Materialized instance is lost.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)