Nginx_http_push_module and databases
1, how can I save messages received by nginx_http_push_module to databases?
You have to subscribe to the server-side channel of interest and store each message in the database as it comes in.
You can use cURL in PHP, for example, to poll a channel for a long time (you will need to set the appropriate timeout and the right caching headers: If-None-Match and If-Modified-Since).
2, how can I get the list of channel listeners?
Side note: nginx http push module protoco l is dead simple, it's not bayeux . The subscriber / listener in this module is just an active HTTP connection to the subscriber url. For example, if you use interval polling instead of long polling, you will only be considered a subscriber for a (very) short time when the connection is established.
This is why a list of channel listeners doesn't make a lot of sense with this module.
However, you can get the number of active subscribers of a channel by sending a GET request to the post URL, but I seriously doubt you could do anything about it.
a source to share