Handle lastProductId in broadcasted message
The websocket is now broadcasting messages with a lastProductId
property indicating the previous product that was broadcasted (from this story)
The java client needs to handle those messages appropriately matching the lastProductId in the message, to the tracked lastPRoductId in the client. The following scenarios are:
- Server fails to send a message and it gets re-queued -> client doesn't even know this happens and proceeds as normal
- Server sends a message but it gets re-queued (due to another client throwing an irrecoverable exception or something) -> client will receive a duplicate message but ignore it and client updates its lastProductId
- Server sends a message but client never receives it -> causes client to go into catchup mode and within this there are 2 paths:
- Broadcast is received during catchup mode -> Client ignores message and catchup mode returns the newest message
- Broadcast is received after catchup mode -> Client is already up to date after catchup mode and receives message as normal
Edited by Hawthorne, Bryan D