Commit 1ce40d5f by huangchengyi

1.0

parent 2325d292
......@@ -15,6 +15,10 @@ import (
"time"
)
type Rabitmq struct {
Dsn string //rabitmq 配置1
}
type RecvPro struct {}
type RabbitMsg struct {
......@@ -34,6 +38,7 @@ func main() {
model_dong := dao.Model_dong //所有动态模型算法列表
if mod == -1 {
queues() //队列监听
return
}
_ ,ok := model_dong[mod]
......@@ -42,10 +47,6 @@ func main() {
os.Exit(1)
}
if mod == -1 {
queues() //队列监听
}
ctx := context.Background() //上下文
if mod >0 {
......@@ -82,19 +83,25 @@ func main() {
fmt.Println("\r\n所有任务已经完成")
}
}
//队列监听
func queues() {
t := &RecvPro{}
var (
dc struct {
Dsn1 *Rabitmq // rab配置1
}
)
paladin.Get("rabitmq.toml").UnmarshalTOML(&dc) //读取配置
queueExchange := &rabbitmq.QueueExchange{
"fengkong_dong_count",
"fengkong_dong_count",
"fengkong_exchange",
"direct",
"amqp://guest:guest@192.168.2.232:5672/",
"amqp://"+dc.Dsn1.Dsn+"/",
}
for{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment