I have a KTable and backing store whose partitioning is value dependent. I want certain groups of messages to be ordered and that grouping is determined by one field (D) of the (possibly large) value.
When I lookup by only K, obviously you don't know the partition it should be on. So I will build a GlobalKTable of K -> D. This gives me enough information to determine the partition. Unfortunately, the KafkaStreams metadata API doesn't fit this use case well. It allows you to either get all metadata, or by key -- but if you lookup by key it just substitutes a null value (causing a downstream NPE) I can iterate over all metadata and compute the mapping of K -> K,D -> P and then iterate over all metadata looking for P. It's not difficult but ends up being a bit of somewhat ugly code that feels like I shouldn't have to write it. Am I missing something here? Is there a better way that I've missed? Thanks!
signature.asc
Description: Message signed with OpenPGP using GPGMail