Code Issues Pull requests Go 服务框架脚手架. 整合 echo、swag、viper、nsq、logrus、fx、xorm、cobra 等第三方库 echo swagger viper nsq logrus fx xorm swag cobra xormplus github-actions golangci-lint echo-swagger Updated Jul 13, 2022 Go totoval / totoval Star 116 Code Issues Pull requests...
echoswaggervipernsqlogrusfxxormswagcobraxormplusgithub-actionsgolangci-lintecho-swagger UpdatedJul 13, 2022 Go An out-of-the-box artisan API web-framework written in go. goapiredislaravelcommand-lineschedulerweb-frameworkginnsqrbactotovaljob-dispatcher ...
nsq 是一款基于 go 语言开发实现的分布式消息队列组件,在 golang 世界中拥有着很高的认可度和流行性,截止今日在 github 上的 stars 数已高达 23 k. 本期会涉及大量对 nsq 的源码走读环节,主要包含: nsq 客户端:github.com/nsqio/go-nsq . 本文走读源码版本为:v1.1.0. nsq 服务端:github.com/nsqio/nsq ...
tests: finish GitHub Actions CI setup, remove Travis-CI 4年前 dist.sh dist: push multi-platform image; fix bugs creating 'latest' tag 1年前 fmt.sh fmt.sh: switch to goimports 10年前 go.mod nsqd: add experiment topology-aware-consumption for preferred msg consumption ...
package mainimport ("github.com/nsqio/go-nsq""log")// 消费者处理消息的函数funcmessageHandler(message *nsq.Message)error { log.Printf("Received a message: %v", string(message.Body))returnnil}funcmain() {// 配置 config := nsq.NewConfig()// 创建消费者 consumer, err := nsq....
go get https://github.com/nsqio/go-nsq 发送消息 packagemainimport("errors""fmt""github.com/nsqio/go-nsq""time")funcmain(){var(p1*producerp2*producer)p1=&producer{}p2=&producer{}p1.producer,_=InitProducer("127.0.0.1:4150")p2.producer,_=InitProducer("127.0.0.1:4150...
1.简介 1.NSQ是Go语言编写的,开源的内存分布式消息队列中间件 2.可以大规模的处理每天数十亿计级别的消息 3.分布式和去中心化拓扑结构,无单点故障 4.GitHub地址:https://github.com/nsqio/nsq 2.应用场景 1.异步处理,把非关键流程异步化,提高系统的响应时
"github.com/nsqio/go-nsq" ) type NSQHandler struct { } func (this *NSQHandler) HandleMessage(msg *nsq.Message) error { fmt.Println("receive", msg.NSQDAddress, "message:", string(msg.Body)) return nil } func testNSQ() { waiter := sync.WaitGroup{} ...
import "github.com/nsqio/go-nsq" type MyHandler struct {} func (h *MyHandler) HandleMessage(message *nsq.Message) error { fmt.Printf("consume message %+v\n", message) } config := nsq.NewConfig() c, _ := nsq.NewConsumer("topic", "channel", config) ...
https://github.com/nsqio/nsq.git 这儿使用go mod管理 记得装好依赖 2.应用包app 本文主要介绍安装使用,所以主要看app包中 将会用到这四个包,其中nsqlookupd个人理解为连接消息生产端与消息服务端的中间程序,用来保证一致性,类似于zookeeper。nsqd个人理解为接收消息推送,以及发送消息的组件,可以理解为类似kafka...