Spring Boot 错误的区块信头负载测试- jmeter

thtygnil  于 2022-11-23  发布在  Spring
关注(0)|答案(1)|浏览(168)

当使用Jmeter运行负载测试时,得到以下结果,但是当检查服务器日志时,没有任何异常,并且它已经成功地将响应返回到Jmeter。这里可能是什么问题?

<responseData 
 class="java.lang.String">org.apache.http.MalformedChunkCodingException: Bad chunk 
header: 
{&quot;...<<My Response>>;
,&quot;desc&quot;:&quot;Success&quot;}}    
at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:274)    
at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:222)    
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:183)    
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)    
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148)    

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1944)    
at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:476)    
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:677)    
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)    
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1301)    
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290)    
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)    
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)   
 at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)    
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)    
at java.lang.Thread.run(Thread.java:750)
</responseData>
qeeaahzv

qeeaahzv1#

您可以通过在 * log4j2.xml * 文件(位于JMeter安装的"bin"文件夹中)中添加下一行来执行enable tracing requests and responses

<Logger name="org.apache.http" level="debug" />

这样,当您发送和接收jmeter.log文件中的请求时,您将看到网络级别上发生的情况
最有可能的是,JMeter期望一个分块响应,而不是得到类似关闭连接或connection reset的响应。
查看Bad chunk header mystery文章以了解调查示例

相关问题