Publish to multiple channels with one connection.

61 views
Skip to first unread message

keagan...@gmail.com

unread,
Jul 24, 2017, 1:34:18 PM7/24/17
to nginxpushstream
Hi Wanden,

Currently when you publish, you have to open an HTTP connection to nginx with the channel as part of the url: http://localhost/pub?id=channel_1

If you are doing a lot of publishing from one endpoint to a variety of channels, you have to open new connection for each publish which is quite costly. For these situations, there would be a large performance boost if only one long lasting connection was used to send multiple messages to multiple channels. 

What I'm envisioning is the ability to just open one long lasting HTTP or Websocket connection to http://localhost/pub. Then when you publish a message you send both the message and the channel id over this connection. 

What are your thoughts on this being a potential feature for Nginx Push Stream Module? I would be happy to help develop such a feature if you think it would be a sensible addition to the module.

Best,

Keagan

Wandenberg Peixoto

unread,
Jul 26, 2017, 10:40:49 AM7/26/17
to nginxpu...@googlegroups.com
Hi Keagan,

I guess we are mixing the concepts here. 
You can have a "long lasting HTTP" to the server using a "keep alive" connection. This will avoid the cost of HTTP connection on each request, which is the problem since the cost of channel validation/creation will remain.

The change to specify the channel and the message on each publish will require a big change and probably it won't be compatible with the current usage, forcing a breaking change.
Currently, all the content in the body is used to compose the message, which can be a binary message (not encoded), for instance.

If you have a proposal to keep things working as they are and adding the support to specify the channel on each publish (you already can do that with the keep alive, only the WebSocket support is missing) I will be happy to review the code.

Kind regards,
Wandenberg


--
You received this message because you are subscribed to the Google Groups "nginxpushstream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginxpushstream+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages