值得注意的是,由于pepperbus服务运行在docker容器中,此处不能使用127.0.0.1作为ip
busworker.NewWorkerRouter("/test/").RegisterJobHandler("testQueue","testTopic",testFunc)
busworker.Serve("192.168.238.141:4443")
func testFunc(r *http.Request) *Resp{
return &Resp{
ErrorCode:0,
Code:200,
Data:"hello",
}
}
在topic页面点击最右侧的测试按钮可即打开测试窗口
re := busworker.NewClient("192.168.238.141:12018")
re.AddJobs("testQueue","test",[]string{"test data1","test data2"})
Version | Tag | Published |
---|---|---|
v0.0.0-20200710091255-8110dd753e63 | 1yr ago | |
v0.0.0-20191227071245-cf2f4f439eaa | 2yrs ago | |
v0.0.0-20191220022622-7b2e4773fd33 | 2yrs ago |