Java Finatra TooLongMessageException HTTP内容长度超过5242880字节,尽管标志设置的字节数更多
我在看一部电影Java Finatra TooLongMessageException HTTP内容长度超过5242880字节,尽管标志设置的字节数更多,java,scala,http,finagle,finatra,Java,Scala,Http,Finagle,Finatra,我在看一部电影 TooLongMessageException HTTP内容长度超过5242880字节。从我的finatra服务器引发异常。查看通过-help=true提供的标志,似乎要设置的标志是maxRequestSize。下面是help命令的输出 flags: -admin.announce='java.lang.String': Address for announcing admin server -admin.port=':9990': Admin http server p
TooLongMessageException HTTP内容长度超过5242880字节。
从我的finatra服务器引发异常。查看通过-help=true
提供的标志,似乎要设置的标志是maxRequestSize
。下面是help命令的输出
flags:
-admin.announce='java.lang.String': Address for announcing admin server
-admin.port=':9990': Admin http server port
-cert.path='': path to SSL certificate
-doc.root='': File serving directory/namespace for classpath resources
-help='false': Show this help
-http.announce='java.lang.String': Address for announcing HTTP server
-http.name='http': Http server name
-http.port=':8080': External HTTP server port
-http.response.charset.enabled='true': Return HTTP Response Content-Type UTF-8 Charset
-https.announce='java.lang.String': Address for announcing HTTPS server
-https.name='https': Https server name
-https.port='': HTTPs Port
-key.path='': path to SSL key
-local.doc.root='': File serving directory for local development
-log.append='true': If true, appends to existing logfile. Otherwise, file is truncated.
-log.async='true': Log asynchronously
-log.async.inferClassNames='false': Infer class and method names synchronously. See com.twitter.logging.QueueingHandler
-log.async.maxsize='4096': Max queue size for async logging
-log.level='INFO': Log level
-log.output='/dev/stderr': Output file
-log.rollPolicy='Never': When or how frequently to roll the logfile. See com.twitter.logging.Policy#parse documentation for DSL details.
-log.rotateCount='-1': How many rotated logfiles to keep around
-maxRequestSize='5242880.bytes': HTTP(s) Max Request Size
-mustache.templates.dir='templates': templates resource directory
-shutdown.time='1.minutes': Maximum amount of time to wait for pending requests to complete on shutdown
-thrift.announce='java.lang.String': Address for announcing Thrift server
-thrift.name='thrift': Thrift server name
-thrift.port=':9999': External Thrift server port
-thrift.shutdown.time='1.minutes': Maximum amount of time to wait for pending requests to complete on shutdown
我已经传入了
-maxRequestSize=10.MB
,可以在/admin/registry.json
文档中看到值:maxRequestSize:“10485760.bytes”
,但我仍然看到TooLongMessageException
的值为5 MB。如何增加此最大大小?可能在代码中它被覆盖了
你可以通过编程来实现
> override def configureHttpServer(server: Http.Server): Http.Server = {
> server.withAdmissionControl.concurrencyLimit(maxConcurrentRequests = 2000, maxWaiters = 0)
> .withResponseClassifier(HttpResponseClassifier.ServerErrorsAsFailures)
> .withMaxRequestSize(StorageUnit.fromMegabytes(200))
> .withRequestTimeout(50.seconds) }