0

This is a scenario where the another system takes time to send the response back. in this case I would like jpos to wait for for 40/45 secs before it could timeout.

below is the serious of log events:

Request send to jpos :

<log realm="channel/127.0.0.1:49142" at="2020-05-21T01:15:54.901" lifespan="1ms">

Jpos send out the message :

<log realm="channel/127.0.0.1:6269" a**t="2020-05-21T01:15:54.909"** lifespan="2ms">

but the channel timedout at 20 secs , the client requested the transaction is disconnected

<log realm="org.jpos.q2.iso.ChannelAdaptor" at="2020-05-21T01:16:19.593">
  <warn>
    channel-receiver-MIG_NT2_EP6-receive
    Read timeout / EOF - reconnecting
  </warn>
</log>

response received time is

<log realm="channel/127.0.0.1:6269" at="2020-05-21T01:16:32.610" lifespan="37771ms">

my channel is as below

<?xml version="1.0" ?>

<channel-adaptor name='MIG_NT2_EP6-channel' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
    <channel class="org.jpos.iso.channel.NACChannel"
             packager="org.jpos.iso.packager.GenericPackager"
             logger="Q2"
             header="6000000000"
             >
         <property name="packager-config"  value="cfg/packager/AS280501.xml" debug="True" />

        <property name="host" value="127.0.0.1" />
        <property name="port" value="6336" />
        <property name="timeout" value="180000"/>
    </channel>
    <in>MIG_NT2_EP6-send</in>
    <out>MIG_NT2_EP6-receive</out>
    <reconnect-delay>10000</reconnect-delay>
</channel-adaptor>

my mux

<?xml version="1.0" ?>

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

txn manager

<txnmgr name="mpgs" class="org.jpos.transaction.TransactionManager" logger="Q2">
    <property name="queue" value="MIG_NT2_EP6-TXNMGR"/>
    <property name="sessions" value="2"/>
    <property name="max-sessions" value="128"/>
    <property name="debug" value="true"/>

    <participant class="org.jpos.transaction.participant.QueryHost"/>
    <participant class="org.jpos.transaction.participant.SendResponse"/>
</txnmgr>

server

<server class="org.jpos.q2.iso.QServer" logger="Q2" name="MIG_NT2_EP6-server-7336" realm="MIG_NT2_EP6-server-7336">
    <attr name="port" type="java.lang.Integer">7336</attr>
    <channel class="org.jpos.iso.channel.NACChannel"
             packager="org.jpos.iso.packager.GenericPackager"
             type="server"
             logger="Q2"
         header="6000000000"
             >
     <property name="packager-config"  value="cfg/packager/CISascii.xml" debug="True" />
        <property name="timeout" value="180000"/>
    </channel>
    <request-listener class="org.jpos.iso.IncomingListener" logger="Q2" realm="incoming-request-listener">
        <property name="queue"  value="MIG_NT2_EP6-TXNMGR" />
        <property name="ctx.DESTINATION"  value="MIG_NT2_EP6-AUTORESPONDER" />
    </request-listener>
</server>

How can i increase the wait time to 40 secs so to handle the late arrived message

thanks in advance

1 Answers1

1

The timeout you are receiving is not due to the timeout of the transaction but because of the timeout of the channel.

You have your channel with a timeout of 180 secs i.e. 3 minutes, so if no incoming traffic comes during 3 consecutive minutes, independent of the start of a transaction, the underlying socket will disconnect and that's what you are seeing here:

<log realm="org.jpos.q2.iso.ChannelAdaptor" at="2020-05-21T01:16:19.593">
  <warn>
    channel-receiver-MIG_NT2_EP6-receive
    Read timeout / EOF - reconnecting
  </warn>
</log>

If you don't have echo interchanges or you are testing I would disable that timeout to a long number or to 0 to disable it (just for testing, you don't want that in prod) you want that in prod but you need to ensure traffic by having echo messages at intervals lower than the channel timeout.

So the short answer would be, increase that timeout and the other timeout involved is hidden, it's the timeout in QueryHost which defaults to 30 secs.

If the response is expected to take less than a minute to arrive, you can configure a minute timeout as follows in your transaction manager:

<txnmgr name="mpgs" class="org.jpos.transaction.TransactionManager" logger="Q2">
    <property name="queue" value="MIG_NT2_EP6-TXNMGR"/>
    <property name="sessions" value="2"/>
    <property name="max-sessions" value="128"/>
    <property name="debug" value="true"/>

    <participant class="org.jpos.transaction.participant.QueryHost">
        <property name="timeout" value="60000"/>
    </participant>
    <participant class="org.jpos.transaction.participant.SendResponse"/>
</txnmgr>
Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21