Need a support in configuring MUX

37 views
Skip to first unread message

Titus Rakkesh

unread,
Feb 16, 2017, 4:46:04 AM2/16/17
to jpos-...@googlegroups.com
Hi all,
      We are developing an application using jPos library. We have implemented an ISOServer code and ISORequestListener code like below. It is working fine when requests come sequentially. But when multiple requests come concurrently the requests are waiting for the other requests to finish processing. Simply saying one by one only requests are getting processed. So my worry is how this ThreadPool get utilized? Only 1 Active Thread at a time. How we can solve? Our client make a single connection and keep that connectivity sending heart beats. They send txn requests also.

1. Will it possible make to every new ISO request to be assigned a thread from the the ThreadPool?
2. Will MUX helps us to solve the problem?

The following way only we defined the server and listener.

ISOServer

              Logger loggerJpos = new Logger();
            //logger.addListener(new SimpleLogListener(System.out));
           
          
            loggerJpos.addListener(new SimpleLogListener(new PrintStream(new FileOutputStream(logFile, true))));
           
            ServerChannel channel = new PostChannel(new    GenericPackager(AppConst.getInstance().geXXXXISOPackager()));
            ((LogSource) channel).setLogger(loggerJpos, "channel");
            int port = Integer.parseInt(AppConst.getInstance().getXXXXXISOPort());
            threadPool = new ThreadPool(100, 200);
            ISOServer server = new ISOServer(port, channel, threadPool);
            server.setLogger(loggerJpos, "server");
            server.addISORequestListener(new XXXISOServer());
            new Thread(server).start();

ISORequest listener

public interface XXXXISORequestListener {
    public boolean process(ISOSource source, ISOMsg m);
}

Thanks,
Titus

Mark Salter

unread,
Feb 16, 2017, 7:00:54 PM2/16/17
to jpos-...@googlegroups.com
On 16/02/17 09:46, Titus Rakkesh wrote:
> 1. Will it possible make to every new ISO request to be assigned a
> thread from the the ThreadPool?
You can let the MUX do it's job - remeber to configure the matching
criteria if 11 and 41 are not good enough for your request/response
matching.
> 2. Will MUX helps us to solve the problem?
I don't see you have described a problem, but a MUX or (QMUX) will allow
you to have multiple transactions in flight.
Q2 or jpos-ee are your friends, as is the Programmer's guide.

--
Mark
Reply all
Reply to author
Forward
0 new messages