Open hhstore opened 3 years ago
4171
端口映射必须直连nsqd去投递message
- 消费者直连nsqd,这是最简单的方式,缺点是nsqd服务无法实现动态伸缩了(当然,自己去实现一个也是可以的)
- 消费者通过http查询nsqlookupd获取该nsqlookupd上所有nsqd的连接地址,然后再分别和这些nsqd建立连接(官方推荐的做法),但是客户端会不停的向nsqlookupd查询最新的nsqd地址目录(不喜欢用http轮询这种方式…)
cd devops/deploy/compose/local
# 启动:
make up.mq.nsq
4161
端口映射的宿主机端口. # 服务验证:
test.nsq:
# container port 4161 端口映射
curl http://127.0.0.1:14161/ping
# api 测试: https://nsq.io/components/nsqd.html
test.nsq.pub1:
curl -d "<test msg>" http://127.0.0.1:14151/pub?topic=test
curl -d "<test channel 1 msg>" http://127.0.0.1:14151/pub?topic=test&channel=test_ch1
test.nsq.pub2:
curl -d "<test msg>" http://127.0.0.1:14152/pub?topic=test2
nsq_to_file
工具, 查看消息 lognsqlog1
和 nsqlog2
就是nsq_to_file
工具
related:
349
98
97
49