1

I have a jpos implementation that sends and receives iso messages. It first requires sign-on before anything else. As a client, i am able to send request (customized.xml packager) and also receive response successfully with no issue.

However, when the other party sends request to me, the same packager (customized.xml packager) is unable to unpack the request received.

To try to resolve issue with incoming request, i decided to create a new customized packager (customized2.xml) but i noticed all incoming request are still referring to the old packager (customized.xml). How do i handle this or what's the best practise to go about it.

My configurations:

10_mychannel.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <channel-adaptor name="mychannel-channel" logger="Q2">
       <channel class="org.jpos.iso.channel.ASCIIChannel" type="client" connect="yes" logger="Q2" realm="post-channel" packager="org.jpos.iso.packager.GenericPackager">
          <property name="packager-config" value="cfg/customized.xml" />
          <property name="packager-logger" value="Q2" />
          <property name="packager-realm" value="custom-packager" />
          <property name="host" value="14.101.333.111" />
          <property name="port" value="7777" />
          <property name="length-digits" value="6" />
          <property name="connection-timeout" value="30000" />
          <property name="timeout" value="300000" />
       </channel>
       <in>my-channel-send</in>
      <out>my-channel-receive</out>
       <reconnect-delay>10000</reconnect-delay>
       <keep-alive>yes</keep-alive>
    </channel-adaptor>

20_my_mux.xml

    <mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="my-mux">
    <in>my-channel-receive</in>
    <out>my-channel-send</out>
    <ready>my-channel.ready</ready>
    </mux>

21_my_q_beans.xml

    <qbean name='LogonManager' class='com.my.processor.LogonManager' />

50_my_server.xml

    <server class="org.jpos.q2.iso.QServer" logger="Q2" name="xml-server-7777" realm="xml-server-7777">
      <attr name="port" type="java.lang.Integer">7777</attr>
      <channel class="org.jpos.iso.channel.ASCIIChannel" packager="org.jpos.iso.packager.GenericPackager" type="server" logger="Q2" realm="xml-server-7777">
      <property name="packager-config" value="cfg/customized2.xml" />
      <property name="timeout" value="180000"/>
      </channel>
      <request-listener class="com.my.processor.myListener" logger="Q2" realm="incoming-request-listener" />
    </server>

incoming sample request

    public class myListener implements ISORequestListener{

        private static final String FTREQUEST = "1200";
        private static final String REVADVICE = "1420";
        private static final String NETWORKREQ = "1804";

        Log log1;

        @Override
        public boolean process(ISOSource source, ISOMsg m) {
            System.out.println("::::: Waiting :::::");
            log.info("::::: Inside  Listener :::::");
            try {
                String mti = m.getMTI();
                System.out.println("mti ::: " + mti);
                log.info("mti ::: " + mti);
                switch (mti) {
                    case FTREQUEST:
                        log.info("Inside Financial Transaction Request");
                        //implementation here 

                        m.setMTI("1210");
                        m.set(2, m.getString(2));
                        m.set(3, m.getString(3));
                        m.set(4, m.getString(4));
                        m.set(11, m.getString(11));
                        m.set(12, m.getString(12));
                        m.set(39, "100");
                        source.send(m);

                        break;
                    case REVADVICE:
                        log.info("Reversal Advice");
                        break;
                    case NETWORKREQ:
                        log.info("Network Management Request");
                        break;
                }

            } catch (Exception ex) {
                ex.printStackTrace(System.out);
            }
            return true;
        }
    }
Daniel Ameyaw
  • 83
  • 1
  • 10
  • I don't think XMLChannel works with GenericPackager. Perhaps you want to use ASCIIChannel on that server too. – apr Oct 20 '20 at 13:07
  • thanks apr. Hello Andres,  Thanks for the support and time.I have updated the generic packager from XMLChannel to ASCIIChannel as advised. I have also added the logger to the packager and also corrected some fields which needed to be fixed.I have asked the 3rd Party to initiate a new request. I will revert with status of the outcome. – Daniel Ameyaw Oct 21 '20 at 00:51
  • I got the 3rd Party to send in a new request. I can now see the incoming ISO request after enabling the logger property but unfortunately my listener class is not picking the message for processing. i have updated my channel and server xml as advised. – Daniel Ameyaw Oct 21 '20 at 21:30

0 Answers0