【发布时间】:2017-01-14 08:37:17
【问题描述】:
我需要增加我的 undertow 配置的 max-post-size,因为我遇到了以下异常
java.io.IOException: UT000020: Connection terminated as request was larger than 10485760
at io.undertow.conduits.FixedLengthStreamSourceConduit.checkMaxSize(FixedLengthStreamSourceConduit.java:168)
而且我需要更大负载的发布请求。
但是,我知道我可以适应 standalone.xml,但我无法成功地弄清楚如何通过编程或至少在 web.xml 中做到这一点(我需要能够将更改放入构建工件而不是在服务器配置中)。
编辑:
我将 post 请求与 jax-rs @Post 方法一起使用。如果有可能,例如注释每个请求的有效负载大小,这也可以,因为只有少数请求需要启用更高的有效负载大小。
谁能指出我能做什么?
提前致谢!
【问题讨论】:
-
I need to be able to put the change in the build artifact rather than in the server configuration)- 为什么?您可以使用 jboss-cli 工具编写此更改的脚本。 -
因为这是处理托管在云中的便携式应用程序的首选方式。这是一个重要的“最佳实践”。
-
我很想知道你在哪里听到的。您如何部署应用程序?
-
您也可以考虑为此目的使用 WildFly Swarm。这会将您的应用程序、您使用的 WIldFly 位及其配置捆绑到一个可执行的 jar 文件中。
-
@Steve C:你跑题了。这个问题很清楚并且有道理。我需要这种情况的解决方案,如果有的话;没有别的。
标签: jakarta-ee jax-rs wildfly undertow programmatic-config