-
1. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 28, 2016 5:30 AM (in response to sharkbite)Hi Daslan,
does it happen on idle outbound or inbound connection? Does it happen for idle connections in connection pool? What's value of idle-timeout-minutes attribute in connection-definitions? (this defines outbound connection)
Could those 45 minutes correspond to some TCP timeout?
Cheers,
Mirek
-
2. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 28, 2016 6:57 AM (in response to mnovak)Hi Miroslav
When I set the idle-timeout-minutes to one year, it happens once a day which leans one into thinking it is an idle timeout.
I disagree that the connection is idle, as I am sending and receiving Echo message every minute on this connection. On the 45th Minute, it closes the physical connection, irrespective if there was traffic before and after.
How do I set this to never timeout?
Thanks,
Daslan
-
3. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 28, 2016 7:22 AM (in response to sharkbite)I don't think this is related to IronJacamar/JCA in WF 10. JCA just pools managed connections which have reference to real physical connection. The physical connection is the one which gets disconnected, right? It's more likely about how the physical connection itself is created. What are the timeouts? Then it would be worth to check firewalls or proxies on the way if they do not destroy long lived TCP connections.
-
4. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 28, 2016 8:57 AM (in response to mnovak)Yes. The physical connection gets disconnected. No timeouts are defined. There are no firewalls or proxies on the way that destroy long lived TCP connections.
-
5. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 28, 2016 9:32 AM (in response to sharkbite)Could you make some tests with just the SocketConnector and TCPManager? Take them to simple java project and just try to create connection as resource adapter does. Let's check what happens. If it disconnects in the same way then it's not WF10 related.
-
6. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 28, 2016 9:44 AM (in response to sharkbite)Here is my wire shark trace - https://drive.google.com/open?id=0Bx_7eiy_kFj7U2pvX3RxN2xiZTQ
10.0.0.0 represents us the client and 172.31.255.255 represents who we are connecting to.
-
7. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 28, 2016 9:45 AM (in response to mnovak)Do you have any examples I can look at to do this, so I can get some idea of how to do this?
-
8. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 28, 2016 10:15 AM (in response to sharkbite)Looking at wire shark trace, TCP connection was properly closed. Close was initiated by the other side (by 172.31.255.255) which send FIN packet first. It on line:
1044 11492.948839 172.31.255.255 10.0.0.0 TCP 66 39862 → 13035 [FIN, ACK] Seq=1707 Ack=1718 Win=15744 Len=0 TSval=1720204726 TSecr=30890771
I think we should focus on whatever is behind 172.31.255.255 and also on the way.
-
9. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 28, 2016 10:54 AM (in response to mnovak)My apologies 172.31.255.255 is us the client and 10.0.0.0 is who we are connecting to?
So 172.31.255.255 is where WildFly is running and has SocketConnector deployed on it.
-
10. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 29, 2016 2:00 AM (in response to sharkbite)No problem. Let's return to original proposal. Could you create small Java project in which you would use SocketConnector to create connection? The point is to check if connection is disconnected as well. It will help to check if the problem is in SocketConnector or in WF10.
-
11. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 29, 2016 2:36 AM (in response to sharkbite)Hi
thank you for your feedback and effort to help
do you hace examples to point me in Right direction
socketconnect is a ra. If I use this with arquillan then I will be using wf under the hohod.
THat at wil not eliminate wf is not the problem
so I will have to do something with using the rat?
IF I
-
12. Re: JCA on WF 10: TCP IP closes every 45 mins
mnovak Jul 29, 2016 2:45 AM (in response to sharkbite)I have no such project which you could use as an example. The idea is to take classes responsible for creating connection from rar which you're implementing and use them in simple java project to create connection. There would be no WF10 used and thus no need for Arquillian. It's just about copy-pasting classes from rar to java project and creating physical connection in the way as rar is doing.
-
13. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Jul 29, 2016 8:42 AM (in response to mnovak)Ok now I understand what you mean. I will work on this
-
14. Re: JCA on WF 10: TCP IP closes every 45 mins
sharkbite Aug 3, 2016 8:03 AM (in response to mnovak)Hi Miroslav
I been try to get my ahead around what code to write and test.
I am hoping you can point me in the right direction.
P.S: I do not want you to write the code for me. Just your advise and opinion.
My customised version of SocketConnector can be found at: https://drive.google.com/open?id=0Bx_7eiy_kFj7a0VTdElUamkwLWc
The code of how I am using SocketConnector(project called processor) can be found at: https://drive.google.com/open?id=0Bx_7eiy_kFj7a1UyU1FNcjZUUEk
A full picture and explanation can be found at https://bitbucket.org/__jtalk/socketconnector/issues/5/socketconnector-timing-out-after-every
See my last comment
To answer your question on "It's just about copy-pasting classes from rar to java project and creating physical connection in the way as rar".
The creation of the physical connection is done in processor not in the SocketConnector Project :
za.co.fnds.processor.iso.queue.SocketConnector.java lines 124-169 it looks something like
try { byte[] singOnMessage = fndsIsoProcessorBean.generateSignOn(apiChannel); // network Id InetSocketAddress local = new InetSocketAddress(apiClient.getServerIP(), apiClient.getServerPort()); log.debug("Created local socket"); // localhsot InetSocketAddress socketAddress = new InetSocketAddress(apiClient.getClientIP(), apiClient.getClientPort()); try (TCPConnection listening = getFactory().listen(UUID, local)) { log.debug("Created listening"); this.listeningId = listening.getId(); try (TCPConnection connection1 = getFactory().createConnection(UUID, socketAddress)) { log.debug("Created connection1"); this.clientId = connection1.getId(); try (TCPConnection connection2 = getFactory().getConnection(UUID, connection1.getId())) { log.debug("Connections established"); log.debug("Connection1 Id: " + connection1.getId()); log.debug("Connection2 Id: " + connection2.getId()); log.debug("sending message(sign-on): " + StringUtils.byteArrayToHexString(singOnMessage)); connection2.send(ByteBuffer.wrap(singOnMessage)); } catch (Exception ex) { ex.printStackTrace(); // notify IT Support notifyItSupport(); connection1.disconnect(); } } catch (Exception ex) { ex.printStackTrace(); // notify IT Support notifyItSupport(); listening.disconnect(); } } log.debug("init ApiChannel:" + apiChannel.name() + " Done!"); } catch (Exception e) { // e.printStackTrace(); // throw new EJBException("Exception on connection creation", // e); log.debug("Exception on connection creation!"); } } else { log.debug("No apiClient for " + apiChannel.name()); } }
Is this what I should use in my test class or is there something else, I should be using?
Thanks,
Daslan