tilln / jmeter-iso8583

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

Response Parsing error in jmeter #41

Closed saurabhranjane closed 2 years ago

saurabhranjane commented 3 years ago

Hi @tilln

I am trying to send hardcoded response to a jmeter iso8583 request. but it gives unpacking field 20 error although i am not sending that particular field.

Channel Class : ASCIIChannel Request Format : MTI(0800)+DE41 (Request received on server) Response format is : Len(4byte)+Header(BCD)+MTI(0810)+Bitmap(BCD)+DE11+DE39+DE41 (Response received on jemeter)

In Jemter console i am getting the same response sent from server.

****ERROR**** 2021-07-28 20:15:46,841 ERROR n.c.b.j.i.Q2: (channel/103.15.74.174:5255) [receive] --- data --- 2021-07-28 20:15:46,841 ERROR n.c.b.j.i.Q2: (channel/103.15.74.174:5255) [receive] 0000 60 01 23 00 00 30 38 31 30 00 20 00 00 02 80 00 `.#..0810. ..... 0010 00 31 32 33 34 35 36 30 30 33 37 .1234560037

2021-07-28 20:15:46,842 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) channel-receiver-jmeter-63d8841b-receive 2021-07-28 20:15:46,843 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) org.jpos.iso.IFA_NUMERIC: Problem unpacking field 20 (java.lang.RuntimeException: Required 3 but just got 0 bytes) unpacking field=20, consumed=27

tilln commented 3 years ago

Hi @saurabhranjane

What I think happens in your case is that the packager starts to unpack the bytes as follows, after which there is nothing left for DE20:

60012300 0030383130002000 000280000031 323334353630 303337 
MTI      Bitmap           DE11         DE12         DE19   DE20

In other words, the bytes between length and MTI 60012300 are not consumed as header but as message fields, so you want to either configure your (static?) header or look at whether you need to use another Channel.

chhil commented 3 years ago

Parsing hex data based on assumptions

Header : 60 01 23 00 00  
MTI       : 30 38 31 30  -> 0810 
Bitmap :  00 20 00 00 02 80 00 00 
31 32 33 34 35 36 30 30 33 37 : 1234560037 : Data

Parsing bitmap 
00 : 0000 0000 (8 bits none set) [bit 1 to bit 8]
20 : 0010 0000 (bit 11 set)[bit 9 to bit 16]
00 : 0000 0000 (none set) [bit 17 to bit 24]
00 : 0000 0000 (none set)[bit 25 to bit 32]
02 : 0000 0010 (bit 39 set)[bit 33 to bit 40]
80 : 1000 0000 (bit 41 set)[bit 41 to bit 48]
...
...

Parsing the data for the set bits
DE11 is usually 6 : 31 32 33 34 35 36 : 123456
DE39 is usually 2: 30 30 : 00
DE41 in your data has 33 37 : 37

Probably the channel does not understand the length + header or your length of message is incorrect and causing the channel to truncate your message. Or you have not setup your field packager correctly for your field. Your bitmap is being offset causing it parse it to have fields that you have not set.

Edit Your formats cannot be different for request and response. If the request is not sending a header, the response cannot send a header. Channel Class : ASCIIChannel Request Format : MTI(0800)+DE41 (Request received on server) Response format is : Len(4byte)+Header(BCD)+MTI(0810)+Bitmap(BCD)+DE11+DE39+DE41 (Response received on jemeter)

saurabhranjane commented 3 years ago

Hi @chhil / @tilln ,

Thank you for replying. Length is right because I am getting exact response in jmeter from server. And sorry I forgot to mention but header is present in request.

no-response[bot] commented 2 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.