0
votes

I have a server, it uses the following regular expression to determine the end of a "transmission" from a client:

.*End\":[0-9]{3}}]}\r\n

This works exactly as expected when a normal client connects. Has done for over a year now.
I've decided to start doing some load testing using Apache JMeter, I've done a couple of simple tutorials and managed to successfully run some http tests. However, when I try running a TCP Sampler against my own server, the server doesn't recognize the above pattern from the string it is sent by JMeter. This is despite the fact that the String JMeter sends is an exact copy of a string it accepts every time when coming from an actual client. The server's debug messages say that a match wasn't found and the message is incomplete, then it waits for more information from JMeter.

I experimented by removing the \r\n from the regex pattern and the JMeter test string and the server successfully recognized the end of the message from JMeter.

Anyone got any suggestions on how to solve this? It seems like some sort of character encoding issue perhaps?

1
I could do that, but I'd rather get JMeter to send the messages accurately if possible.mal
I mean, when I include the \r\n in the JMeter message the server still doesn't recognize it.mal
Hi @zubergu I went with your suggestion in the end. Would you care to write an answer I can accept?mal
sure, glad your problem is solved, answer has more chance to help someone else than comment.zubergu

1 Answers

1
votes

One of solutions would be to make new line character in your regex optional.
Seems like messages from JMeter don't have that while every other includes new line at the end.