Websocket 1-1 chat between authenticated users
Hello i'm wondering how to send message to a specific logged in user using spring web sockets
I have assigned a UUID to each user when he signups, and after login each user gets a JWT token for session authentication
But i'm trying for a long time fixing a 1-1 chat between users that exists in the db. For example if i have 2 users logged in, i can then click on the user then it should subscribe to a chat room between them and i can then chat in real time. I have been confused for a long time since there isnt alot of documents of this.
If someone can either guide me through this process real quick or maybe explain it fast it would be awesome! thanks.
9 Replies
ā
This post has been reserved for your question.
Hey @Itsurran! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Note: I'm using Reactjs for the client.
Message queue
You can do some resume-driven development and use Kafka for that.
what are you talking about?
You need a message queue to send messages between users. Then you can subscribe to that from web sockets and transport the messages between two users.
Yeah I know how it works but Iām not getting the process of doing it.
I have a Websocketconfig and a controller
Here is the controller
and here is the config
Anyone?
š¤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
What's the problem with that?
š¤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.