Skip to content
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

当sub状态断开的时候,pub消息无法被缓存 #6

Open
zxq911 opened this issue Dec 13, 2013 · 5 comments
Open

当sub状态断开的时候,pub消息无法被缓存 #6

zxq911 opened this issue Dec 13, 2013 · 5 comments

Comments

@zxq911
Copy link

zxq911 commented Dec 13, 2013

  1. 首先sub消息
    curl -v "http://127.0.0.1:8100/sub?cname=12"
  2. 再pub消息
    curl -v "http://127.0.0.1:8000/pub?cname=12&content=hi"
    这样使用正常。

但是如果顺序反过来的话,则sub无法获取到刚刚取得的消息。

@zxq911
Copy link
Author

zxq911 commented Dec 13, 2013

能否给icomet增加一个缓存消息的数据库,redis或者其他的,要允许消息在一定时间内失效,并且被获取。

@ideawu
Copy link
Owner

ideawu commented Dec 13, 2013

你好, 已经增加该功能. 在 comet.conf 配置文件里增加了 channel_timeout 选项, 请将该值改为较大的数(例如1亿), 表示通道的存活时间.

目前, 消息还是不能持久化, 也没有失效时间.

@zxq911
Copy link
Author

zxq911 commented Dec 26, 2013

能否将ssdb工程和icomet工程结合起来做,这样既有消息持久化,又可以防止短时间内消息丢失呢。

@w22gb8
Copy link

w22gb8 commented Apr 12, 2014

有缓存及过期时间控制,如在过期时间内重复请求会获取重复数据,能否设计为队列形式,获取后从队列内删除。

@ideawu
Copy link
Owner

ideawu commented Apr 13, 2014

@foxconndmd
为了避免重复数据, 需要利用 seq 参数, 重连时, seq = last_seq + 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants