GetStream/stream-chat-java

Channel.getOrCreate() method has no way to inform the caller about the payload size.

Closed this issue · 1 comments

Hi GetStream,

Thank you for the amazing service!

I am currently developing an app using getstream. I need to create a channel with members. In the documentation it is said that the channel create (with members) endpoint has a limit of 5 KB for the payload. From the stream-chat-java library, it is not clear how to know the payload size in advance, and there are no methods to specify the request limit internally for the library so that I could get a reasonable exception that I could handle. There is no control of the serialization and no way to know exactly how it is performed; the classes do not implement Serializable. Would you please help me understand how to verify that the payload doesn't exceed the limit stated in the documentation so that I can split the calls?

Hi @mbuiakova,
As you can see here, ObjectMapper is responsible for serializing the request body. Maybe you can try writing the body to a buffer before making the request and checking the size?