-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transmit doesn't work with PM2 cluster #19
Comments
Hey @sivo1981! 👋🏻
This is the expected behavior. Your registration stays within one Node (where the stream was open). Could you give me more information on what does not work? The best would be to create a small reproduction or a failing test. |
Application is started on PM2 with 2 instances. Transmit config:
PM2 logs:
Initial transmit connect was made on node 1 and first subscribe is successful beacuse it was requeste on the same node as connect. The problem is in second subscribe request which goes on node 0 and response with HTTP 400 code. This happens because Hope this helps you investigate this problem. |
Any news regarding this issue? |
Yes, sorry for the late reply. Have you tried it or stopped when getting this |
I can confirm that despite getting HTTP 400 error code, subscription is successful on the server and events are received on the client normally. |
Perfect thanks! |
Released in |
Package version
@adonisjs/transmit@1.0.0
Describe the bug
When application is deployed to PM2 cluster, subscribe request fails randomly on some nodes, because this line returns
false
.transmit/src/transmit.ts
Line 198 in 68f41f2
I have configured Redis with ioredis and this works fine for
subscribeToChannel
, but the problem is thatcreateStream
doesn't publish UID to all other nodes withthis.#bus?.publish
andStreamChannelRepository
has an empty set.transmit/src/stream_channel_repository.ts
Line 28 in 68f41f2
Reproduction repo
No response
The text was updated successfully, but these errors were encountered: