Closed rstruber closed 10 years ago
Hi @rstruber
try to use the --raw options on the curl for subscriber like
curl -s --raw http://localhost/sub/ch1
the curl buffer the response and only show the content when a flush happens, buffer full or on the restart case, connection closed.
If you what to force the flush you can append a \r\n on message_template, but it isn't necessary for browsers until I can see.
Thanks @wandenberg. The following response came back after publishing a message.
curl -s --raw http://localhost/sub/ch1
c Hello World!
(Our application is connecting over curl not through a browser.)
I added \r\n to the message template and that seems to work. Should it work without? The "c" above "Hello World!" was not present using the message template. That only came back with curl --raw.
Hi @rstruber you can try set --no-buffer option on curl, instead of add the \r\n on the template. check if it works, please.
curl -s --no-buffer http://localhost/sub/ch1
The "c" make part of the chuncked response, each response chunk will come with a different value. The --raw make the curl output exactly which it receives.
Thank you @wandenberg. This has the behavior we expected. Feel free to close this issue.
I've spun up a set of endpoints running the basic configuration straight from the readme, and unfortunately am not receiving messages on a streaming endpoint until the server is restarted.
Some information about the host:
nginx version: nginx/1.4.7 push version: 0.4.0 os: Gentoo Base System release 2.1 Kernel release 3.7.10
What I'm seeing as best I can describe it:
Start listening:
curl -s http://localhost/sub/ch1
Start publishing:
curl -s -X POST 'http://localhost/pub?id=ch1' -d 'Hello World!' curl -s -X POST 'http://localhost/pub?id=ch1' -d 'Hello World!' curl -s -X POST 'http://localhost/pub?id=ch1' -d 'Hello World!'
no messages appear in streaming channel.
Restart nginx /etc/init.d/nginx restart
3 messages appear in streaming channel:
Hello World!Hello World!Hello World!
Please let me know what else I can do to help you debug this issue.
vhost config as follows: