there are userID and cardID.When data comes,store it if it cant match cardID, or check its userID.when the user is not match,print a warn including userIDs and cardID.
I try to store them in
class Bean{
String userID;
String cardID;
}
Liststate<Bean> liststate;
I can store them,just dont know how to match.
CodePudding user response:
You don`t need to store k-v. Key your stream by cardId and in keyedProcessFunction keep a state for UserId. If incoming userId is not same with the userId in the value state, create warning message.