How to publish and consume JSON data? #5554
-
I am only able to publish string data as of now.Using js.PublishAsync("Subjects.AccountInfo", []byte(data)) Here is format of sample data I want to publish
|
Beta Was this translation helpful? Give feedback.
Answered by
neilalexander
Jun 17, 2024
Replies: 1 comment
-
JetStream doesn't care about strings vs encoded formats, you just provide a some bytes. Therefore just encode your JSON before you publish it:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kharabela
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
JetStream doesn't care about strings vs encoded formats, you just provide a some bytes.
Therefore just encode your JSON before you publish it: