Closed simion closed 9 years ago
Hi,
try to use the configuration on the examples section of the readme. You have to make proper use of last time and tag directives.
The file on misc/nginx.conf is most used for development, is not suitable for production. On May 11, 2015 11:50, "simion" notifications@github.com wrote:
Hello, and thanks for this great module.
I'm having some trouble getting stored message.
The only situation when I could get stored messages was using backtrack on websocket connection (when adding channel), but it's not useful for me.
I do not need to get latest X messages, I need to get all messages since 4 hours ago. It's a realtime dashboard, and when i load it I need the data 4 hours old. I can drop websocket in favor on eventsource, since i only send messages from server to clients, there's no need of two-way communication.
Here's the JS config:
realtime.pushstream.stream = new PushStream({ modes: "eventsource", host: pushstreamConfig.host, // internal config port: pushstreamConfig.port, // internal config messagesPublishedAfter: 14400, // 4 hours, in seconds messagesControlByArgument: true });
And here's the nginx conf:
pid logs/nginx.pid; error_log logs/nginx-main_error.log debug;
Development Mode
master_process off; daemon off; worker_rlimit_core 2500M; working_directory /tmp; debug_points abort; env MOCKEAGAIN_VERBOSE; env MOCKEAGAIN_WRITE_TIMEOUT_PATTERN;
env MOCKEAGAIN;
env LD_PRELOAD;
worker_processes 2;
events { worker_connections 1024;
use poll;
}
http { postpone_output 1; # only postpone a single byte, default 1460 bytes access_log logs/nginx-http_access.log;
push_stream_shared_memory_size 100m; push_stream_max_channel_id_length 200; push_stream_message_ttl 4h; push_stream_timeout_with_body off; # wildcard push_stream_wildcard_channel_prefix "broad_"; push_stream_wildcard_channel_max_qtd 3; # for "text" i removed \", since i only send json messages push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":~text~, \"tag\":\"~tag~\", \"time\":\"~time~\", \"eventid\":\"~event-id~\"}"; push_stream_authorized_channels_only off; push_stream_allowed_origins "*"; server { listen 9080 default_server; server_name localhost; location /channels-stats { push_stream_channels_statistics; push_stream_channels_path $arg_id; } location /pub { push_stream_publisher admin; push_stream_channels_path $arg_id; push_stream_store_messages on; client_max_body_size 32k; client_body_buffer_size 32k; } location ~ /ev/(.*) { # activate event source mode for this location push_stream_subscriber eventsource; # positional channel path push_stream_channels_path $1; if ($arg_tests = "on") { push_stream_channels_path "test_$1"; } if ($arg_qs = "on") { push_stream_last_received_message_time "$arg_time"; push_stream_last_received_message_tag "$arg_tag"; push_stream_last_event_id "$arg_eventid"; } push_stream_store_messages on; default_type application/json; } }
}
What am I doing wrong?
— Reply to this email directly or view it on GitHub https://github.com/wandenberg/nginx-push-stream-module/issues/178.
Hello, and thanks for this great module.
I'm having some trouble getting stored message.
The only situation when I could get stored messages was using backtrack on websocket connection (when adding channel), but it's not useful for me.
I do not need to get latest X messages, I need to get all messages since 4 hours ago. It's a realtime dashboard, and when i load it I need the data 4 hours old. I can drop websocket in favor on eventsource, since i only send messages from server to clients, there's no need of two-way communication.
Here's the JS config:
And here's the nginx conf:
What am I doing wrong?