惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Troy Hunt's Blog
Latest news
Latest news
Vercel News
Vercel News
S
SegmentFault 最新的问题
V
Vulnerabilities – Threatpost
博客园 - Franky
P
Privacy International News Feed
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
The Hacker News
The Hacker News
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
T
Threatpost
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Azure Blog
Microsoft Azure Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 司徒正美
A
About on SuperTechFans
Recorded Future
Recorded Future
爱范儿
爱范儿
L
LangChain Blog
V
V2EX
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
D
DataBreaches.Net
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
L
Lohrmann on Cybersecurity
Help Net Security
Help Net Security
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY

博客园 - forrestsun

问题整理 weedfs getsockopt: connection timed out 利用cubieboard设置samba打印服务器 CubieTruck上安装mjpg_streamer devexpress bandgridview使用总结(14.2) WeedFS0.6.8-引用库列表 WeedFS问题收集 WeedFS依赖库 0.6.1 golang 前置补0 MongoDB-MMS使用总结 golang 格式化时间为字符串 格式化字符串为时间学习总结 mgo-后续测试(指定字段,获取id) mgo中DBRef-数据查询测试 mgo中DBRef-数据添加测试 weed-fs 基础测试 weed-fs 压力测试 weed-fs参数列表 mgo like的两种写法
NSQ的消息订阅发布测试
forrestsun · 2014-08-05 · via 博客园 - forrestsun

在测试NSQ的Quick Start发现这样一个问题,就是同时只能有一个订阅实例

$ nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161 

当存在两个实例时则消息会被发送给其中的一个实例,而另一个则获取不到消息

在阅读到NSQ中NSQD的启动参数时,发现其支持在一个topic下建立多个channel,通过向topic发送消息,会向所有的channel发布。

测试

//创建topic
$ curl http://10.191.197.209:4151/create_topic?topic=public

//创建三个channel

$ curl http://10.191.197.209:4151/create_channel?topic=public\&channel=t1
$ curl http://10.191.197.209:4151/create_channel?topic=public\&channel=t2
$ curl http://10.191.197.209:4151/create_channel?topic=public\&channel=t3

//建立nsqdata t1 t2 t3四个文件夹分别存放nsqd数据及三个测试channel数据
mkdir nsqdata t1 t2 t3

//启动nsqd,nsqd可以独立启动,无需启动nsqlookupd
nsqd -data-path=/home/sunsl/nsqdata

//启动三个channel的接收端,这里使用nsq_to_file监听nsqd的tcp端口
nsq_to_file --topic=public --channel=t1 --output-dir=/home/sunsl/t1 --nsqd-tcp-address=127.0.0.1:4150
nsq_to_file --topic=public --channel=t2 --output-dir=/home/sunsl/t2 --nsqd-tcp-address=127.0.0.1:4150
nsq_to_file --topic=public --channel=t3 --output-dir=/home/sunsl/t3 --nsqd-tcp-address=127.0.0.1:4150

//向public发送测试数据
curl -d '向三个channel发送数据' 'http://10.191.197.209:4151/put?topic=public'
//cat t1,t2,t3文件夹下的log文件,数据显示正常获取

问题

  • 接收数据有延迟,原因未知,待查