grpc-node
grpc-node copied to clipboard
how to send grpc metadata of large size
I am trying to send array of 1000ish strings and some 3-5 other string fields as grpc metadata but it is letting the stream hang and responses are not returned. I was earlier getting frameError size too big then I set 'grpc.max_metadata_size': 4 * 1024 * 1024, and the error went away but now facing stream issues
Several comments come to mind here.
- While I'm not 100% sure this is what you're doing because your report isn't completely clear, sending very large messages is bad practice. You should instead leverage the streaming API of gRPC to repeatedly send your strings as separate messages.
- The fact you're hitting this on metadata is even more suspicious, because it'd mean you're leveraging headers, and not the contents of the messages itself? Which is even more bad practice - please don't do this.
- It looks like you're using the old, deprecated grpc module? You haven't filled the bug template requesting these details. You should definitely upgrade to the latest grpc-js package instead.
- If you could provide a reproduction case in the form of a small example piece of code for us to try, we'd be in a much better position to help you. All of the remarks I am making above are wild guesses based on the little information you're providing.
Please provide more information, and possibly a reproduction case for us to try.