'Filter KStream records based on values of another topic

Is there a way to filter KStream new messages of a topic A based on messages of another topic B? The real question is if I can keep all messages of topic B in a structure(for example list of objects), not only new messages but always all messages, so I can filter the messages of topic A based on topic B. I tried a foreach loop for messages of topic B KStream inside a filter method of topic A KStream but it did not work as KStream of topic B doesn't hold all messages.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source