Skip to content

Commit

Permalink
[ADDED] API to read Reply subject from micro.Request (#1589)
Browse files Browse the repository at this point in the history
Fixes #1579

Signed-off-by: Massimo Costa <costa.massimo@gmail.com>
  • Loading branch information
mcosta74 authored Apr 9, 2024
1 parent 46be740 commit 1eafa27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions micro/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ type (

// Subject returns underlying NATS message subject.
Subject() string

// Reply returns underlying NATS message reply subject.
Reply() string
}

// Headers is a wrapper around [*nats.Header]
Expand Down Expand Up @@ -186,6 +189,11 @@ func (r *request) Subject() string {
return r.msg.Subject
}

// Reply returns underlying NATS message reply subject.
func (r *request) Reply() string {
return r.msg.Reply
}

// Get gets the first value associated with the given key.
// It is case-sensitive.
func (h Headers) Get(key string) string {
Expand Down

0 comments on commit 1eafa27

Please sign in to comment.