Hey Jack, The design of this KIP is also consistent with the way header support was added to Connect: https://cwiki.apache.org/confluence/display/KAFKA/KIP-440%3A+Extend+Connect+Converter+to+support+headers I think making argument for precedent here is reasonable.
Hi Ismael, Can you expand what you mean by "without breaking compatibility"? I think the approach proposed here (a default method) would be backwards compatible. If an implementation wishes to make use of the new signature, they can override the new method and the version of Kafka will determine which implementation is used without instance checking, reflection, or exceptions. I believe that when you pass a DTO, that some sort of instance checking, reflection, or exceptions would be required for the Partitioner to determine whether additional information is present. For example, if we wished to add some information X to the partitioner in the future, the caller could pass either a `PartitionInfo` or `PartitionInfoWithX` DTO instance, and the callee could use an `instanceof` check and a cast before accessing the X information. That seems to be more machinery for the Partitioner implementation to manage as compared to maintaining multiple methods, which may just be one-line calls to other methods. Please let me know if I've misunderstood your DTO design. Thanks! Greg On Tue, Aug 22, 2023 at 9:33 PM Jack Tomy <jacktomy...@gmail.com> wrote: > > Hi Ismael, > > That would be totally different from the pattern currently being followed > in all the interfaces, for example serializer. > I personally don't favour that either. Let's see if the community has any > opinions on the same. > > Hey everyone, please share your thoughts on using a DTO instead of separate > params for the interface. > > Thanks. > > On Mon, Aug 21, 2023 at 8:06 PM Ismael Juma <m...@ismaeljuma.com> wrote: > > > Hi Jack, > > > > I mean a DTO. That means you can add additional parameters later without > > breaking compatibility. The current proposal would result in yet another > > method each time we need to add parameters. > > > > Ismael > > > > On Sun, Aug 20, 2023 at 4:53 AM Jack Tomy <jacktomy...@gmail.com> wrote: > > > > > Hey Ismael, > > > > > > Are you suggesting to pass a param like a DTO or you are suggesting to > > pass > > > the record object? > > > > > > I would also like to hear other devs' opinions on this as I personally > > > favour what is done currently. > > > > > > On Thu, Aug 17, 2023 at 9:34 AM Ismael Juma <m...@ismaeljuma.com> wrote: > > > > > > > Hi, > > > > > > > > Thanks for the KIP. The problem outlined here is a great example why we > > > > should be using a record-like structure to pass the parameters to a > > > method > > > > like this. Then we can add more parameters without having to introduce > > > new > > > > methods. Have we considered this option? > > > > > > > > Ismael > > > > > > > > On Mon, Aug 7, 2023 at 5:26 AM Jack Tomy <jacktomy...@gmail.com> > > wrote: > > > > > > > > > Hey everyone. > > > > > > > > > > I would like to call for a vote on KIP-953: partition method to be > > > > > overloaded to accept headers as well. > > > > > > > > > > KIP : > > > > > > > > > > > > > > https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=263424937 > > > > > Discussion thread : > > > > > https://lists.apache.org/thread/0f20kvfqkmhdqrwcb8vqgqn80szcrcdd > > > > > > > > > > Thanks > > > > > -- > > > > > Best Regards > > > > > *Jack* > > > > > > > > > > > > > > > > > > -- > > > Best Regards > > > *Jack* > > > > > > > > -- > Best Regards > *Jack*