handle non JS reply subjects gracefully in stream view
@@ -395,11 +395,12 @@ func (c *streamCmd) viewAction(_ *kingpin.ParseContext) error {
fmt.Println(string(msg.Data))
default:
meta, err := jsm.ParseJSMsgMetadata(msg)
- if err != nil {
- return err
+ if err == nil {
+ fmt.Printf("[%d] Subject: %s Received: %s\n", meta.StreamSequence(), msg.Subject, meta.TimeStamp().Format(time.RFC3339))
+ } else {
+ fmt.Printf("Subject: %s Reply: %s\n", msg.Subject, msg.Reply)
}
- fmt.Printf("[%d] Subject: %s Received: %s\n", meta.StreamSequence(), msg.Subject, meta.TimeStamp().Format(time.RFC3339))
if len(msg.Header) > 0 {
fmt.Println()
for k, vs := range msg.Header {
