performance - How do I include STX (Start of Text) and ETX (End of Text) characters as prefixes and suffixes to TCP Sampler in J

I'm sending a text to server which a Socket message connected via a Port and IPI've used JSR

I'm sending a text to server which a Socket message connected via a Port and IP I've used JSR223sampler to check the connection, which says "Connected"

This is my Text message PLPL|WM|SL|AS|PICK|100002001|PICKORDER|I|GPick059|2025-04-30 22:05:09.00||E|N|Y||MX1| GPick059|T123456001|1|JProd02|1

I've tried using the Escape Sequence \x02 for STX character. \x03 represents the ETX character. However the message I see on the server logs is with the Escape Characters and not STX and ETX.

I've used TCPClientImpl and BinaryTCPClientImpl TCPClient Classes

Message in the Server Logs:

07:37:34.097 [8] (null) INFO Interface.SocketProcessing.SocketProcessBase - Client IP:63862 Message : \x02PLPL|WM|SL|AS|PICK|100002001|PICKORDER|I|GPick059|2025-04-30 22:05:09.00||E|N|Y||MX1| GPick059|T123456001|1|JProd02|1 \x03

I'm sending a text to server which a Socket message connected via a Port and IP I've used JSR223sampler to check the connection, which says "Connected"

This is my Text message PLPL|WM|SL|AS|PICK|100002001|PICKORDER|I|GPick059|2025-04-30 22:05:09.00||E|N|Y||MX1| GPick059|T123456001|1|JProd02|1

I've tried using the Escape Sequence \x02 for STX character. \x03 represents the ETX character. However the message I see on the server logs is with the Escape Characters and not STX and ETX.

I've used TCPClientImpl and BinaryTCPClientImpl TCPClient Classes

Message in the Server Logs:

07:37:34.097 [8] (null) INFO Interface.SocketProcessing.SocketProcessBase - Client IP:63862 Message : \x02PLPL|WM|SL|AS|PICK|100002001|PICKORDER|I|GPick059|2025-04-30 22:05:09.00||E|N|Y||MX1| GPick059|T123456001|1|JProd02|1 \x03

Share Improve this question edited Mar 28 at 11:50 g90uagk asked Mar 28 at 11:42 g90uagkg90uagk 4192 gold badges6 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You can use __groovy() function like:

${__groovy(URLDecoder.decode('%02'\, 'ASCII'),)}

and

${__groovy(URLDecoder.decode('%03'\, 'ASCII'),)}

More information: How to Send Control Characters Using the JMeter TCP Sampler?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744039325a4548020.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信