Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Handling timeouts and identifying connectivity issues

DZone's Guide to

Handling timeouts and identifying connectivity issues

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

Handling timeouts is one of those tasks that people generally leave to the last moment. In an ideal world, we'd never need them. Now a days, a typical application will have remote calls to other systems via Web services (e.g. SOAP or RESTful), RMI, etc, hence timeout handling is critical. Badly behaved clients may go offline and leaving server threads locked, or overloaded servers may stall, causing a network client to block indefinitely for input. You could also have intermittent issues due to proxy server or load balancer timeouts or connection leaks. For these reasons, it is necessary to detect and handle network timeouts.

Your application might not be coded with appropriate connection retries or appropriate time out values. You could simulate connectivity issues by creating SSH tunnels to the actual destination server. For example, your application may have connectivity to a Vignette ServerB running on port 9111. To simulate connectivity issues, you may create a local SSH tunnel to a UNIX ServerA, which connects to Vignette application running on ServerB:9111. Once you log on to ServerA via PutTTY (i.e. a UNIX client on Windows) as shown below, a tunnel will be opened to ServerB:9111. Any calls to localhost:4000 will be forwarded to  ServerB:9111 via ServerA. In your application, you could use the localhost:4000 instead of using ServerB:9111 to connect to the Vignette application. This will enable you to simulate the scenario of ServerB being down by just destroying the tunnel, and not the actual server, which might be used by others. By destroying the tunnel, you could   improve your application code to graciously handle connectivity issues.

 

 

http://java-success.blogspot.com 

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}