优化配置

This commit is contained in:
qiyunfanbo126.com 2025-01-18 10:05:03 +08:00
parent 495cbe025f
commit 49034f102c
1 changed files with 7 additions and 5 deletions

View File

@ -98,12 +98,14 @@ func (kk KafkaV2Mq) Consume(name string, hand interface{}, ci int) {
var mqsg = entities.MqMessage{} var mqsg = entities.MqMessage{}
mqsg.Key = string(msg.Key) mqsg.Key = string(msg.Key)
mqsg.Property = make(map[string]interface{}) mqsg.Property = make(map[string]interface{})
if false { if len(msg.Value) > 0 {
for _, v := range msg.Headers { if msg.Headers != nil {
if v.Key == "property" { for _, v := range msg.Headers {
json.Unmarshal(v.Value, &mqsg.Property) if v.Key == "property" {
json.Unmarshal(v.Value, &mqsg.Property)
}
mqsg.Property[string(v.Key)] = string(v.Value)
} }
mqsg.Property[string(v.Key)] = string(v.Value)
} }
err = json.Unmarshal(msg.Value, &mqsg.Body) err = json.Unmarshal(msg.Value, &mqsg.Body)
} else { } else {