Can't connect to remote host via Channel Adaptor

75 views
Skip to first unread message

Jean

unread,
Sep 15, 2022, 8:56:44 PM9/15/22
to jPOS Users
i setup a gateway based on the jpos gateway tutorial (http://jpos.org/doc/tutorials/jpos-gateway.pdf).

here is my 10_channel.xml:
<channel-adaptor name='jpos-channel' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
<channel class="org.jpos.iso.channel.NCCChannel"
packager="org.jpos.iso.packager.ISO87BPackager"
header="6000190002">
     <property name="host" value="123.164.14.90" />
     <property name="port" value="11000" />
</channel>
<in>jpos-send</in>
<out>jpos-receive</out>
<reconnect-delay>10000</reconnect-delay>
</channel-adaptor>

But, i can't connect to the remote and the log is as following:
<log realm="org.jpos.transaction.TransactionManager" at="2022-09-15T23:38:22.175426" lifespan="1010ms">
  <abort>
    txnmgr-1:idle:1
    <context>
      TIMESTAMP: Thu Sep 15 23:38:21 ICT 2022
      SOURCE: org.jpos.iso.channel.NCCChannel@66b2e14d
      REQUEST:
       <isomsg direction="incoming">
         <!-- org.jpos.iso.packager.ISO87BPackager -->
         <header>6000190002</header>
         <field id="0" value="0800"/>
         <field id="3" value="900000"/>
         <field id="11" value="000043"/>
         <field id="12" value="144042"/>
         <field id="13" value="0315"/>
         <field id="24" value="019"/>
         <field id="41" value="00000122"/>
         <field id="42" value="000000080210002"/>
       </isomsg>
     
      DESTINATION: jPOS-AUTORESPONDER
      RESULT:
       <result>
         <fail>
           [HOST_UNREACHABLE] o.j.t.p.QueryHost.prepare:98 'mux.jPOS-AUTORESPONDER' is not connected
         </fail>
       </result>
     
      LOGEVT:
        <info>
          RESPONSE not present
        </info>
     
    </context>
            prepare: o.j.t.p.QueryHost ABORTED READONLY NO_JOIN
    prepareForAbort: o.j.t.p.SendResponse
              abort: o.j.t.p.SendResponse
     in-transit=0/0, head=2, tail=2, paused=0, outstanding=0, active-sessions=2/128, tps=0, peak=0, avg=0.00, elapsed=1009ms
    <profiler>
      prepare: o.j.t.p.QueryHost [1008.6/1008.6]
      prepareForAbort: o.j.t.p.SendResponse [0.5/1009.1]
        abort: o.j.t.p.SendResponse [0.4/1009.6]
      end [2.8/1012.4]
    </profiler>
  </abort>
</log>

But when I change the host Ip to a NCCC stimulation server on localhost or when i send the message direct to the "remote host" via jPos Channel (the code is below) , everything works fine and i receice the response from remote host.

I wonder what i'm wrong in config the 10_channel.xml, 
Pls help me

Alejandro Revilla

unread,
Sep 15, 2022, 8:59:53 PM9/15/22
to jpos-...@googlegroups.com
Do you have access to 123.164.14.90:11000 ?

Have you tried a simple 'telnet 123.164.14.90 11000' ?

Jean

unread,
Sep 15, 2022, 11:17:36 PM9/15/22
to jPOS Users
i did. i  have the response when i call it directly with the client app as following: 

public static void main(String[] args) throws IOException, ISOException {

ISO87BPackager packager = new ISO87BPackager();

String hostName = "123.164.14.90:11000";
int portNumber = 11000;
NCCChannel channel = new NCCChannel(hostName, portNumber, packager,ISOUtil.hex2byte("6000190002"));

channel.setTimeout(30000);


Date now = new Date();
ISOMsg m = new ISOMsg();

m.setMTI("0800");

m.set("3", "900000");
m.set("11", "000043");
m.set("12", "144042");
m.set("13","0315");
m.set("24","019");
m.set("41","00000122");
m.set("42","000000080210002");
m.recalcBitMap();


logISOMsg(m);

channel.connect();
channel.send(m);

ISOMsg response = channel.receive();
System.out.println("********** Response***********");
logISOMsg(response);

}

private static void logISOMsg(ISOMsg msg) {
System.out.println("----ISO MESSAGE to Pack-----");
try {
System.out.println(" MTI : " + msg.getMTI());
for (int i = 0; i <= msg.getMaxField(); i++) {
if (msg.hasField(i)) {
System.out.println(" Field-" + i + " : " + msg.getString(i));
}
}
} catch (ISOException e) {
e.printStackTrace();
} finally {
System.out.println("--------------------");
}
}

Mark Salter

unread,
Sep 16, 2022, 1:55:03 AM9/16/22
to jpos-...@googlegroups.com
No header, different String for host.

I suggest you ask the targe what they see in each case or trace your side of the network and see what is and what isnt leaving your machine and compare.

--
Mark


Sent from ProtonMail mobile



-------- Original Message --------
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/5b73884e-ebb0-43ad-9394-903034f514b0n%40googlegroups.com.
signature.asc

Jean

unread,
Oct 12, 2022, 9:48:59 PM10/12/22
to jPOS Users
Thank you for supporting me. 
i found the problem. That because the bank didn't return the STAN for logon message so jpos couldn;t mapping the request and response message.
And we tried to mapping by another field like Terminal ID , and everything worked perfectly
Reply all
Reply to author
Forward
0 new messages