Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model/respond.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
}

Expand Down
4 changes: 2 additions & 2 deletions service/endpoint/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions service/endpoint/rabbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions service/endpoint/rocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (s *RocketEndpoint) Consume(from mysql.Position, rows []*model.RowRequest)
}
}

if len(ms) ==0{
if len(ms) == 0 {
return nil
}

Expand Down Expand Up @@ -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 {
Expand Down