I am connecting to a host using the config below, which has the timeout property too.
Now my question is why do I again need to pass the timeout param to QMUX.request(msg, timeout) ?
my understanding is that, the purpose of <property name="timeout" value="60000"/> and timeout param of QMUX.request(msg,timeout) method same. please correct me if I am wrong.
<channel-adaptor name="my-channel-adaptor"
class="org.jpos.q2.iso.ChannelAdaptor"
logger="Q2"
realm="my-channel-realm"
pool-size="50"
thread-pool-size="10">
<channel class="org.jpos.iso.channel.ASCIIChannel"
packager="org.jpos.iso.packager.GenericPackager">
<property name="host" value="localhost"/>
<property name="port" value="65000"/>
<property name="timeout" value="60000"/>
<property name="maxPacketLength" value="4096"/>
<property name="header" value="600"/>
<property name="lengthHeader" value="2"/>
<property name="keepAlive" value="true"/>
</channel>
</channel-adaptor>
I don't think so.
The former results in
setSOTimeoutbeing called on eachSocketas it is connected. According to the javadoc, setting anSO_Timeouthas the following effect:In other words, this is a transport level timeout. I haven't researched what happens when
SocketTimeoutExceptionis raised, but I imagine that the channel will be marked as failed ... in some way.The latter is a timeout for the specific request. It is an application protocol timeout. When it occurs, it looks like the
request(...)call returnsnull. The channel will still be alive.If you pass zero as the timeout, there is no request level timeout. The
requestcall will wait indefinitely for the response.That is something you would need to ask the
org.jposdesigners.