dinesh kumar
dinesh kumar

Reputation: 11

How to send Header value in Jmeter using ISO8583 Plugin

I was not able to send request message as per client requirement. Can anyone please let me know how to add header value to the request message as per below highlighted format.

VTS: ( Due to client confidential information, sharing first few lines of the request HEXDUMP)

00000000    **014F 0000 1601 0201  4F00 0000 0000 0000**  
00000010    **0000 0000 0000 0000  0000** *0100 F224 6691*
00000020    *28F0 8216 0000 0000  0000 0020* 16XX XXXX
00000030    XXXX XXXX XX00 0000  0000 0000 1200 0821

I have attached Jmeter configuration for reference,

<isomsg>
  <!-- org.jpos.iso.packager.GenericPackager[iso93binary_DPP.xml] -->
  <header>160102014F0000000000000000000000000000000000</header>
  <field id="0" value="0100"/>
  <field id="1" value="F224669128F082160000000000000020"/>
</isomsg>

Jmeter HEXDUMP:

0000  *0100 F224 6691 28F0  8216 0000 0000 0000*
0010  *0020* 16XX XXXX XXXX  XXXX XX00 0000 0000
0020  0000 1200 0821 0657  2018 4566 2408 5999

Added screenshots for more clarity,

Sampler

Connection Configuration

