apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.08k stars 2.05k forks source link

ISO8583 LengthPrefixedBinaryTCPClientImpl does not support standard message #6082

Open gdiazs opened 9 months ago

gdiazs commented 9 months ago

Expected behavior

Given a ISO8583 ASCII standard health check message: 00670800822000000800000004000000000000000409111530088001909916088001081

And Setting up TCP Sampler to use: LengthPrefixedBinaryTCPClientImpl with config: tcp.binarylength.prefix.length = 4

Then: TCP Sampler should be able to determine whether the message is ready or no.

Actual behavior

For Response: 00690810822000000A0000000400000000000000040911153008800190991608800100081

2023-09-26 09:54:47,366 ERROR o.a.j.p.t.s.TCPSampler: 
java.lang.IllegalArgumentException: Hex-encoded binary string contains an uneven no. of digits
    at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.hexStringToByteArray(BinaryTCPClientImpl.java:78) ~[ApacheJMeter_tcp.jar:5.6.2]
    at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.write(BinaryTCPClientImpl.java:90) ~[ApacheJMeter_tcp.jar:5.6.2]
    at org.apache.jmeter.protocol.tcp.sampler.LengthPrefixedBinaryTCPClientImpl.write(LengthPrefixedBinaryTCPClientImpl.java:59) ~[ApacheJMeter_tcp.jar:5.6.2]
    at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:397) [ApacheJMeter_tcp.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) [ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) [ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2]

Steps to reproduce the problem

1 - Clone this project: https://github.com/gdiazs/demo-iso8583 It is a server socket on top netty. Just run the main: com.example.Main.

2- Then in same repo there is a JMX script file : ISO Performance.jmx import to JMeter. Make sure port 5000 is not being used by another process.

3 - Open JMeter's Log viewer and run script

4 - log messages shows up, request and response does not work.

NOTE: Work around

JMeter Version

17.0.8

Java Version

11

OS Version

MAC M1

gdiazs commented 9 months ago

Note: on my tests noticed that HEX header works on this implementation but there are ISO8583 servers implementations that are setup to deal with ASCII or HEX format.

For instance: ASCII header: 0067 HEX Header: 00333038

It looks like this sampler supports hex only. It is that possible to bring support for ASCII? I might work on this feature I guess, how can I help?