[Excution] - base function start - 3
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package rabbitmq
|
||||
|
||||
import (
|
||||
"agent-go"
|
||||
"agent-go/g"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -50,12 +51,12 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
|
||||
|
||||
deliveries := octopusMsgQueue.Read(true)
|
||||
forever := make(chan bool)
|
||||
P.Submit(
|
||||
main.P.Submit(
|
||||
func() {
|
||||
// 死循环,处理Octopus Message
|
||||
for delivery := range deliveries {
|
||||
|
||||
var om *OctopusMessage
|
||||
var om *main.OctopusMessage
|
||||
err := json.Unmarshal(delivery.Body, &om)
|
||||
if err != nil {
|
||||
log.Error(fmt.Sprintf("octopus message convert to json is wrong! msg is => %s", delivery.Body))
|
||||
@@ -64,7 +65,7 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
|
||||
}
|
||||
|
||||
// 策略模式 处理消息
|
||||
P.Submit(func() {
|
||||
main.P.Submit(func() {
|
||||
om.Handle()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user