Added JMX as well for reference:

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan">
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="DPP">
        <intProp name="ThreadGroup.num_threads">1</intProp>
        <intProp name="ThreadGroup.ramp_time">1</intProp>
        <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
          <stringProp name="LoopController.loops">1</stringProp>
          <boolProp name="LoopController.continue_forever">false</boolProp>
        </elementProp>
      </ThreadGroup>
      <hashTree>
        <nz.co.breakpoint.jmeter.iso8583.ISO8583Config guiclass="TestBeanGUI" testclass="nz.co.breakpoint.jmeter.iso8583.ISO8583Config" testname="ISO8583 Connection Configuration">
          <stringProp name="configKey"></stringProp>
          <stringProp name="classname">BASE24TCPChannel</stringProp>
          <stringProp name="packager"></stringProp>
          <stringProp name="header">0000000000000000000000</stringProp>
          <stringProp name="host"></stringProp>
          <stringProp name="port"></stringProp>
          <boolProp name="reuseConnection">true</boolProp>
          <stringProp name="maxConnections"></stringProp>
          <stringProp name="connectionSelection">connectionSelection.LAST</stringProp>
          <collectionProp name="channelConfig"/>
          <stringProp name="keystore"></stringProp>
          <stringProp name="storePassword"></stringProp>
          <stringProp name="keyPassword"></stringProp>
          <stringProp name="mtiMapping"></stringProp>
          <collectionProp name="muxKeyConfig"/>
          <stringProp name="requestListener"></stringProp>
        </nz.co.breakpoint.jmeter.iso8583.ISO8583Config>
        <hashTree/>
        <nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler guiclass="TestBeanGUI" testclass="nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler" testname="ISO8583 Sampler">
          <stringProp name="configKey"></stringProp>
          <stringProp name="header">160102014F0000000000000000000000000000000000</stringProp>
          <stringProp name="trailer"></stringProp>
          <collectionProp name="fields">
            <elementProp name="0" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="0">
              <stringProp name="content">0100</stringProp>
            </elementProp>
            <elementProp name="1" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="1">
              <stringProp name="content">F224669128F082160000000000000020</stringProp>
            </elementProp>
            <elementProp name="2" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="2">
              <stringProp name="content"></stringProp>
            </elementProp>
            <elementProp name="3" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="3">
              <stringProp name="content">000000</stringProp>
            </elementProp>
            <elementProp name="4" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="4">
              <stringProp name="content">000000001200</stringProp>
            </elementProp>
            <elementProp name="7" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="7">
              <stringProp name="content">0821065720</stringProp>
            </elementProp>
            <elementProp name="11" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="11">
              <stringProp name="content">184566</stringProp>
            </elementProp>
            <elementProp name="14" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="14">
              <stringProp name="content">2408</stringProp>
            </elementProp>
            <elementProp name="18" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="18">
              <stringProp name="content">5999</stringProp>
            </elementProp>
            <elementProp name="19" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="19">
              <stringProp name="content">826</stringProp>
            </elementProp>
            <elementProp name="22" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="22">
              <stringProp name="content">9010</stringProp>
            </elementProp>
            <elementProp name="23" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="23">
              <stringProp name="content">000</stringProp>
            </elementProp>
            <elementProp name="25" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="25">
              <stringProp name="content">00</stringProp>
            </elementProp>
            <elementProp name="28" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="28">
              <stringProp name="content">D00000000</stringProp>
            </elementProp>
            <elementProp name="32" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="32">
              <stringProp name="content">441003</stringProp>
            </elementProp>
            <elementProp name="35" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="35">
              <stringProp name="content"></stringProp>
            </elementProp>
            <elementProp name="37" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="37">
              <stringProp name="content">422106183988</stringProp>
            </elementProp>
            <elementProp name="41" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="41">
              <stringProp name="content">TERMID01</stringProp>
            </elementProp>
            <elementProp name="42" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="42">
              <stringProp name="content">Sheldon Square</stringProp>
            </elementProp>
            <elementProp name="43" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="43">
              <stringProp name="content">Visa Europe              London       GB</stringProp>
            </elementProp>
            <elementProp name="44.1" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="44.1">
              <stringProp name="content">02</stringProp>
            </elementProp>
            <elementProp name="44.2" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="44.2">
              <stringProp name="content"> Y</stringProp>
            </elementProp>
            <elementProp name="49" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="49">
              <stringProp name="content">826</stringProp>
            </elementProp>
            <elementProp name="55.1" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="55.1">
              <stringProp name="content">62</stringProp>
            </elementProp>
            <elementProp name="55.2" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="55.2">
              <stringProp name="content">01005F9F3303E0E0E0950500800000009F37049BADBCAB9F100706090A03A400009F26080123456789ABCDEF9F360200FF820200009C01009F1A0208269A030811059F02060000000012005F2A0208269F03060000000000008407A0000000031010</stringProp>
            </elementProp>
            <elementProp name="60" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="60">
              <stringProp name="content">05000810</stringProp>
            </elementProp>
            <elementProp name="62" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="62">
              <stringProp name="content">0000000000000000</stringProp>
            </elementProp>
            <elementProp name="63" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="63">
              <stringProp name="content">8000000002</stringProp>
            </elementProp>
            <elementProp name="123.1" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="123.1">
              <stringProp name="content">19</stringProp>
            </elementProp>
            <elementProp name="123.2" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="123.2">
              <stringProp name="content">123456789555 State Street</stringProp>
            </elementProp>
          </collectionProp>
          <intProp name="timeout">5000</intProp>
          <stringProp name="responseCodeField">39</stringProp>
          <stringProp name="successResponseCode">000</stringProp>
        </nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler>
        <hashTree/>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>false</xml>
              <fieldNames>true</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
              <sentBytes>true</sentBytes>
              <url>true</url>
              <threadCounts>true</threadCounts>
              <idleTime>true</idleTime>
              <connectTime>true</connectTime>
            </value>
          </objProp>
          <stringProp name="filename"></stringProp>
        </ResultCollector>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

packager XML:

<!DOCTYPE isopackager PUBLIC
        "-//jPOS/jPOS Generic Packager DTD 1.0//EN"
        "http://jpos.org/dtd/generic-packager-1.0.dtd">

<!-- ISO 8583:1993 (BINARY) field descriptions for GenericPackager -->

<isopackager headerLength="22">
    <isofield
      id="0"
      length="4"
      name="Message Type Indicator"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="1"
      length="16"
      name="Bitmap"
      class="org.jpos.iso.IFB_BITMAP"/>
  <isofield
      id="2"
      length="16"
      name="Primary Account number"
      pad="false"
      class="org.jpos.iso.IFB_LLHNUM"/>
  <isofield
      id="3"
      length="6"
      name="Processing Code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="4"
      length="12"
      name="Amount, Transaction"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="5"
      length="12"
      name="Amount, Reconciliation"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="6"
      length="12"
      name="Amount, Cardholder billing"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="7"
      length="10"
      name="Date and time, transmission"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="8"
      length="8"
      name="Amount, Cardholder billing fee"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="9"
      length="8"
      name="Conversion rate, Reconciliation"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="10"
      length="8"
      name="Conversion rate, Cardholder billing"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="11"
      length="6"
      name="Systems trace audit number"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="12"
      length="12"
      name="Date and time, Local transaction"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="13"
      length="4"
      name="Date, Effective"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="14"
      length="4"
      name="Date, Expiration"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="15"
      length="6"
      name="Date, Settlement"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="16"
      length="4"
      name="Date, Conversion"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="17"
      length="4"
      name="Date, Capture"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="18"
      length="4"
      name="Merchant type"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="19"
      length="4"
      name="Country code, Acquiring institution"
      pad="true"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="20"
      length="3"
      name="Country code, Primary account number"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="21"
      length="3"
      name="Country code, Forwarding institution"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="22"
      length="4"
      name="Point of service data code"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="23"
      length="3"
      name="Card sequence number"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="24"
      length="3"
      name="Function code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="25"
      length="2"
      name="Message reason code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="26"
      length="4"
      name="Card acceptor business code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="27"
      length="1"
      name="Approval code length"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="28"
      length="9"
      name="Date, Reconciliation"
      pad="false"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="29"
      length="3"
      name="Reconciliation indicator"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="30"
      length="24"
      name="Amounts, original"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="31"
      length="99"
      name="Acquirer reference data"
      class="org.jpos.iso.IFB_LLCHAR"/>
  <isofield
      id="32"
      length="11"
      name="Acquirer institution ident code"
      pad="false"
      class="org.jpos.iso.IFB_LLNUM"/>
  <isofield
      id="33"
      length="11"
      name="Forwarding institution ident code"
      pad="false"
      class="org.jpos.iso.IFB_LLNUM"/>
  <isofield
      id="34"
      length="28"
      name="Primary account number, extended"
      class="org.jpos.iso.IFB_LLCHAR"/>
  <isofield
      id="35"
      length="38"
      name="Track 2 data"
      pad="true"
      class="org.jpos.iso.IFB_LLHNUM"/>
  <isofield
      id="36"
      length="104"
      name="Track 3 data"
      class="org.jpos.iso.IFB_LLLCHAR"/>
  <isofield
      id="37"
      length="12"
      name="Retrieval reference number"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="38"
      length="6"
      name="Approval code"
      class="org.jpos.iso.IF_CHAR"/>
  <isofield
      id="39"
      length="2"
      name="Action code"
      pad="false"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="40"
      length="3"
      name="Service code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="41"
      length="8"
      name="Card acceptor terminal identification"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="42"
      length="15"
      name="Card acceptor identification code"
      class="org.jpos.iso.IFE_CHAR"/>
  <isofield
      id="43"
      length="40"
      name="Card acceptor name/location"
      class="org.jpos.iso.IFE_CHAR"/>
<isofieldpackager id="44"
                      name="Additional data"
                      length="3"
                      class="org.jpos.iso.IF_CHAR"
                      packager="org.jpos.iso.packager.GenericSubFieldPackager"
                      emitBitmap="false"
                      maxValidField="2">
    <isofield id="1"
              name="Length"
              length="1"
              pad="true"
              class="org.jpos.iso.IFB_BINARY"/>
    <isofield id="2"
              name="Value"
              length="2"
              pad="false"
              class="org.jpos.iso.IFE_CHAR"/>
  </isofieldpackager>
  <isofield
      id="45"
      length="76"
      name="Track 1 data"
      class="org.jpos.iso.IFB_LLCHAR"/>
  <isofield
      id="46"
      length="204"
      name="Amounts, Fees"
      class="org.jpos.iso.IFB_LLLCHAR"/>
  <isofield
      id="47"
      length="999"
      name="Additional data - national"
      class="org.jpos.iso.IFB_LLLBINARY"/>
  <isofield
      id="48"
      length="999"
      name="Additional data - private"
      class="org.jpos.iso.IFB_LLLCHAR"/>
  <isofield
      id="49"
      length="4"
      name="Currency code, Transaction"
      pad="true"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <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="8"
      name="Personal identification number [PIN] data"
      class="org.jpos.iso.IFB_BINARY"/>
  <isofield
      id="53"
      length="48"
      name="Security related control information"
      class="org.jpos.iso.IFB_LLBINARY"/>
  <isofield
      id="54"
      length="120"
      name="Amounts, additional"
      class="org.jpos.iso.IFB_LLLCHAR"/>
<isofieldpackager id="55"
                      name="ICC"
                      length="99"
                      class="org.jpos.iso.IF_CHAR"
                      packager="org.jpos.iso.packager.GenericSubFieldPackager"
                      emitBitmap="false"
                      maxValidField="20">
    <isofield id="1"
              name="Fieldlength"
              length="2"
              pad="false"
              class="org.jpos.iso.IFB_NUMERIC"/>
    <isofield id="2"
              name="TAGS"
              length="98"
              pad="false"
              class="org.jpos.iso.IFB_BINARY"/>
    </isofieldpackager>
  <isofield
      id="56"
      length="35"
      name="Original data elements"
      pad="false"
      class="org.jpos.iso.IFB_LLNUM"/>
  <isofield
      id="57"
      length="3"
      name="Authorization life cycle code"
      pad="false"
      class="org.jpos.iso.IFB_NUMERIC"/>
  <isofield
      id="58"
      length="11"
      name="Authorizing agent institution Id Code"
      pad="false"
      class="org.jpos.iso.IFB_LLNUM"/>
  <isofield
      id="59"
      length="999"
      name="Transport data"
      class="org.jpos.iso.IFB_LLLCHAR"/>
  <isofield
      id="60"
      length="4"
      name="Reserved for national use"
      class="org.jpos.iso.IFB_LLBINARY"/>
  <isofield
      id="61"
      length="999"
      name="Reserved for national use"
      class="org.jpos.iso.IFB_LLLCHAR"/>
  <isofield
      id="62"
      length="8"
      name="Reserved for private use"
      class="org.jpos.iso.IFB_LLBINARY"/>
  <isofield
      id="63"
      length="5"
      name="Reserved for private use"
      class="org.jpos.iso.IFB_LLBINARY"/>
  <isofield
      id="122"
      length="999"
      name="Reserved for national use"
      class="org.jpos.iso.IFB_LLLCHAR"/>
<isofieldpackager id="123"
                      name="Additional data"
                      length="26"
                      class="org.jpos.iso.IFB_BINARY"
                      packager="org.jpos.iso.packager.GenericSubFieldPackager"
                      emitBitmap="false"
                      maxValidField="2">
    <isofield id="1"
              name="Length"
              length="1"
              pad="true"
              class="org.jpos.iso.IFB_BINARY"/>
    <isofield id="2"
              name="Value"
              length="25"
              pad="false"
              class="org.jpos.iso.IFE_CHAR"/>
  </isofieldpackager>
</isopackager>

EDIT NUMBER 2: Now i am able to send the request successfully and able to get response from server as well. When Jmeter is trying to parse the incoming response its getting failed at field 48, but when i decode the bitmap field 48 is not present. How to resolve this issue?

BITMAP : 722022810AD08202

2024-10-25 09:02:07,934 ERROR n.c.b.j.i.Q2: (channel/XX.XXX.XX.XX:XXXXX) [receive] --- data --- 2024-10-25 09:02:07,934 ERROR n.c.b.j.i.Q2: (channel/XX.XXX.XX.XX:XXXXX) [receive]

0000  01 10 72 20 22 81 0A D0  82 02 10 XX XX XX XX XX
0010  XX XX XX 00 00 00 00 00  00 00 12 00 08 21 06 57
0020  20 18 45 66 08 26 00 00  00 06 44 10 03 F4 F2 F2
0030  F1 F0 F6 F1 F8 F3 F9 F8  F8 F1 F9 E3 C5 D9 D4 C9
0040  C4 F0 F1 E2 88 85 93 84  96 95 40 E2 98 A4 81 99
0050  85 40 02 F5 E8 08 26 49  01 00 46 9A 03 08 11 05
0060  9C 01 00 9F 02 06 00 00  00 00 12 00 9F 03 06 00
0070  00 00 00 00 00 9F 10 07  06 09 0A 03 A4 00 00 9F
0080  1A 02 08 26 9F 26 08 01  23 45 67 89 AB CD EF 9F
0090  33 03 E0 E0 E0 9F 36 02  00 FF 9F 37 04 9B AD BC
00a0  AB 05 80 00 00 00 02                            

2024-10-25 09:02:07,934 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) channel-receiver-jmeter-bdc26f30-receive
2024-10-25 09:02:07,934 ERROR n.c.b.j.i.Q2: (org.jpos.q2.iso.ChannelAdaptor) org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 48 (java.lang.RuntimeException: Required 100 but just got 77 bytes) unpacking field=48, consumed=88
org.jpos.iso.ISOException: org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 48 (java.lang.RuntimeException: Required 100 but just got 77 bytes) unpacking field=48, consumed=88
    at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:341) ~[jpos-2.1.8.jar:2.1.8]
    at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:479) ~[jpos-2.1.8.jar:2.1.8]
    at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:978) ~[jpos-2.1.8.jar:2.1.8]
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:748) ~[jpos-2.1.8.jar:2.1.8]
    at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:333) [jpos-2.1.8.jar:2.1.8]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

Upvotes: 0

Views: 180

Answers (1)

Andr&#233;s Alcarraz
Andr&#233;s Alcarraz

Reputation: 1865

There are two places to define the header, at channel level, and at message level, the channel level header acts as a default header that is overridden by the message level header if present.

You need to specify the channel level header always, so the channel knows the expected length of the header.

This where you define that: channel level header definition

If you need a specific header for a given message, you set it in the ISO8583 sampler, as follows: message level header definition

Keep in mind that the channel is the one interpreting the channel level header, and each channel will handle it differently, for instance the Base24TCPChannel will expect the plain string.

The message level header is always interpreted as a hex string. That's why in the example, the message level header has twice the length that the channel level's one.

If you need a more specific answer for your use case, please share the configuration you are using for your channel.

Here you have the jmx content, just save it as something.jmx and open it with jmeter.

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="jPOS server simulator">
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group">
        <intProp name="ThreadGroup.num_threads">1</intProp>
        <intProp name="ThreadGroup.ramp_time">1</intProp>
        <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
          <stringProp name="LoopController.loops">1</stringProp>
          <boolProp name="LoopController.continue_forever">false</boolProp>
        </elementProp>
      </ThreadGroup>
      <hashTree>
        <nz.co.breakpoint.jmeter.iso8583.ISO8583Config guiclass="TestBeanGUI" testclass="nz.co.breakpoint.jmeter.iso8583.ISO8583Config" testname="ISO8583 Connection Configuration">
          <stringProp name="classname">BASE24TCPChannel</stringProp>
          <stringProp name="configKey"></stringProp>
          <stringProp name="connectionSelection">connectionSelection.LAST</stringProp>
          <stringProp name="header">0000000000000000000000</stringProp>
          <stringProp name="host">localhost</stringProp>
          <stringProp name="keyPassword"></stringProp>
          <stringProp name="maxConnections"></stringProp>
          <stringProp name="mtiMapping"></stringProp>
          <stringProp name="packager">jar:packager/iso93binary.xml</stringProp>
          <stringProp name="port">10000</stringProp>
          <stringProp name="requestListener"></stringProp>
          <boolProp name="reuseConnection">true</boolProp>
          <stringProp name="storePassword"></stringProp>
          <collectionProp name="channelConfig"/>
          <stringProp name="keystore"></stringProp>
          <collectionProp name="muxKeyConfig"/>
        </nz.co.breakpoint.jmeter.iso8583.ISO8583Config>
        <hashTree/>
        <nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler guiclass="TestBeanGUI" testclass="nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler" testname="echo">
          <stringProp name="configKey"></stringProp>
          <stringProp name="header">160102014F0000000000000000000000000000000000</stringProp>
          <stringProp name="responseCodeField">39</stringProp>
          <stringProp name="successResponseCode">00</stringProp>
          <intProp name="timeout">60000</intProp>
          <stringProp name="trailer"></stringProp>
          <collectionProp name="fields">
            <elementProp name="0" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="0">
              <stringProp name="content">1800</stringProp>
            </elementProp>
            <elementProp name="7" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="7">
              <stringProp name="content">${__time(MMddHHmmss,)}</stringProp>
            </elementProp>
            <elementProp name="11" elementType="nz.co.breakpoint.jmeter.iso8583.MessageField" testname="11">
              <stringProp name="content">${__RandomString(6,0123456789)}</stringProp>
            </elementProp>
          </collectionProp>
        </nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Then you can just open a netcat server to check the header is coming.

➜  ~ nc -l 10000 | xxd
00000000: 0029 1601 0201 4f00 0000 0000 0000 0000  .)....O.........
00000010: 0000 0000 0000 0000 1800 0220 0000 0000  ........... ....

EDIT: With the info added by the OP, I ran the jmeter with the shared configuration and a server simulator, the server simulator is receiving the header as shown below:

<log realm="channel/127.0.0.1:49698" at="2024-08-27T07:08:16.651" lifespan="40ms">
  <receive>
    <isomsg direction="incoming">
      <!-- org.jpos.iso.packager.GenericPackager[jar:packager/iso93binary.xml] -->
      <header>160102014F0000000000000000000000000000000000</header>
      <field id="0" value="0100"/>

Also, you can try it yourself with a netcat, I used port 10000:

➜  ~ nc -l 10000 | xxd
00000000: 00c5 1601 0201 4f00 0000 0000 0000 0000  ......O.........
00000010: 0000 0000 0000 0000 0100 7224 6681 28e0  ..........r$f.(.
00000020: 8016 0000 0000 0000 0000 1200 0821 0657  .............!.W
00000030: 2018 4566 2408 5999 8260 3930 3130 2020   .Ef$.Y..`9010  

As you can see, the header is there also, so, the issue is most probably in an intermediate system, not in the jmeter config.

EDIT 2: It seems the problem is that you think that what is shown in the hexdump in the jmeter results, is what is the whole content that is sent over the wire; it is not, that is just what the packager is generating. The header and trailer are appended by the channel at send time, to really know what it is being sent you need to capture the stream. You need to listen with netcat, like shown above, or use a sniffer, like tcpdump or wireshark, or see what the other party receives in the log.

You have to also keep in mind that the channel will also send the message length, before the header. And the way in which the Base24TCPChannel sends the length is not compatible with what you expect, it sends just two bytes, and if you want the same as the VTS you may want to use VAPChannel instead.

A final note, there is a way for you to see the header (but not the length bytes) in the jMeter hex dump, but it is quite hacky.

There is an old packager feature, which I learned it was there short ago, by which you can specify the header length in the packager.

It doesn't work quite expected, and that's why it's a bit hacky. If you set that length and send a message over a channel, it will send the header twice, once added by the packager and once by the channel. You need to tell the channel to use an empty header. And then tell it to override with that empty header the header of the message (because it was already added by the packager).

To do that, you just leave empty the header in the Connection Configuration, and add a custom property in the advanced configuration with name override-header and value true:

Channel config for packager handled header

And in the packager you add the headerLength attribute to the root element:

<isopackager headerLength="22">

Upvotes: 0

Related Questions