POST
/pub
发布消息
Query Params:
topic - the topic to publish to
Body:
raw message bytes
Example:
$ curl -d "" http://127.0.0.1:4151/pub?topic=name
POST
/mpub
一次发多条消息
Query Params:
topic - the topic to publish to
binary - bool ('true' or 'false') to enable binary mode
Body
\n separated raw message bytes
NOTE: 多条消息用\n
分割, 使用 ?binary=true
参数时,将启用binary mode,但是post body需要符合以下形式,HTTP Content-Length
header 需要被发送,长度为POST
body的长度
[ 4-byte num messages ]
[ 4-byte message #1 size ][ N-byte binary data ]
... (repeated times)
Example:
$ curl -d "\n\n" http://127.0.0.1:4151/mpub?topic=name
POST
/topic/create
弃用名字: /create_topic
创建topic
Query Params:
topic - the topic to create
Example:
$ curl -X POST http://127.0.0.1:4151/topic/create?topic=name
POST
/topic/delete
弃用名字: /delete_topic
删除一个存在的topic,包括所有的channel
Query Params:
topic - the existing topic to delete
Example:
$ curl -X POST http://127.0.0.1:4151/topic/delete?topic=name
POST
/channel/create
弃用名字: /create_channel
从一个已经存在的topic上创建channel
Query Params:
topic - the existing topic
channel - the channel to create
Example:
$ curl -X POST http://127.0.0.1:4151/channel/create?topic=name&channel=name
POST
/channel/delete
Deprecated alias: /delete_channel
在一个存在的topic上删除一个channel
Query Params:
topic - the existing topic
channel - the existing channel to delete
Example:
$ curl -X POST http://127.0.0.1:4151/channel/delete?topic=name&channel=name
POST
/topic/empty
Deprecated alias: /empty_topic
清空一个topic里所有的队列消息(包括内存和硬盘里的)
Query Params:
topic - the existing topic to empty
Example:
$ curl -X POST http://127.0.0.1:4151/topic/empty?topic=name
POST
/channel/empty
Deprecated alias: /empty_channel
清空一个channel里所有的队列消息(包括内存和硬盘里的)
Query Params:
topic - the existing topic
channel - the existing channel to empty
Example:
$ curl -X POST http://127.0.0.1:4151/channel/empty?topic=name&channel=name
POST
/topic/pause
Deprecated alias: /pause_topic
暂停发送消息到所有的channel,消息将会暂时队列在topic内部
Pause message flow to all channels on an existing topic (messages will queue at topic)
Query Params:
topic - the existing topic
Example:
$ curl -X POST http://127.0.0.1:4151/topic/pause?topic=name
POST
/topic/unpause
Deprecated alias: /unpause_topic
终止暂停,继续发送消息到channel
Resume message flow to channels of an existing, paused, topic
Query Params:
topic - the existing topic
Example:
$ curl -X POST http://127.0.0.1:4151/topic/unpause?topic=name
POST
/channel/pause
Deprecated alias: /channel_pause
暂停发送消息到消费者,消息被队列在channel
Pause message flow to consumers of an existing channel (messages will queue at channel)
Query Params:
topic - the existing topic
channel - the existing channel to pause
Example:
$ curl -X POST http://127.0.0.1:4151/channel/pause?topic=name&channel=name
POST
/channel/unpause
Deprecated alias: /unpause_channel
继续发送消息到消费者
Resume message flow to consumers of an existing, paused, channel
Query Params:
topic - the existing topic
channel - the existing channel to pause
Example:
$ curl -X POST http://127.0.0.1:4151/channel/unpause?topic=name&channel=name
GET
/stats
返回内部的统计信息
Return internal statistics
Query Params
format - (optional) `text` or `json` (default = `text`)
topic - (optional) filter to topic
channel - (optional) filter to channel
Example:
$ curl http://127.0.0.1:4151/stats
GET
/ping
监控终端,返回200是没有问题的,返回500的就是有问题“unhealthy”的。
Monitoring endpoint, should return 200
OK
. It returns an HTTP 500
if it is not healthy.
NOTE: The only “unhealthy” state is if nsqd
failed to write messages to disk when overflow occurred.
目前唯一会出现这种情况的是当发生内存中的消息溢出的时候,nsqd不能把消息写到硬盘上。
GET
/info
Version information
返回版本信息
GET
/debug/pprof
An index page of available debugging endpoints
可用的调试节点的页码
GET
/debug/pprof/profile
Starts a pprof
CPU profile for 30s and returns the output via the request
NOTE: this endpoint is not listed in the /debug/pprof
index page because of its effect on runtime performance.
由于这些节点处在运行时,所有这些节点将不在debug/pprof展示的页码中显示
GET
/debug/pprof/goroutine
Returns a stack trace for all running goroutines
返回所有运行的go路由的栈跟踪
GET
/debug/pprof/heap
Returns a heap and memstats profile (top portion can be used as a pprof
memory profile)
GET
/debug/pprof/block
GET
/debug/pprof/threadcreate
GET
/config/nsqlookupd_tcp_addresses
nsqlookupd TCP addresses的列表
Example:
$ curl http://127.0.0.1:4151/config/nsqlookupd_tcp_addresses
PUT
/config/nsqlookupd_tcp_addresses
更新 nsqlookupd TCP addresses.
Body:
JSON array of TCP addresses.
Example:
$ curl -X PUT http://127.0.0.1:4151/config/nsqlookupd_tcp_addresses \
-d '["127.0.0.1:4160", "127.0.0.2:4160"]'
PUT
/config/nsqlookupd_tcp_addresses
Update the nsqlookupd TCP addresses.
Body:
JSON array of TCP addresses.
Example:
$ curl -X PUT http://127.0.0.1:4151/config/nsqlookupd_tcp_addresses \
-d '["127.0.0.1:4160", "127.0.0.2:4160"]'