On Hapi-base 2.5.1
When using ca.uhn.hl7v2.DefaultHapiContext.newClient(), it ends up creating a Socket that is not using a connection timeout:
at ca.uhn.hl7v2.app.ConnectionFactory.createSocket(ConnectionFactory.java:77)
at ca.uhn.hl7v2.app.ConnectionFactory.openEagerly(ConnectionFactory.java:53)
at ca.uhn.hl7v2.app.ConnectionFactory.open(ConnectionFactory.java:44)
at ca.uhn.hl7v2.app.ConnectionHub$1.open(ConnectionHub.java:99)
at ca.uhn.hl7v2.app.ConnectionHub$1.open(ConnectionHub.java:85)
at ca.uhn.hl7v2.app.ConnectionHub$CountingMap.put(ConnectionHub.java:489)
at ca.uhn.hl7v2.app.ConnectionHub.attach(ConnectionHub.java:121)
at ca.uhn.hl7v2.app.ConnectionHub.attach(ConnectionHub.java:260)
at ca.uhn.hl7v2.DefaultHapiContext.newClient(DefaultHapiContext.java:335)
It would be great to be able to configure it somehow, easily.
as Socket has a connect() method on which we can pass a connection timeout.
May be it could be added in ca.uhn.hl7v2.util.SocketFactory and used with the appropriate Socket.connect()?
If you add a timeout to the ConnectionData, you could configure it when building the ConnectionHub. That is passed all the way down to the ConnectionFactory.
On Hapi-base 2.5.1 When using ca.uhn.hl7v2.DefaultHapiContext.newClient(), it ends up creating a Socket that is not using a connection timeout:
It would be great to be able to configure it somehow, easily.
as Socket has a connect() method on which we can pass a connection timeout. May be it could be added in ca.uhn.hl7v2.util.SocketFactory and used with the appropriate Socket.connect()?
Was found with
Culprit code on master: https://github.com/hapifhir/hapi-hl7v2/blob/master/hapi-base/src/main/java/ca/uhn/hl7v2/app/ConnectionFactory.java
Thanks!