Printing actual thread pool active connections to the log

19 views
Skip to first unread message

Titus Rakkesh

unread,
Jan 31, 2017, 6:48:28 AM1/31/17
to jpos-...@googlegroups.com
Dear Friends,
      We are using JPos for one of our project. We are using

ISOServer server = new ISOServer(port, channel, new ThreadPool(10, 100));
server.addISORequestListener(new OurISOServer());
new Thread(server).start();

and implementing our txn flow in the following method,

public boolean process(ISOSource source, ISOMsg m) {
        long initTime = System.currentTimeMillis();
        String messageMTI = null;
        ISOMsg request = null;
        try {
            request = (ISOMsg) m.clone();
            messageMTI = request.getMTI();
            if (messageMTI.equals("0800")) {
-------
------
------
------
}


How we can print the current Active Thread Pool Connections available in the log, before each transaction?

Thanks,
Rakkesh

Andrés Alcarraz

unread,
Jan 31, 2017, 9:13:58 AM1/31/17
to jPOS Users
Since you are manually creating the components instead of using Q2 nothing prevents you to set the ThreadPool as an attribute to your ISORequestListener.

A no elegant at all solution in your environment would be to set the ThreadPool as a field of your RequestListener and use the method getActiveCount().



Andrés Alcarraz

--
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CABm7V63%3DhXEcX-13pxstudUJAu_EfKx4pq3yhAvn_abd%2BXqSeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages