D
D
Dmitry Tarasov2020-01-24 15:42:35
Redis
Dmitry Tarasov, 2020-01-24 15:42:35

Why are messages lost in redis pub/sub?

All node code is here .
All php code is here .
What is the essence of the question?
Client A sends a message to client B via ajax request, this ajax request goes to a php script that writes a message to mysql and publishes an object to the redis json channel, then nodejs, tracks this message, understands for whom the channel and publishes it to the user's room, the rooms are unique and are created based on the user id.
The problem is this, messages come, but let's say I send 5 messages in a row and 5 of them simply do not reach the client to whom they were sent.
I don't understand why? Maybe everything works like sync and not async ?
But I started it, even in node there is no publication in the channel, that is, the matter is in php, that is, for what reasons is it not published, after a time?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-01-24
@inoise

It's just that Redis doesn't guarantee delivery. Good morning. Yes, he sometimes swallows messages. Of course, the problem may be in the code, but it is not in the question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question