@@ -23,7 +23,6 @@ import (
2323 "time"
2424
2525 "github.com/choria-io/fisk"
26- "github.com/choria-io/fisk/units"
2726 "github.com/nats-io/jsm.go"
2827 "github.com/nats-io/jsm.go/api/server/tracing"
2928 "github.com/nats-io/nats-server/v2/server"
@@ -36,7 +35,7 @@ type traceCmd struct {
3635 deliver bool
3736 showTs bool
3837 header map [string ]string
39- payload units. Base2Bytes
38+ payload string
4039}
4140
4241type traceStats struct {
@@ -68,7 +67,7 @@ func configureTraceCommand(app commandHost) {
6867
6968 trace := app .Command ("trace" , "Trace message delivery within an NATS network" ).Action (c .traceAction )
7069 trace .Arg ("subject" , "The subject to publish to" ).Required ().StringVar (& c .subject )
71- trace .Arg ("payload" , "The message body to send" ).BytesVar (& c .payload )
70+ trace .Arg ("payload" , "The message body to send" ).StringVar (& c .payload )
7271 trace .Flag ("deliver" , "Deliver the message to the final destination" ).UnNegatableBoolVar (& c .deliver )
7372 trace .Flag ("timestamp" , "Show event timestamps" ).Short ('T' ).UnNegatableBoolVar (& c .showTs )
7473 trace .Flag ("header" , "Adds headers to the trace message using K:V format" ).Short ('H' ).StringMapVar (& c .header )
@@ -92,10 +91,7 @@ func (c *traceCmd) traceAction(_ *fisk.ParseContext) error {
9291 for k , v := range c .header {
9392 msg .Header .Set (k , v )
9493 }
95- msg .Data , err = c .payload .MarshalText ()
96- if err != nil {
97- return err
98- }
94+ msg .Data = []byte (c .payload )
9995
10096 deliver := ""
10197 if c .deliver {
0 commit comments