Hi Benjamin,
Below is the `message` I have created in my `.Proto` :
>
> message ProductShippingReply {
> string id = 1;
> string shipping_mode = 2;
> double shipping_cost = 3;
> int32 shipping_duration = 4;
> }
>
> in my Node.Js code I am trying to send an `Array` of this `message` back
> to the client, however the client receives an empty object. It works if I
> send only an instance of such `message`.
>
> How do I send an `Array` of `Message` in PB?
>
You can either define your rpc method as server streaming and send multiple
instances of the above message to the client. or you can to define a new
message type like below
message ProductShippingReplies {
repeated ProductShippingReply replies = 1;
}
and set this new message type in your rpc method. So you can create a new
message(ProductShippingReplies) instance with the array of
`ProductShippingReply` instances and send it to the client.
Thanks
Danesh
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/f5d41749-e163-470a-92d0-f511465f87dd%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/f5d41749-e163-470a-92d0-f511465f87dd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/CAMPhndLgxK7wxHuR2DFVzYyc9Pg9wy5s7-9Df1pGWhoj%3DJF_wA%40mail.gmail.com.