'Redis publisher also receiving the message

I am building a scalable chat application using Go and Redis w/ websockets.

I need to publish a new message using redis pub-sub model to other websocket servers to inform all the users (saved in memory of other servers) about the new joined user.

But the issue is, the publisher(also a redis client) receives the same message. Is there a direct way to solve this?

Workaround:

Check if the user for new user in the received event (for publisher) is in the list of current local users everytime.

WHY NEGATIVE VOTES? I'm so pissed at stack-overflow these days. People have no tolerance or too much arrogance



Sources

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

Source: Stack Overflow

Solution Source