Creating a message and marshaling #37
-
I'm looking in the docs and code and it's not super clear how I can get a Choria FW message with the formatting I expect but with proper JSON marshaling. Am I missing something here? If I use NewMessage, the return type is a struct |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I guess looking in the tests helps: I would suggest that examples be documented though. I can see I need to implement with The next problem I see is the fields in that struct are not exported, so I won't be able to actually Marshall that. Basically, I want to transfer these Choria messages over NATS JetStream and then decode them as Choria messages with the proper request ID, etc. |
Beta Was this translation helpful? Give feedback.
-
Can you tell me what you are trying to achieve? Generally no need to go that deep for a user. You generate a client against a DDL using “choria plugin generate client” and just use that wrapper. You never need to know this stuff. A message itself never get serialized it’s used to build the protocol.Request which makes a protocol.SecurRequest which make a protocol.RequestTransport and that’s what’s being serialized, sent et I can explain more but would be helpful to know your goal |
Beta Was this translation helpful? Give feedback.
Can you tell me what you are trying to achieve? Generally no need to go that deep for a user.
You generate a client against a DDL using “choria plugin generate client” and just use that wrapper. You never need to know this stuff.
A message itself never get serialized it’s used to build the protocol.Request which makes a protocol.SecurRequest which make a protocol.RequestTransport and that’s what’s being serialized, sent et
I can explain more but would be helpful to know your goal