ISO8583 LengthPrefixedBinaryTCPClientImpl does not support standard message
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
- Happy Path:
On TCP sampler remove LengthPrefixedBinaryTCPClientImpl, then TCP implementation by default is setup, configure read timeout 1000 or 3000, then success output is faced.
JMeter Version
17.0.8
Java Version
11
OS Version
MAC M1
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?