Query external host TimeOut Problem

122 views
Skip to first unread message

dannygaviria

unread,
Nov 8, 2016, 6:55:28 AM11/8/16
to jPOS Users
Good morning.

I have a problem with requests to an external server.

ISOMsg myMSG = new ISOMsg();
try {
MUX mux = (MUX) NameRegistrar.get("mux.my_mux");
ISOMsg response = mux.request(myMSG, 15000);
if (response != null) {
ISOMsg r = (ISOMsg) response.clone();
ctx.put(RESPONSE, r);
return PREPARED;
}else{
m.set("39","E4");
m.set(81,"000000");
}
} catch (Exception e) {
e.printStackTrace();
}

return ABORTED;

As you can see the timeout is 15 seconds.

The problem is this: When several requests come in and the external server gives connection problems my Q2 stays in a frozen and receives no more requests, which causes me many problems, I have to restart it to get out of that error.

Please save me, thank you.

dannygaviria

unread,
Nov 8, 2016, 6:59:53 AM11/8/16
to jPOS Users
Postscript.

Not necessarily must be connection problems, the failure is when the external server does not respond in due time.

Thanks

chhil

unread,
Nov 8, 2016, 7:07:57 AM11/8/16
to jPOS Users

Please provide
1. The timeout used when putting the request on your transaction manager space.
2. You transaction manager deploy file,  how many sessions are configured?
3. Do you have a single connection or your mux is actually a muxpool?
4. The q2 log file when problem occurs. 

-chhil


--
--
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+...@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/f1da595f-46d6-4ce6-a885-af803ef8d21a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dannygaviria

unread,
Nov 8, 2016, 7:18:42 AM11/8/16
to jPOS Users
1) ISOMsg response = mux.request(myMSG, 15000);



2) 

<txnmgr name="RecargateTxnm" class="org.jpos.transaction.TransactionManager" logger="Q2">

<property name="space" value="tspace:default" />
<property name="queue" value="MyQueue" />
<property name="sessions" value="4" />
<property name="max-active-sessions" value="128" />
<property name="debug" value="true" />
<property name="persistent-space" value="jdbm:MyTxnSpace" />
<participant class="com.jpos.QueryHost" logger="Q2">
<property name="mux" value="my_mux" />
<property name="timeout" value="25000" />
<property name="threshold" value="12000" />
<property name="reverse-on-timeout" value="false" />
</participant>
<participant class="com.jpos.SendResponse" logger="Q2" >
<property name="mux" value="my_mux" />
</participant>
</txnmgr>

3) Single connection, I did some tests with the mux-pool, but it is not implemented

4) <log realm="org.jpos.q2.iso.ChannelAdaptor" at="Mon Nov 07 18:00:43 BOT 2016.826">
  <warn>
    channel-receiver-my-receive
    <exception name="null">
    java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at org.jpos.iso.BaseChannel.readHeader(BaseChannel.java:623)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:649)
at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:302)
at java.lang.Thread.run(Unknown Source)
    </exception>
  </warn>
</log>


Thanks

chhil

unread,
Nov 8, 2016, 7:32:29 AM11/8/16
to jpos-...@googlegroups.com

ISOMsg response = mux.request(myMSG, 15000);

Thats the mux timeout, not the timeout for the entry on the txn mger space. Its when your request listener puts the message in the space with key "MyQueue"

For 4, any other warning in the log , containing text "emergency", WARNING: IN-TRANSIT TOO HIGH. If you can share your complete log somewhere would be helpful.

What is supposed to happen when you ABORT the transaction? Does your SendResponse implement AbortParticipant and respond back with a decline?

Q2 stays in a frozen

What does frozen mean? How do you determine its frozen? Do the queryhosts get called when new entries are placed on the txn mgr "MyQueue"?


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.

dannygaviria

unread,
Nov 8, 2016, 7:55:04 AM11/8/16
to jPOS Users
-- Thats the mux timeout, not the timeout for the entry on the txn mger space. Its when your request listener puts the message in the space with key "MyQueue"

 As seen, I have not defined a timeout for that configuration

-- For 4, any other warning in the log , containing text "emergency", WARNING: IN-TRANSIT TOO HIGH. If you can share your complete log somewhere would be helpful.

Thats the other warning, no more, the file is huge.
 
 
<log realm="org.jpos.q2.iso.ChannelAdaptor" at="Mon Nov 07 18:04:21 BOT 2016.195" lifespan="1ms">
  <warn>
    channel-receiver-movistar-receive
    <exception name="Read timed out">
    java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readFully(Unknown Source)
at org.jpos.iso.BaseChannel.readHeader(BaseChannel.java:623)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:649)
at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:302)
at java.lang.Thread.run(Unknown Source)
    </exception>
  </warn>
</log>

-- What is supposed to happen when you ABORT the transaction? Does your SendResponse implement AbortParticipant and respond back with a decline?

An error message is sent, that is the procedure.

--  What does frozen mean? How do you determine its frozen? Do the queryhosts get called when new entries are placed on the txn mgr "MyQueue"?
 
 
I receive many requests, I have a Q2-A which receives requests from clients, performs certain checks and passes it to another Q2-B which is responsible for sending them to the external server.

When the external server does not answer and Q2-B is receiving several requests, there comes a time when it no longer accepts Q2-A requests and stays that way indefinitely. Restarting services returns to normal.

chhil

unread,
Nov 8, 2016, 8:03:40 AM11/8/16
to jpos-...@googlegroups.com

I receive many requests, I have a Q2-A which receives requests from clients, performs certain checks and passes it to another Q2-B which is responsible for sending them to the external server.

So you have 2 instances of jpos running means there are 2 transaction managers and transaction manager A has a participant which is forwarding the request to transaction manager B.
Are th e 2 instances on the same machine or different machines?
How is the forward/transfer from Q2A to Q2B taking place?

You need to show all the configurations or the setup to avoid misdiagnosing the problem. 

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.

dannygaviria

unread,
Nov 8, 2016, 8:17:15 AM11/8/16
to jPOS Users
Q2-A and Q2-B have all their configurations, channel, mux, txm etc.

Q2-A sends to Q2-B by mux.

They run on the same machine, but they listen for different ports.

dannygaviria

unread,
Nov 8, 2016, 8:19:16 AM11/8/16
to jPOS Users
-- So you have 2 instances of jpos running means there are 2 transaction managers and transaction manager A has a participant which is forwarding the request to transaction manager B.

Yes

El martes, 8 de noviembre de 2016, 9:03:40 (UTC-4), chhil escribió:

chhil

unread,
Nov 8, 2016, 8:27:10 AM11/8/16
to jpos-...@googlegroups.com

Q2-A sends to Q2-B by mux.

 So Q2-A is client and to Q2-B is server for the connection or vice versa?
Have you tried putting a breakpoint in your listener to see if the message is being received or not?

It will basically boils down to your configuration and sooner we can see it, the quicker we can assist with fewer questions :)

-chhil

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.

dannygaviria

unread,
Nov 8, 2016, 8:37:57 AM11/8/16
to jPOS Users
Q2-a is client of Q2-B,

I send you the configuration of Q2-A, 

Yes i have a message in the listener and i see in real time the Console loggers and when the problem happen the interaction is stop.

In Q2-A i have a timeout and an abbort with code E1.

Thanks 
Reply all
Reply to author
Forward
0 new messages