javaspringiso8583multiplexingjpos

Do jpos QMUX supports limiting number of concurrent ISO request?


I updated my old spring/java application which pushes the transaction to the remote ISO server (a Bank).With classical approach (channel.seng(isoMsg)) by a synchronized method, because sending multiple ISO request through same channel makes difficult to map the request and response. Too many transactions used to stay in queue since it took 5sec for each to receive response from remote server. Due to which it reached to the point where all the up-coming transaction would timeout. To get rid of this problem I started implementing QMUX. The system is now live already.

Now my problem is, I have been told by the bank not to send the transaction if there is already 50 transaction whose response is not arrived or timeout.

So,now I need to configure the MUX framework so that once the system is waiting for 50 response the framework should stop sending and should queue at my end ,when it receives 1 response it can again send one more transaction to maintain total no of waiting response to be less than or equal to 50. How can I achieve this with jpos QMUX?


Solution

  • You can use org.jpos.iso.filter.ThroughtputControlFilter [1] at the ChannelLevel but not at the MUX level. You can pick some ideas from its implementation to handle them in your code, right before calling the MUX.

    You can use a semaphore too.

    [1] http://jpos.org/doc/javadoc/org/jpos/iso/filter/ThroughputControlFilter.html