优化配置

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{}
mqsg.Key = string(msg.Key)
mqsg.Property = make(map[string]interface{})
if false {
for _, v := range msg.Headers {
if v.Key == "property" {
json.Unmarshal(v.Value, &mqsg.Property)
if len(msg.Value) > 0 {
if msg.Headers != nil {
for _, v := range msg.Headers {
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)
} else {