2014-12-04 134 views
2

我們正在運行的JMeter用於連接TCP套接字thorugh BinaryTCPClientImpl,我們所得到的響應代碼:500的JMeter TCP採樣

響應消息:org.apache.jmeter.protocol.tcp.sampler.ReadException

JMeter的版本:2.9

助陣

+0

請參見:http://stackoverflow.com/questions/10683853/jmeter-tcp-sampler-incorrectly-reports-500 問題已經問。 – 2014-12-05 06:03:06

+0

我已經在jmeter屬性文件中設置參數仍然不起作用 – 2014-12-05 06:10:25

+0

服務器是否正確發送響應? – 2014-12-05 06:14:55

回答

1

如果這是錯誤

ERROR - jmeter.protocol.tcp.sampler.TCPSampler: org.apache.jmeter.protocol.tcp.sampler.ReadException: at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.read(BinaryTCPClientImpl.java:140) at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:414) at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) at java.lang.Thread.run(Unknown Source)

那麼你有2種選擇。第一個(如果它適用於 ,則更容易)是使用LengthPrefixedBinaryTCPClientImpl。如果這 適用於你,那就是,如果你的回答總是相同的固定 的大小,你可以簡單地設置tcp.binarylength.prefix.length財產 去了解您的業務。 如果不是的話,那麼你的另一種選擇是延長 org.apache.jmeter.protocol.tcp.sampler.TCPClient。這可能有助於獲得 接觸這個專有協議的客戶團隊,因爲在 之後,他們已經實現了一些可行的方法。您可能會有 將其擴展爲看起來像LengthPrefixedBinaryTCPClientImpl 讀取N個字節。雖然這會帶來閱讀太多或太少字節的風險。如果您的應用程序服務器曾經算錯的 大小是輸出,通過獲取其他超時或 在緩衝區中留下額外的字節和閱讀他們的下一次迭代 (然後級聯錯誤)承擔後果。

相關問題