Filtering duplicate messages when using pub/sub messaging with multiple topics
I am incorporating your pub/sub messaging system in an application that allows users to subscribe to multiple topics and post to multiple topics. The idea is that a user can send a message to multiple topics at once, which is not supported by Backendless. This is why I push a message for each selected topic separately. The problem is that each of these messages has a different UID, which makes it difficult to check for duplicate messages when user A pushes to multiple topics and user B is subscribed to more than one of those topics.
For example. User A pushes message 'I have arrived!' on channel 'default' and selects topic 'alerts' and 'warnings'. I have to push both messages separately, since Backendless doesn't provide an API to send a message to multiple topics at once. Now let's say that user B is subscribed to channel 'default' with topic 'alerts' and channel 'default' with topic 'warnings'. This means that user B will receive the same message twice, since he is subsribed to both channels.
Filtering out this duplicate message based on a UID is impossible, since both messages have a different UID. It would be possible to consider a message a duplicate when noticing that they have the same sender and data, but this would make it impossible for a user to send the exact same message twice.
What's the best way to tackle this problem?