Closed owennewo closed 6 years ago
Hi @owennewo thank you for reporting this here. I wonder if you captured the response header and what hits the header limit in your case. Is it the continuation token in header response which hits the limit?
yes - its the continuation header response.
AppendableCharSequence seq
variable at the point the exception was thrown (HttpObjectDecoder.java:839
)The query is hitting a partitioned cosmosdb. I'm not providing a partition key, instead I've set enableCrossPartitionQuery=true. I'm guessing these types of queries can have large continuation tokens!
@owennewo the fix is as you suggested, we should set higher header size limit.
Are you interested in sending a Pull Request?
We will merge your contribution to our source code if you do so. :-)
@moderakh - there is a pull request but its failed due to travice / CI
Caused by: java.lang.IllegalArgumentException: Empty key
[ERROR] at javax.crypto.spec.SecretKeySpec.<init>(SecretKeySpec.java:96)
I've manually tested the code.
@owennewo please ignore the failure that's fine. The reason the travis build is failing for you is for public PRs Travis (due to security reasons) doesn't resolve secret key for integration tests. We will look into that later.
Thanks for reporting the header issue, and your contribution 👍
By default the
io.netty.handler.codec.http.HttpObjectDecoder
that you use has a maxHeaderSize of8092
. Headers in response from cosmosDb REST API (e.g. querying documents) can be far bigger than this. Particularly if the response has a continuation header.In my case a simple
select * from events e where e.type='LOGIN'
was enough to hit this limit and therefore get the following error.The cosmosdb code is calling no-arg constructor on HttpClientPipelineConfigurator() which uses MAX_HEADER_SIZE_DEFAULT=8192
I think your
RxDocumentClientBuilder
class needs to have itsCompositeHttpClientBuilder
tweaked to somehow put a larger configuration. The following is untested but might be on the right track: