tilln / jmeter-iso8583

ISO8583 Plugin for JMeter
MIT License
62 stars 32 forks source link

Can't Parse ISO8583 message #52

Closed AyatShaabanNasr closed 2 years ago

AyatShaabanNasr commented 2 years ago

Hello Till, I need your help to make performance test for iso8583 messages below is the code used in ISO message

<isomsg direction="outgoing">
  <!-- org.jpos.iso.packager.GenericPackager[C:/Users/A.Shaaban/Desktop/Config.xml] -->
  <header>49534F303236303030303731</header>
  <field id="0" value="0100"/>
  <field id="2" value="16111111111111111111"/>
  <field id="3" value="300000"/>
  <field id="4" value="000000000000"/>
  <field id="7" value="0912113545"/>
  <field id="11" value="000012"/>
  <field id="12" value="220912113545"/>
  <field id="14" value="251131"/>
  <field id="22" value="026"/>
  <field id="24" value="200"/>
  <field id="25" value="00"/>
  <field id="35" value="1111111111111111=111122110836269"/>
  <field id="41" value="123456789       "/>
  <field id="42" value="123456789      "/>
  <field id="52" value="987123456778915"/>
</isomsg>

<!--
0000  30 31 30 30 37 32 33 34  30 35 38 30 32 30 43 30  01007234058020C0
0010  31 30 30 30 31 36 35 30  37 38 30 33 34 34 39 36  1000161111111111
0020  36 35 34 37 39 34 33 30  30 30 30 30 30 30 30 30  1111113000000000
0030  30 30 30 30 30 30 30 30  30 39 31 32 31 31 33 35  0000000009121135
0040  34 35 30 30 30 30 31 32  32 32 30 39 31 32 31 31  4500001222091211
0050  33 35 34 35 32 35 31 31  33 31 30 32 36 32 30 30  3545251131026200
0060  30 30 33 32 35 30 37 38  30 33 34 34 39 36 36 35  0032111111111111
0070  34 37 39 34 3D 32 35 31  31 32 32 31 31 30 38 33  1111=11112211083
0080  36 32 36 39 31 32 33 34  35 36 37 38 39 20 20 20  6269123456789   
0090  20 20 20 20 31 32 33 34  35 36 37 38 39 20 20 20      123456789   
00a0  20 20 20 39 38 37 38 33  43 45 46 42 42 39 37 38     98783CEFBB978
00b0  39 31 35                                          915
-->

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager PUBLIC
        "-//jPOS/jPOS Generic Packager DTD 1.0//EN"
        "http://jpos.org/dtd/generic-packager-1.0.dtd">

<isopackager>
  <isofield
      id="0"
      length="4"
      name="MESSAGE TYPE INDICATOR"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="1"
      length="16"
      name="BIT MAP"
      class="org.jpos.iso.IFA_BITMAP"/>
  <isofield
      id="2"
      length="18"
      name="PAN - PRIMARY ACCOUNT NUMBER"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="3"
      length="6"
      name="PROCESSING CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="4"
      length="12"
      name="AMOUNT, TRANSACTION"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="5"
      length="12"
      name="AMOUNT, SETTLEMENT"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="6"
      length="12"
      name="AMOUNT, CARDHOLDER BILLING"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="7"
      length="10"
      name="TRANSMISSION DATE AND TIME"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="8"
      length="8"
      name="AMOUNT, CARDHOLDER BILLING FEE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="9"
      length="8"
      name="CONVERSION RATE, SETTLEMENT"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="10"
      length="8"
      name="CONVERSION RATE, CARDHOLDER BILLING"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="11"
      length="6"
      name="SYSTEM TRACE AUDIT NUMBER"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="12"
      length="12"
      name="TIME, LOCAL TRANSACTION"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="13"
      length="4"
      name="DATE, LOCAL TRANSACTION"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="14"
      length="6"
      name="DATE, EXPIRATION"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="15"
      length="4"
      name="DATE, SETTLEMENT"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="16"
      length="4"
      name="DATE, CONVERSION"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="17"
      length="4"
      name="DATE, CAPTURE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="18"
      length="4"
      name="MERCHANTS TYPE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="19"
      length="3"
      name="ACQUIRING INSTITUTION COUNTRY CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="20"
      length="3"
      name="PAN EXTENDED COUNTRY CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="21"
      length="3"
      name="FORWARDING INSTITUTION COUNTRY CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="22"
      length="3"
      name="POINT OF SERVICE ENTRY MODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="23"
      length="3"
      name="CARD SEQUENCE NUMBER"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="24"
      length="3"
      name="NETWORK INTERNATIONAL IDENTIFIEER"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="25"
      length="2"
      name="POINT OF SERVICE CONDITION CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="26"
      length="2"
      name="POINT OF SERVICE PIN CAPTURE CODE"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="27"
      length="1"
      name="AUTHORIZATION IDENTIFICATION RESP LEN"
      pad="true"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="28"
      length="9"
      name="AMOUNT, TRANSACTION FEE"
      pad="true"
      class="org.jpos.iso.IFA_AMOUNT"/>
  <isofield
      id="29"
      length="9"
      name="AMOUNT, SETTLEMENT FEE"
      pad="true"
      class="org.jpos.iso.IFA_AMOUNT"/>
  <isofield
      id="30"
      length="9"
      name="AMOUNT, TRANSACTION PROCESSING FEE"
      pad="true"
      class="org.jpos.iso.IFA_AMOUNT"/>
  <isofield
      id="31"
      length="9"
      name="AMOUNT, SETTLEMENT PROCESSING FEE"
      pad="true"
      class="org.jpos.iso.IFA_AMOUNT"/>
 <isofield
      id="32"
      length="11"
      name="ACQUIRING INSTITUTION IDENT CODE"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="33"
      length="11"
      name="FORWARDING INSTITUTION IDENT CODE"
      pad="true"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="34"
      length="28"
      name="PAN EXTENDED"
      pad="true"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="35"
      length="32"
      name="TRACK 2 DATA"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="36"
      length="14"
      name="TRACK 3 DATA"
      class="org.jpos.iso.IFA_LLCHAR"/>
  <isofield
      id="37"
      length="12"
      name="RETRIEVAL REFERENCE NUMBER"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="38"
      length="6"
      name="AUTHORIZATION IDENTIFICATION RESPONSE"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="39"
      length="2"
      name="RESPONSE CODE"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="40"
      length="3"
      name="SERVICE RESTRICTION CODE"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="41"
      length="16"
      name="CARD ACCEPTOR TERMINAL IDENTIFICACION"
       class="org.jpos.iso.IF_CHAR"/> <!-- ANS 16 - base24-eps -->
  <isofield
      id="42"
      length="15"
      name="CARD ACCEPTOR IDENTIFICATION CODE"
      class="org.jpos.iso.IF_CHAR"/>
<isofield
      id="43"
      length="40"
      name="CARD ACCEPTOR NAME/LOCATION"
      class="org.jpos.iso.IF_CHAR"/>

  <isofield
      id="44"
      length="99"
      name="Additional response data"
      class="org.jpos.iso.IFA_LLCHAR"/>
  <isofield
      id="45"
      length="81"
      name="Track 1 data"
      class="org.jpos.iso.IFA_LLCHAR"/>
  <isofield
      id="46"
      length="204"
      name="Amounts, Fees"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="47"
      length="999"
      name="Additional data - national"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="48"
      length="999"
      name="Additional data - private"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="49"
      length="3"
      name="Currency code, Transaction"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="50"
      length="3"
      name="Currency code, Reconciliation"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="51"
      length="3"
      name="Currency code, Cardholder billing"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="52"
      length="16"
      name="Personal identification number [PIN] data"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="53"
      length="48"
      name="Security related control information"
      class="org.jpos.iso.IFA_LLBINARY"/>
  <isofield
      id="54"
      length="120"
      name="Amounts, additional"
      class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
      id="55"
      length="512"
      name="IC card system related data"
      class="org.jpos.iso.IFA_LLLCHAR"/>

  <isofield
      id="56"
      length="35"
      name="Original data elements"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="57"
      length="3"
      name="Authorization life cycle code"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="58"
      length="11"
      name="Authorizing agent institution Id Code"
      class="org.jpos.iso.IFA_LLNUM"/>
  <isofield
      id="59"
      length="512"
      name="RESERVED NATIONAL"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield id="60"
    name="RESERVED PRIVATE"
    length="10"
    pad="true"
    class="org.jpos.iso.IFB_LLHBINARY"/>
  <isofield
      id="61"
      length="999"
      name="Reserved for national use"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="62"
      length="999"
      name="Reserved for private use"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="63"
      length="999"
      name="Reserved for private use"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="64"
      length="8"
      name="Message authentication code field"
      class="org.jpos.iso.IFA_BINARY"/>
  <isofield
      id="65"
      length="8"
      name="Reserved for ISO use"
      class="org.jpos.iso.IFA_BINARY"/>
  <isofield
      id="66"
      length="204"
      name="Amounts, original fees"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="67"
      length="2"
      name="Extended payment data"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="68"
      length="3"
      name="Country code, receiving institution"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="69"
      length="3"
      name="Country code, settlement institution"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="70"
      length="3"
      name="Country code, authorizing agent Inst."
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="71"
      length="8"
      name="Message number"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield
      id="72"
      length="999"
      name="Data record"
      class="org.jpos.iso.IFA_LLLCHAR"/>
  <isofield
      id="73"
      length="6"
      name="Date, action"
      class="org.jpos.iso.IFA_NUMERIC"/>

@tilln

tilln commented 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.

tilln commented 2 years ago

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.

AyatShaabanNasr commented 2 years ago

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?

tilln commented 2 years ago

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.

tilln commented 2 years ago

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

AyatShaabanNasr commented 2 years ago

@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

chhil commented 2 years ago

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

AyatShaabanNasr commented 2 years ago

i used base24tcpchannel , can i use j8583 instead of jpos?

chhil commented 2 years ago

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.

AyatShaabanNasr commented 2 years ago

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

tilln commented 2 years ago

@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.

AyatShaabanNasr commented 2 years ago

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

tilln commented 2 years ago

Your log claims it's trying to unpack with org.jpos.iso.IFA_LCHAR with length 3 though?

AyatShaabanNasr commented 2 years ago

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: @.***>

tilln commented 2 years ago

As above, you need to provide more details. Especially logging that actually matches your configuration.

AyatShaabanNasr commented 2 years ago

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)

AyatShaabanNasr commented 2 years ago

I'm not including this field in my request so why there is a problem in unpacking it?

tilln commented 2 years ago

@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:

I suggest running with DEBUG logging, e.g. via command line parameter -Lnz.co.breakpoint.jmeter.iso8583=DEBUG (as described in the Troubleshooting section.

AyatShaabanNasr commented 2 years ago

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">

AyatShaabanNasr commented 2 years ago

Shall i run the command of the log the cmd or where? i couldn't find where to run it in the trouble shooting?

tilln commented 2 years ago

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.

AyatShaabanNasr commented 2 years ago
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*)
AyatShaabanNasr commented 2 years ago

Does this mean that connection is well established? or no? as the server doesn't get any messages

chhil commented 2 years ago

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.

tilln commented 2 years ago

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).

AyatShaabanNasr commented 2 years ago

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
tilln commented 2 years ago

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.

AyatShaabanNasr commented 2 years ago

I'm trying to find this file in the bin directory but it doesn't exist? can i download it ?

tilln commented 2 years ago

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.

AyatShaabanNasr commented 2 years ago

Many thanks for you all for your endless support, i'm still working on it but you helped me alot