NumberFormatException from readChunkSize
We are getting NumberFormatException while using the service, and looks like it's not able to handle the empty string.
Below is the stack trace for the same:
java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_312] at java.lang.Integer.parseInt(Integer.java:592) ~[?:1.8.0_312] at com.predic8.membrane.core.util.HttpUtil.readChunkSize(HttpUtil.java:99) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody$1.readNextChunk(ChunkedBody.java:108) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.BodyInputStream.advanceToNextPosition(BodyInputStream.java:72) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.BodyInputStream.read(BodyInputStream.java:111) ~[service-proxy-core-4.8.7.jar:4.8.7] at java.io.InputStream.read(InputStream.java:101) ~[?:1.8.0_312] at com.predic8.membrane.core.util.ByteUtil.readStream(ByteUtil.java:71) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody.read(ChunkedBody.java:49) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.AbstractBody.getLength(AbstractBody.java:146) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody.getLength(ChunkedBody.java:225) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.Message.estimateHeapSize(Message.java:367) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.Request.estimateHeapSize(Request.java:211) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchange.AbstractExchange.estimateHeapSize(AbstractExchange.java:428) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchange.AbstractExchange.getHeapSizeEstimation(AbstractExchange.java:415) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.hasEnoughSpace(LimitedMemoryExchangeStore.java:262) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.makeSpaceIfNeeded(LimitedMemoryExchangeStore.java:253) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.snapInternal(LimitedMemoryExchangeStore.java:128) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.newSnap(LimitedMemoryExchangeStore.java:88) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.snap(LimitedMemoryExchangeStore.java:58) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.ExchangeStoreInterceptor.handle(ExchangeStoreInterceptor.java:84) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.ExchangeStoreInterceptor.handleAbort(ExchangeStoreInterceptor.java:76) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeAbortionHandlers(InterceptorFlowController.java:147) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeHandlers(InterceptorFlowController.java:82) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.AbstractHttpHandler.invokeHandlers(AbstractHttpHandler.java:70) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.HttpServerHandler.process(HttpServerHandler.java:221) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.HttpServerHandler.run(HttpServerHandler.java:122) [service-proxy-core-4.8.7.jar:4.8.7] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_312] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_312]
The exception can occur when clients/servers close the TCP connection instead of sending a chunk size.
For example, when the "4" in https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Encoded_data is not sent, but the connection is closed instead.
AFAIK this is not supported by the spec.
Thanks for the info, but it's really strange behavior that we see this happening only in AWS EUW region, and USE region is pretty stable compared to it.
We moved from 4.6.1 to 4.8.7 and took care of the log4j2.xml changes (previously log4j.properties)
And kept the same proxies and other client-routing confs.
Any suggestions and inputs is appreciated.
Thanks
Also, what is the recommended version of the service-proxy-core to be used along with the membrane service 4.8.7
Currently we are using the following:
Along with JAVA 1.8