Reputation: 4064
My jmeter TCP sampler works fine. I adjusted the protocol and my server accepts the request and responds accordingly.
The server already sent the response to JMeter, but my TCP sampler doesn't recognize the response right away. Instead, it takes the amount of milliseconds I configured on timeout -> response
field.
For example, if I set 100ms, TCP sampler records the request as successful exactly after 100ms no matter how fast my server responds the request.
This is simple configuration. How can I make my TCP sampler receives the response right away and records it as successful? Am I missing some configurations??
Upvotes: 1
Views: 412
Reputation: 168247
Depending on the implementation you might need to set EOL byte value so JMeter would consider it as the message end. It might be CRLF, }
character, >
character or 0
for NULL strings, check the responses and see if this is your case. Look for DEC
value for the character in the ASCII table
Enable JMeter debug logging for TCP protocol, you can do it by adding the next line to log4j2.xml file (lives in "bin" folder of your JMeter installation
<Logger name="org.apache.jmeter.protocol.tcp" level="debug" />
this way you will see requests and responses dumps plus some information regarding what's going on under the hood
More information: How to Load Test TCP Protocol Services With JMeter
Upvotes: 0
Reputation: 4064
I figured it out. BinaryTCPClientImpl
was looking for EOL byte value to recognize the end of resopnse. Mine is always JSON
, so it always ends with }
value, which can be converted into followings
01111101
7D
175
125
The signed/unsigned value of 125
was required in the EOL field. I put the value and the transaction ends as soon as the server responds.
Upvotes: 0