• Stars
    star
    628
  • Rank 69,174 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A realtime distributed messaging platform (forked from https://github.com/nsqio/nsq)

Go Build Status GitHub release Go Report Card codecov

NSQ is a realtime distributed messaging platform designed to operate at scale, handling billions of messages per day.

It promotes distributed and decentralized topologies without single points of failure, enabling fault tolerance and high availability coupled with a reliable message delivery guarantee. See features & guarantees.

Operationally, NSQ is easy to configure and deploy (all parameters are specified on the command line and compiled binaries have no runtime dependencies). For maximum flexibility, it is agnostic to data format (messages can be JSON, MsgPack, Protocol Buffers, or anything else). Official Go and Python libraries are available out of the box (as well as many other client libraries) and, if you're interested in building your own, there's a protocol spec.

We publish binary releases for linux and darwin.

NOTE: master is our development branch and may not be stable at all times.

About this fork

This fork has been moved to https://github.com/youzan/nsq

This fork add many features missing in the original and has been used in Youzan.com. Features:

  • Replication
  • HA
  • Auto balance and migrate
  • Partition
  • Delivery in Order
  • Consume history data
  • Trace the message life-cycle
  • Performance improvement

Deploy Dependency

This fork need the etcd cluster, so to deploy we need set the configure for the nsqd and nsqlookupd. For details please refer to the sample configure files under contrib directory.

Other deploy can be the same as the Official.

有赞NSQ文档索引

用户指南

有赞NSQ用户指南

有赞NSQ部署运维指南

JavaSDK使用指南

内部实现文档

重构概览

重构实现细节

客户端SDK实现

扩展消息设计

FAQ for this Fork

Can I use the Official client SDK?

Most client SDK can be used to communication with the new server without using the new features and for new features in this fork the new client SDK should be used.

Golang: https://github.com/youzan/go-nsq

Java: https://github.com/youzan/nsqJavaSDK

PHP: https://github.com/youzan/php-nsq-client

Auto topic create has been disabled.

In order to manager the topics by nsqlookupd, we removed the create api on the nsqd. So in order to create a new topic, you need create the topic in the nsqadmin or send the create api to the nsqlookupd as below:

curl -X POST "http://127.0.0.1:4161/topic/create?topic=xxx&partition_num=2&replicator=3&syncdisk=1000"

Explain:
partition_num=2 : topic partition number
replicator=3: topic replica number
syncdisk=1000: fsync disk every syncdisk messages
for ordered topic the query param "orderedmulti=true" is needed.

The new server introduced the partitions but in order to keep compatible with the old clients, each node can hold only one partition of the topic. So the partition_num*replicator should not be great than the nsqd nodes. For the ordered topic, we can create as much as we need partitions. (replicator <= number of nsqd node) Also, the first channel for this topic should be created after the topic is created, otherwise this topic is not allowed to be written.

The log can be adjust dynamically.

This is useful to debug on the fly.

nsqd: curl -X POST "http://127.0.0.1:4151/loglevel/set?loglevel=3"
nsqlookupd: curl -X POST "http://127.0.0.1:4161/loglevel/set?loglevel=3"

The log is much more detail when the log level increased.

Change the consume position to allow consume history or skip some messages.

curl -X POST -d "timestamp:xxxxxxxxx" "http://127.0.0.1:4151/channel/setoffset?topic=xxx&partition=xx&channel=xxx"

Post body explain:
timestamp:xxxx (the seconds since 1970-1-1)
virtual_queue:xxx (the queue offset position from the begin)
msgcount:xxx (the message count from the begin)

For multi nsqd nodes, each node for each partition should be done using the api above.

For more documents

please see the other documents under the doc

In Production

              

              

              

              

              

  

Code of Conduct

Help us keep NSQ open and inclusive. Please read and follow our Code of Conduct.

Authors

NSQ was designed and developed by Matt Reiferson (@imsnakes) and Jehiah Czebotar (@jehiah) but wouldn't have been possible without the support of bitly and all our contributors.

Logo created by Wolasi Konu (@kisalow).

More Repositories

1

vant

A lightweight, customizable Vue UI library for mobile web apps.
TypeScript
22,810
star
2

vant-weapp

轻量、可靠的小程序 UI 组件库
JavaScript
17,505
star
3

zent

A collection of essential UI components written with React.
TypeScript
2,240
star
4

zan-proxy

An extensible proxy for PC/Mobile/APP developer
TypeScript
1,815
star
5

vant-demo

Collection of vant demos.
Vue
1,560
star
6

zanphp

PHP开发面向C10K+的高并发SOA服务 和RPC服务首选框架
PHP
1,441
star
7

zanui-weapp

本仓库已不再维护,请移步 https://github.com/youzan/vant-weapp
JavaScript
537
star
8

bugCatcher

方便产品、开发、测试三方协同管理、测试、监控项目进度和质量,以持续交付。
Java
483
star
9

zan

高效稳定、安全易用、线上实时验证的全异步高性能网络库,通过PHP扩展方式使用。
C
462
star
10

php-co-koa

PHP异步编程: 手把手教你实现co与Koa
458
star
11

Bifrost

A delightful library for app business modular architecture.
Objective-C
393
star
12

YZSpamFilter

有赞垃圾内容过滤工具
Python
281
star
13

TitanRecyclerView

A handy RecyclerView can deal with all headers, footers, and loading shit.
Java
249
star
14

tiny-loader.js

A small loader that load CSS/JS in best way for page performance
JavaScript
204
star
15

raven-weapp

Sentry SDK for WeApp
JavaScript
159
star
16

show-me-the-code

TypeScript
151
star
17

gatling-dubbo

A gatling plugin for running load tests on Apache Dubbo(https://github.com/apache/incubator-dubbo) and other java ecosystem.
Scala
149
star
18

felint

A smart way to eslint and stylelint for front end
JavaScript
127
star
19

weapp-plugin-demo

有赞微商城所有小程序插件的演示demo
JavaScript
112
star
20

YouzanMobileSDK-Android

有赞云AppSDK是为移动端应用打造的电商交易系统,通过一个SDK便可以在APP内集成有赞提供的整个交易服务。
Kotlin
112
star
21

SigmaTableViewModel

A simple view model for building organized and scalable TableViews.
Objective-C
106
star
22

zanphp-doc

Zan PHP Framework doc
Python
99
star
23

zan_high_performance_mysql

mysql performance optimize book
98
star
24

httpfetch

对http请求进行封装的,通过对接口函数进行代理,实现优雅的http调用
Java
97
star
25

beeyz

beeyz
Java
85
star
26

sprite-loader

A image sprite loader for webpack.
JavaScript
83
star
27

fast-uglifyjs-plugin

hight performance uglify plugin for webpack
JavaScript
70
star
28

systemtap-toolkit

YouZan systemtap toolkit to online analyze on production
Perl
69
star
29

ngx_http_ipip_module

nginx http module for ipip.net
C
64
star
30

YouzanMobileSDK-iOS

有赞云AppSDK是为移动端应用打造的电商交易系统,通过一个SDK便可以在APP内集成有赞提供的整个交易服务。
Objective-C
61
star
31

zanhttpdemo

HTTP demo for Zan PHP Framework
PHP
57
star
32

go-nsq

Go
56
star
33

open-sdk-php

有赞云网关 SDK for PHP
PHP
54
star
34

php-nsq-client

php nsq client
PHP
38
star
35

nsqJavaSDK

nsq client for java
Java
37
star
36

vue-cli-template-vant

注意:本仓库适用于 vue-cli 2.0, vue-cli 3.0 请参考:https://youzan.github.io/vant/#/zh-CN/quickstart
JavaScript
35
star
37

youzan-sdk

Yet Another Node.js SDK for http://open.youzan.com
JavaScript
33
star
38

zent-kit

[DEPRACATED] React 组件库开发脚手架
JavaScript
28
star
39

vant-doc

本仓库已废弃,请使用 https://github.com/youzan/vant/tree/dev/packages/vant-cli
Vue
27
star
40

zan-installer

Youzan Zan Php Installer
PHP
26
star
41

zan-tool

Zan Node Web 框架配套开发工具
JavaScript
23
star
42

yz-cloud-boot

有赞云有容器应用PHP框架
PHP
21
star
43

open-sdk-node

有赞云网关 SDK for Node
JavaScript
20
star
44

vant-icons

本仓库已迁移至 https://github.com/youzan/vant/tree/dev/packages/vant-icons
CSS
18
star
45

zan-thrift

zan thrift代码生成工具
C++
17
star
46

create-utils

Build your own js library by running one command
JavaScript
15
star
47

ngx_http_html_sanitize_module

It's a nginx http module to sanitize HTML5 with whitelisted elements, whitelisted attributes and whitelisted CSS property
HTML
15
star
48

zanphp.io-server

Proudly build with Zan PHP Framework
CSS
13
star
49

open-sdk-Csharp

有赞云网关Api调用C# SDK
C#
12
star
50

spark-nsq-consumer

spark-nsq-consumer
Scala
10
star
51

zent-seed

[DEPRECATED] React 组件库项目模版,请配合 https://github.com/youzan/zent-kit 使用
JavaScript
8
star
52

yz_aerospike

youzan aerospike client branch
C
6
star
53

felint-config

Shell
6
star
54

zan-doc

PHP
5
star
55

zanphp.io

Zan PHP Framework official site
CSS
5
star
56

zan-utils

TypeScript
4
star
57

zantcpdemo

PHP
4
star
58

zanwebsocketdemo

PHP
4
star
59

extension-point-api

有赞云扩展点PHP桩代码
PHP
4
star
60

zanhttp-boilerplate

Youzan ZanPhp HTTP project Boilerplate
PHP
4
star
61

zent-beta

Zent beta 版文档网站
HTML
3
star
62

cloud-connector-doc

云连接器文档
Shell
2
star
63

eslint-plugin-youzan

Eslint plugin for youzan
JavaScript
2
star
64

yz-cloud-boot-demo-app

有赞云有容器App定制PHP测试Demo工程
JavaScript
2
star
65

vue-cli-template-yzae

A vue-cli template for youzan app-engine developer, forked from vue-cli-template-vant.
JavaScript
1
star
66

youzan.github.io

HTML
1
star
67

zantcp-boilerplate

Youzan ZanPHP TCP project Boilerplate
PHP
1
star
68

zan-snippets

Code snippets for various editors at Youzan
Shell
1
star
69

zan-user-guide

Python
1
star
70

zanwebsocket-boilerplate

PHP
1
star