Asynchronous Web Service Calls in Servlet Containers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In systems making web service calls, thread starvation occurs due to blocked threads waiting for responses, leading to inefficient resource use and potential denial-of-service vulnerabilities, especially when dealing with large amounts of data across different environments.
Innovation Solution
Implementing asynchronous web service calls using an asynchronous client and a servlet container that supports non-blocking requests, allowing threads to return to the pool without waiting for responses, and utilizing continuation objects to manage state and handle responses asynchronously.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If synchronous web service calls are used, then simplicity of implementation is maintained, but thread starvation occurs and resource efficiency deteriorates
Solution Approach 1:
The patent introduces an intermediary mechanism (asynchronous client wrapper and servlet filter) that sits between the web service call and the thread pool. This intermediary manages the asynchronous call lifecycle, allowing threads to be released immediately while the call progresses in the background, thus resolving the thread starvation problem without requiring fundamental changes to the underlying web service infrastructure.
Solution Approach 2:
The system dynamically transitions from static synchronous blocking to dynamic asynchronous processing. Threads are no longer statically bound to waiting for web service responses; instead, they are dynamically released back to the pool while the actual data retrieval continues through asynchronous callbacks and continuation objects, optimizing resource utilization.
2Productivity
If threads block waiting for web service responses, then request handling is simplified, but system responsiveness and productivity deteriorate
Solution Approach 1:
The patent ensures continuous useful action by preventing threads from idling during web service calls. Instead of blocking, threads immediately return to the pool for other tasks while the asynchronous mechanism continues the data retrieval operation in the background, maintaining continuous productive work across the system.
Solution Approach 2:
The asynchronous callback mechanism provides feedback loops where completion of web service calls triggers automatic processing of results. This feedback system handles the complexity of asynchronous coordination, allowing simple thread release while ensuring proper response handling through automated callbacks and continuation objects.
3Speed
If multiple web service calls are made in parallel, then processing speed improves, but thread pool exhaustion and denial of service risks increase
Solution Approach 1:
The patent uses continuation objects as lightweight copies that represent pending web service calls. Instead of requiring actual thread instances for each parallel call, the system creates continuation objects that can be managed independently, allowing multiple parallel operations without proportionally increasing thread pool consumption and reducing denial of service vulnerability.
Data Source
AI summary
Techniques and mechanisms for providing asynchronous web service calls in an on-demand services environment. In response to request from a remote client, a page is provided. The page has content including logic to retrieve information from a remote resource external to an on-demand services environment via at least one asynchronous web service call. A controller component of the page is loaded before rendering a response to the remote computing device. At least one web service call is sent to the remote resource with the controller component. A continuation object is returned with the controller component to release the first thread from waiting for a response to the web service call. The continuation object provides a label to be used when handling the response. The response to the web service call is received from the remote resource and processing is resumed with the continuation object.


