Closed AyatShaabanNasr closed 2 years ago
@AyatShaabanNasr please provide a description of your issue (with expected and actual behaviour), otherwise I won't be able to help you at all.
According to your packager, DE2 should be 18 digits
id="2"
length="18"
name="PAN - PRIMARY ACCOUNT NUMBER"
pad="true"
class="org.jpos.iso.IFA_NUMERIC"/>
But you're trying to set it to 20
<field id="2" value="16111111111111111111"/>
If the leading 16
is supposed to be the hexadecimal length of the PAN then you would need to write your own field packager class similar to IFB_LLHNUM
as unfortunately there is no IFA_LLHNUM
.
Yes it's the length of the field, I'm expecting to get the balance inquiry and i'm sending card details for the inquiry, but i got issues for different fields that i'm not including in my message
want to ask also what does the header represents? is it for the length of the message or the message type?
There are actually two different kinds of header: one implicit header that the underlying jPOS library creates (depending on the Channel class you configure) which contains for example the message length, and one explicit (though optional) header that your switch system may require for e.g. identification purposes.
For any jPOS related questions around Message/Packager/Channel problems you may want to post a question here: https://groups.google.com/g/jpos-users
@tilln where can i found the header that have the message length? as i see in the results that there is no length in the message sent
What channel have you configured?
There are channels like NACChannel , asciichannel etc that prepend the length of the data to the bytes being sent. Use the channel that your spec for host uses. JPOS provides a lot of out of the box channels that can be used and can be configured for this jmeter plugin. https://github.com/jpos/jPOS/tree/master/jpos/src/main/java/org/jpos/iso/channel
i used base24tcpchannel , can i use j8583 instead of jpos?
Hexdump does not dump what the channel is adding. You can use netcat or some line snuffer to see all the data being sent. If you are a client run netcat to listen on the port and use flags to dump the traffic as hex and you will see the headers. This jmeter plugin uses jpos so you cannot use anything else. Though it's intricacies are hidden and it's just configuration.
Now I always get error for field 55 that it can't be unpacked how to resolve 2022-05-06 18:24:49,373 ERROR n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [receive] org.jpos.iso.IFA_LCHAR: Problem unpacking field 55 (org.jpos.iso.ISOException: Field length 4 too long. Max: 3) unpacking field=55, consumed=55
whenever i followed the length required in the error it brings another error with different length
@AyatShaabanNasr How is field 55 defined in your packager config? You need to post your config and a bit more logging, and ideally the response message you are expecting to receive (from your test system), otherwise it's impossible to help you out here.
The field config is already included in the original message
<isofield
id="55"
length="512"
name="IC card system related data"
class="org.jpos.iso.IFA_LLLCHAR"/>
and all details in the original message are the same , but i always get error for this field
Your log claims it's trying to unpack with org.jpos.iso.IFA_LCHAR
with length 3 though?
Yes i changed it several times trying to make it works but it doesnt work even when i put it same as config file LLLCHAR
Sent from my Galaxy
-------- Original message -------- From: Till Neunast @.> Date: 5/7/22 3:41 AM (GMT+02:00) To: tilln/jmeter-iso8583 @.> Cc: AyatShaabanNasr @.>, Mention @.> Subject: Re: [tilln/jmeter-iso8583] Can't Parse ISO8583 message (Issue #52)
Your log claims it's trying to unpack with org.jpos.iso.IFA_LCHAR with length 3 though?
— Reply to this email directly, view it on GitHubhttps://github.com/tilln/jmeter-iso8583/issues/52#issuecomment-1120105944, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVGUJOCNPW54LEN3G6XPMLDVIXC5RANCNFSM5UL2VWIA. You are receiving this because you were mentioned.Message ID: @.***>
As above, you need to provide more details. Especially logging that actually matches your configuration.
22-05-07 23:47:28,197 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2022-05-07 23:47:28,198 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2022-05-07 23:47:28,205 INFO n.c.b.j.i.Q2: (Q2.system) Q2 started, deployDir=C:\apache-jmeter-5.4.3\bin\deploy, environment=default 2022-05-07 23:47:28,236 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, local) 2022-05-07 23:47:28,283 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : ISO 2022-05-07 23:47:28,283 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group ISO. 2022-05-07 23:47:28,283 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error 2022-05-07 23:47:28,283 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false 2022-05-07 23:47:28,283 INFO o.a.j.t.ThreadGroup: Started thread group number 1 2022-05-07 23:47:28,283 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started 2022-05-07 23:47:28,283 INFO o.a.j.t.JMeterThread: Thread started: ISO 1-1 2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (channel/10.10.111.12:20001) [receive] org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 55 (org.jpos.iso.ISOException: Field length 728 too long. Max: 512) unpacking field=55, consumed=55 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 55 (org.jpos.iso.ISOException: Field length 728 too long. Max: 512) unpacking field=55, consumed=55 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:341) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:479) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:976) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.BaseChannel.receive(BaseChannel.java:746) [jpos-2.1.6.jar:2.1.6] at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:333) [jpos-2.1.6.jar:2.1.6] at java.lang.Thread.run(Unknown Source) [?:1.8.0_321] 2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (channel/10.10.111.12:20001) [receive] --- data --- 2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (channel/10.10.111.12:20001) [receive] 0000 49 53 4F 30 30 35 30 30 30 30 30 30 30 38 30 30 ISO0050000000800 0010 38 32 32 30 30 30 30 30 30 30 30 31 30 30 30 30 8220000000010000 0020 30 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0400000000000000 0030 30 35 30 38 30 38 34 37 32 38 35 32 35 35 30 31 0501111111125501 0040 30 31 36 30 31 31 31 30 30 32 31 31 31 53 31 30 0160111002111S10 0050 38 31 38 30 30 31 818001
2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) channel-receiver-jmeter-7441a4d8-receive 2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 55 (org.jpos.iso.ISOException: Field length 728 too long. Max: 512) unpacking field=55, consumed=55 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 55 (org.jpos.iso.ISOException: Field length 728 too long. Max: 512) unpacking field=55, consumed=55 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:341) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:479) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:976) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.iso.BaseChannel.receive(BaseChannel.java:746) ~[jpos-2.1.6.jar:2.1.6] at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:333) [jpos-2.1.6.jar:2.1.6] at java.lang.Thread.run(Unknown Source) [?:1.8.0_321] 2022-05-07 23:47:38,291 INFO o.a.j.t.JMeterThread: Thread is done: ISO 1-1 2022-05-07 23:47:38,291 INFO o.a.j.t.JMeterThread: Thread finished: ISO 1-1 2022-05-07 23:47:38,291 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test 2022-05-07 23:47:38,451 INFO n.c.b.j.i.Q2: (Q2.system) shutting down 2022-05-07 23:47:38,451 INFO n.c.b.j.i.Q2: (Q2.system) shutdown done 2022-05-07 23:47:38,451 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)
I'm not including this field in my request so why there is a problem in unpacking it?
@AyatShaabanNasr Thanks for posting this log, though you are not making it easy for people to help you. For example, there is no DEBUG information which would show your Channel configuration etc.
At least from the error log it is easy to explain why it is trying to unpack field 55.
Apparently, the header is treated as data (otherwise the header would be logged separately).
2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (channel/10.10.111.12:20001) [receive] --- data ---
2022-05-07 23:47:28,361 ERROR n.c.b.j.i.Q2: (channel/10.10.111.12:20001) [receive] 0000 49 53 4F 30 30 35 30 30 30 30 30 30 30 38 30 30 ISO0050000000800
So, instead of taking the ISO005000000
as the header value it becomes part of the message and is interpreted as follows:
MTI=ISO0
Bitmap=0500000008008220
which determines the message's fields as below...
0000010100000000000000000000000000001000000000001000001000100000
| | | | |
6=IFA_NUMERIC(12)=000000010000 | | |
| | | |
8=IFA_NUMERIC(8)=04000000 | | |
37=IFE_CHAR(12)=000000000508(ASCII)
| |
49=IF_CHAR(3)=084
|
55=IFA_LLLCHAR(728)
In order to get this fixed you need to provide more information.
For a start:
BASE24TCPChannel
)?I suggest running with DEBUG logging, e.g. via command line parameter -Lnz.co.breakpoint.jmeter.iso8583=DEBUG
(as described in the Troubleshooting section.
Header is 49534F303236303030303730 in message header hex Channel is Base24TCP as i get EOF error when trying other channels I changed the configuration to be like below and now i didn't get any error but there is no connection attempts to the server and response is empty I'm trying to get the debug log and will post it here
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE isopackager SYSTEM "genericpackager.dtd">
Shall i run the command of the log the cmd or where? i couldn't find where to run it in the trouble shooting?
Start jmeter from cmd like this:
jmeter -Lnz.co.breakpoint.jmeter.iso8583=DEBUG
Setting the header in the message and the headerLength
in the packager config may work, though I'd suggest using the Channel settings, such as the "Channel Header" field and/or Advanced Configuration properties such as "header" and "override-header".
You'll find plenty of information in the jPOS Users group.
I think BASE24TCPChannel
is the only one that handles a message trailer so perhaps that's right for you then.
2022-05-09 04:51:27,950 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-05-09 04:51:27,950 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-05-09 04:51:27,950 DEBUG n.c.b.j.i.ISO8583Config: Creating Q2
2022-05-09 04:51:27,950 INFO n.c.b.j.i.Q2: (Q2.system) Q2 started, deployDir=C:\apache-jmeter-5.4.3\bin\deploy, environment=default
2022-05-09 04:51:27,950 DEBUG n.c.b.j.i.Q2: (Q2.system) [version] jPOS 2.1.6 master/652fd99 (2021-03-31 18:40:47 UYT)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
jPOS Community Edition, licensed under GNU AGPL v3.0.
This software is probably not suitable for commercial use.
Please see http://jpos.org/license for details.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
iQEcBAEBAgAGBQJMolHDAAoJEOQyeO71nYtFv74H/3OgehDGEy1VXp2U3/GcAobg
HH2eZjPUz53r38ARPiU3pzm9LwDa3WZgJJaa/b9VrJwKvbPwe9+0kY3gScDE1skT
ladHt+KHHmGQArEutkzHlpZa73RbroFEIa1qmN6MaDEHGoxZqDh0Sv2cpvOaVYGO
St8ZaddLBPC17bSjAPWo9sWbvL7FgPFOHhnPmbeux8SLtnfWxXWsgo5hLBanKmO1
1z+I/w/6DL6ZYZU6bAJUk+eyVVImJqw0x3IEElI07Nh9MC6BA4iJ77ejobj8HI2r
q9ulRPEqH9NR79619lNKVUkE206dVlXo7xHmJS1QZy5v/GT66xBxyDVfTduPFXk=
=oP+v
-----END PGP SIGNATURE-----
2022-05-09 04:51:27,966 DEBUG n.c.b.j.i.ISO8583Config: 'ISO8583 Connection Configuration' setting up QBeans jmeter-512a3504
2022-05-09 04:51:27,966 DEBUG n.c.b.j.i.ISO8583Config: Deploying <channel-adaptor name="jmeter-512a3504-channel" logger="Q2"><in>jmeter-512a3504-send</in><out>jmeter-512a3504-receive</out><reconnect-delay>10000</reconnect-delay><wait-for-workers-on-stop>yes</wait-for-workers-on-stop><channel name="jmeter-512a3504" class="org.jpos.iso.channel.BASE24TCPChannel" packager="org.jpos.iso.packager.GenericPackager" header="" logger="Q2"><property name="packager-config" value="C:/Users/A.Shaaban/Desktop/Config.xml" /><property name="host" value="10.10.116.12" /><property name="port" value="20901" /></channel></channel-adaptor>
2022-05-09 04:51:27,966 DEBUG n.c.b.j.i.ISO8583Config: Deploying <qmux name="jmeter-512a3504-mux" logger="Q2"><in>jmeter-512a3504-receive</in><out>jmeter-512a3504-send</out><unhandled>jmeter-512a3504-unhandled</unhandled><ready>jmeter-512a3504.ready</ready></qmux>
2022-05-09 04:51:27,982 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [connect] Try 0 10.10.116.12:20901
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [got-message-length] 87
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [got-message-trailler] 03
2022-05-09 04:51:28,372 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : ISO
2022-05-09 04:51:28,372 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group ISO.
2022-05-09 04:51:28,372 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-05-09 04:51:28,372 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-05-09 04:51:28,372 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-05-09 04:51:28,372 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [receive] In: 0800 525923
2022-05-09 04:51:28,372 INFO o.a.j.t.JMeterThread: Thread started: ISO 1-1
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.ISO8583Sampler: Applying config 'ISO8583 Connection Configuration'
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.ISO8583Config: Creating packager from 'C:/Users/A.Shaaban/Desktop/Config.xml'
2022-05-09 04:51:28,388 DEBUG n.c.b.j.i.ISO8583Sampler: sampleStart
2022-05-09 04:51:28,403 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [send] Out: 0100 000012 1234567891234567
2022-05-09 04:51:58,406 DEBUG n.c.b.j.i.ISO8583Sampler: sampleEnd
2022-05-09 04:51:58,406 DEBUG n.c.b.j.i.ISO8583Sampler: Packed request
2022-05-09 04:51:58,406 INFO o.a.j.t.JMeterThread: Thread is done: ISO 1-1
2022-05-09 04:51:58,406 INFO o.a.j.t.JMeterThread: Thread finished: ISO 1-1
2022-05-09 04:51:58,406 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-05-09 04:51:58,406 DEBUG n.c.b.j.i.ISO8583Config: Shutting down QBeans
2022-05-09 04:51:58,406 DEBUG n.c.b.j.i.ISO8583Config: Undeploying jmeter-512a3504-mux
2022-05-09 04:51:58,406 DEBUG n.c.b.j.i.ISO8583Config: Undeploying jmeter-512a3504-channel
2022-05-09 04:51:58,406 INFO n.c.b.j.i.Q2: (Q2.system) shutting down
2022-05-09 04:51:58,406 INFO n.c.b.j.i.Q2: (Q2.system) shutdown done
2022-05-09 04:51:58,406 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
Does this mean that connection is well established? or no? as the server doesn't get any messages
Download and run netcat as a server listening on the port jmeter is supposed to talk to. Change the jmeter channel config to wherever you are running nectat on. Run the jmeter test , see the data received at the netcat instance that is running. If netcat is receiving the data means jmeter is sending it.
Now change the ip port in jmeter config to what your actual server is. Ping the server to make sure its available. Try telnetting to the IP port to make sure your server is listening.
Re run the test. If you don't see data being received on the server, see if the server is having trouble unpacking the message or any other exceptions it has logged.
Does this mean that connection is well established? or no? as the server doesn't get any messages
This log line shows that you received an 0800
message right after connecting, so yes the connection is established:
2022-05-09 04:51:28,372 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [receive] In: 0800 525923
You certainly sent something but did not get a response:
2022-05-09 04:51:28,403 DEBUG n.c.b.j.i.Q2: (channel/10.10.116.12:20901) [send] Out: 0100 000012 1234567891234567
So, as cchil suggested, check the server logs whether it has trouble unpacking your message.
What I can also imagine is that the server is not responding until a session is established the process for which depends on your specification, and may include responding to the 0800
message from the server.
This can be done easily via a Request Listener BSH script (see README).
I got this error after adding the BSH script file
2022-05-09 15:09:26,468 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: `` if ("0800".equals(message.getMTI())) { message.setResponseMTI(); messa . . . '' : Attempt to resolve method: getMTI() on undefined variable or class name: message
2022-05-09 15:09:26,468 WARN o.a.j.v.BeanShellListener: Problem in BeanShell script. org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: `` if ("0800".equals(message.getMTI())) { message.setResponseMTI(); messa . . . '' : Attempt to resolve method: getMTI() on undefined variable or class name: message
2022-05-09 15:09:26,468 INFO o.a.j.t.JMeterThread: Thread is done: ISO 1-1
o.a.j.u.BeanShellInterpreter
Don't use any JMeter BSH Script element but put the filename in the box at the bottom of the ISO8583 Connection Configuration element.
I'm trying to find this file in the bin directory but it doesn't exist? can i download it ?
I'm trying to find this file in the bin directory but it doesn't exist? can i download it ?
No, you'll have to create one that fits your specific situation.
Many thanks for you all for your endless support, i'm still working on it but you helped me alot
Hello Till, I need your help to make performance test for iso8583 messages below is the code used in ISO message
@tilln