Search code examples
iso8583jpos

How can I print an iso8583 message using jPOS?


I want to print an ISO message 8583 using the jPOS library so that it should appears in the log as:

"1200f230074128e28a1d0000000000000020164323287974279866000000000000000253082109060900003922082109060737313031303137313133333400022000739906001504343433323332383739373432373938363644323430363230313136343737343631304630303030303030303030333631303030303030303030313530343030313131323320201239353137353338353231353900103036494e4d41564330303530342633333030303031323031333946463030303030303336333033390511303639363946314130323036383239463338304339463636303439463032303639463337303435463241303242463043303839463541303536303036383230363832394633363032303042433946333730343939394444323441354633343031303238463031323839463132304136443631363436313230343436353632363937343946313031373036303131313033413030303030304630343030303030303030303030303030303030303030443443324133434539463332303130333930423036363339463039343441393039373146413639384343383136364338463930413535463245323845393835443536423132363943364338303636313632343536353541434431303937384439324646353345303031464434303036393731344633423841323537323432344434463642444136324439383544443339413637414130443845444634303139394239454330304231343544373139464632333239384335393834423333364334444130423739364636464136363632364437364639363337394630413332443743343038383636303231313735424645324131413333384535443542343036313742454331323034333041333939313137313439364633443530334536314139384345373542323931393831463645443137394644374142373932443831413036343537443435303746394643344545390029323032322d30382d32312030392f30362f303720474d542b30332f3030003633633830623434622d303731382d343538322d393237312d3164633732343238656538640115303131303230303330303030303030343130353130374e3234343032304534363432323330393031303030303030303030303131303030303030303030313231323038393530303731333030303030303030303134303030303030303030303030313530363030313031363031303230323032453545313036383446464646464646460006313230313339"

I have tried ISOUtil.hexdump() but it prints the message in hexdump format

byte[] data1 = reqIsoMsg.pack();
logger.info("the message : {}",ISOUtil.hexdump(data1));

Solution

  • I believe ISOUtil.hexString is what you want:

    byte[] data1 = reqIsoMsg.pack();
    logger.info("the message : {}", ISOUtil.hexString(data1));