Hi! I want to write a function that will do routing to different topics based on criteria (for example - tenant_id equals X or user_id equals Y). To store the criteria, I think using a function state will be a great fit, for example: Key: criteria, Value: list of destination of topics Key: tenant_id equals X, Value: ["topic-1", "topic-2"]
The problem here that I have is handling concurrency, how I can update the value in a safe manner - since I have putState and it expects a ByteBuffer as value, I need to: get the current list, append/remove the value and write it back via putState. Does anyone have any idea on how to store this state?