Jackson在处理字符串时存在长度限制,是否可以添加配置项,供业务控制其所能解析的字符传长度?
还没有人认领这个 Issue。
评估
调研方向
跟踪从 ProduceJsonProcessor.doDecodeResponse 经过 ProduceProcessor.decodeResponse 到 DefaultHttpClientFilter.extractResponse 的响应解码过程,重点关注 Jackson 的 StreamReadConstraints 对字符串长度的验证。确定可以在哪里配置服务级别的最大字符串长度,然后验证在解码超大响应时会遵守已配置的限制。
由索引模型根据 Issue 内容生成。
描述
当前遇到一个问题,是服务端返回的响应消息中,字符串长度过长,导致jackson解析失败
Caused by: com.fasterxml.jackson.core.exc.StreamConstraintsException: String length (20051112) exceeds the maximum length (20000000)
at com.fasterxml...core.StreamReadConstraints.validateStringLength:324
at com.fasterxml...util.ReadConstrainedTextBuffer.validateStringLength:27
at com.fasterxml...util.TextBuffer.finishCurrentSegment:939
at com.fasterxml...json.UTF8StreamJsonParser._finishString2:2584
at com.fasterxml...json.UTF8StreamJsonParser._finishAndReturnString:2560
at com.fasterxml...json.UTF8StreamJsonParser.getText:335
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:51
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:48
at com.fasterxml...jsonorg.JSONObjectDeserializer.deserialize:14
at com.fasterxml...deser.DefaultDeserializationContext.readRootValue:323
at com.fasterxml...databind.ObjectMapper._readMapAndClose:4825mas
at com.fasterxml...databind.ObjectMapper.readValue:3825
at org.apache...produce.ProduceJsonProcessor.doDecodeResponse:64
at org.apache...produce.ProduceProcessor.decodeResponse:76
at org.apache...http.DefaultHttpClientFilter.extractResponse:105
at org.apache...http.DefaultHttpClientFilter.afterReceiveResponse:139
at org.apache...http.RestClientInvocation.lambda$processResponseBody$7:251
20000000是jackson提供的默认值;从chassis源码中来看,并没有提供配置该长度的配置项,是否可以加一个
- 主要语言
- Java
- 星标
- 1.9k
- 派生
- 813
- 平均合并
- 8 天 23 小时
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/servicecomb-java-chassis 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
apache/servicecomb-java-chassis#5106 ·
-
question
难度 5/5 一周以上 新手友好度 35/100
apache/servicecomb-java-chassis#5153 · 1 条评论 ·
-
question
难度 4/5 3-5 天 新手友好度 25/100
apache/servicecomb-java-chassis#5146 ·
-
[FEATURE] - When will ServiceComb support Spring Boot 4.x, Spring Framework 7.x, and Jackson 3.x? 未关闭enhancement
难度 5/5 一周以上 新手友好度 25/100
apache/servicecomb-java-chassis#5145 ·
-
2.x bug
apache/servicecomb-java-chassis#5141 · 已指派 1 人 ·
查看 apache/servicecomb-java-chassis 的全部 Issue
相似的 Issue
-
area/plugin
难度 2/5 1-3 小时 新手友好度 75/100
kestra-io/plugin-kestra#190 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/rocketmq-dashboard#5064 ·