diff --git a/model/respond.go b/model/respond.go index d5751957..3b730c25 100644 --- a/model/respond.go +++ b/model/respond.go @@ -31,7 +31,7 @@ type MQRespond struct { Action string `json:"action"` Timestamp uint32 `json:"timestamp"` Raw interface{} `json:"raw,omitempty"` - Date interface{} `json:"date"` + Data interface{} `json:"data"` ByteArray []byte `json:"-"` } diff --git a/service/endpoint/kafka.go b/service/endpoint/kafka.go index 9fd92799..8a4cadd2 100644 --- a/service/endpoint/kafka.go +++ b/service/endpoint/kafka.go @@ -208,9 +208,9 @@ func (s *KafkaEndpoint) buildMessage(row *model.RowRequest, rule *global.Rule) ( resp.Action = row.Action resp.Timestamp = row.Timestamp if rule.ValueEncoder == global.ValEncoderJson { - resp.Date = kvm + resp.Data = kvm } else { - resp.Date = encodeValue(rule, kvm) + resp.Data = encodeValue(rule, kvm) } if rule.ReserveRawData && canal.UpdateAction == row.Action { diff --git a/service/endpoint/rabbit.go b/service/endpoint/rabbit.go index e4a6127a..ba403c19 100644 --- a/service/endpoint/rabbit.go +++ b/service/endpoint/rabbit.go @@ -198,9 +198,9 @@ func (s *RabbitEndpoint) doRuleConsume(req *model.RowRequest, rule *global.Rule) resp.Action = req.Action resp.Timestamp = req.Timestamp if rule.ValueEncoder == global.ValEncoderJson { - resp.Date = kvm + resp.Data = kvm } else { - resp.Date = encodeValue(rule, kvm) + resp.Data = encodeValue(rule, kvm) } if rule.ReserveRawData && canal.UpdateAction == req.Action { diff --git a/service/endpoint/rocket.go b/service/endpoint/rocket.go index a131c01d..cff4bc48 100644 --- a/service/endpoint/rocket.go +++ b/service/endpoint/rocket.go @@ -113,7 +113,7 @@ func (s *RocketEndpoint) Consume(from mysql.Position, rows []*model.RowRequest) } } - if len(ms) ==0{ + if len(ms) == 0 { return nil } @@ -235,9 +235,9 @@ func (s *RocketEndpoint) buildMessage(req *model.RowRequest, rule *global.Rule) resp.Action = req.Action resp.Timestamp = req.Timestamp if rule.ValueEncoder == global.ValEncoderJson { - resp.Date = kvm + resp.Data = kvm } else { - resp.Date = encodeValue(rule, kvm) + resp.Data = encodeValue(rule, kvm) } if rule.ReserveRawData && canal.UpdateAction == req.Action {