Last active
July 23, 2020 08:33
-
-
Save ripienaar/e6691b2d692853eb89f7f09618084ba0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nc.Subscribe("test", func(m *nats.Msg) { | |
for h, vals := range m.Header { | |
for _, val := range vals { | |
log.Printf("%s: %s", h, val) | |
} | |
} | |
if m.Reply != "" { | |
msg := nats.NewMsg(m.Reply) | |
msg.Header.Add("X-Demo", "value") | |
m.RespondMsg(msg) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment