I have setup ISO Server using q2 module.
There are transactions that take too long to process.
The time consuming transactions block the channel till when finished.
I have put this in my server config file this:
<server name="z4-server-PostBridge" class="org.jpos.q2.iso.QServer"
logger="Q2">
<attr name="port" type="java.lang.Integer">6002</attr>
<channel name="post.channel"
class="org.jpos.iso.channel.PostChannel"
packager="org.jpos.iso.packager.PostPackager" logger="Q2">
<attr name="minSessions" type="java.lang.Integer">1</attr>
<attr name="maxSessions" type="java.lang.Integer">20</attr>
</channel>
<request-listener class="Postilion" logger="Q2">
.
.
.
.
</request-listener>
</server>
to setup thread pool, I tried this in the config:
<attr name="minSessions" type="java.lang.Integer">1</attr>
<attr name="maxSessions" type="java.lang.Integer">20</attr>
I need your advice, thanks
Zab
I thought q2 creates a new instance of the ISORequestListener class
every time a request comes.
zab
> Alwyn Schoeman- Hide quoted text -- Show quoted text -
Then, look at this:
My request-listener class does processing in this manner -
public boolean process (ISOSource source, ISOMsg m) {
......
if(message[0].equalsIgnoreCase("0200"))
{
//database call here
m.setResponseMTI();
m.set (new ISOField(39, /* set here return code*/));
// more filed settups ...
source.send(m);
}
}
is there another way I can process incoming messages outside this call
back method process?
or what is my design problem here?
Thanks.
On Oct 24, 5:24 pm, "Alwyn Schoeman" <alwyn.schoe...@gmail.com> wrote:
> AFAIK it doesn't, and even if it did (which it doesn't), it will only happen
> once your previous requestlistener is finished processing or if you handed
> the previous request listener to another thread for processing.
>
On Oct 24, 8:10 pm, "Alwyn Schoeman" <alwyn.schoe...@gmail.com> wrote:
> I would say that your database call is taking too much time. From
> experience I have found that database calls, especially over a network, can
> have a significant range of response times. If each call includes a
> connect, then you can be sure it will take a long time (possibly seconds).
>
> As Alejandro said you could either use something similar to the Connector
> (which I either haven't used yet, or too long ago) or you can use your own
> threadpool inside the ISORequestListener.
>
> For the last one you would create a class implementing Runnable or Callable
> and execute your class on a Threadpool within ISORequestListener.
>
--
--
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/4fb95559-c685-4142-a470-e8a70661cf93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.