Skip to content

Commit

Permalink
Use value instread of body to make it similar to rdkafka
Browse files Browse the repository at this point in the history
  • Loading branch information
iradul committed Jun 5, 2018
1 parent 3e9fc05 commit 434dac5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions k2ws/k2ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ func (k2ws *K2WS) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
var msg string
if kcfg.MessageType == "json" {
msg = fmt.Sprintf("{\"headers\":{%s},\"body\":%s}", headers, string(e.Value))
msg = fmt.Sprintf("{\"headers\":{%s},\"value\":%s}", headers, string(e.Value))
} else {
val, err := json.Marshal(string(e.Value))
if err == nil {
msg = fmt.Sprintf("{\"headers\":{%s},\"body\":%s}", headers, string(val))
msg = fmt.Sprintf("{\"headers\":{%s},\"value\":%s}", headers, string(val))
} else {
msg = fmt.Sprintf("{\"headers\":{%s}}", headers)
}
Expand Down

0 comments on commit 434dac5

Please sign in to comment.