Asynchronous Web Service Calls in Servlet Containers

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering Contradiction Analysis

1Productivity

If synchronous web service calls are used, then simplicity of implementation is maintained, but thread starvation occurs and resource efficiency deteriorates

Engineering Contradiction:
Improveresource efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #15Dynamics

2Productivity

If threads block waiting for web service responses, then request handling is simplified, but system responsiveness and productivity deteriorate

Engineering Contradiction:
Improvesystem responsivenessVSAvoidrequest handling complexity
Core Design Contradiction:
ProductivityVSEase of operation

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.

Inventive Principle:
Principle #20Continuity of useful action

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.

Inventive Principle:
Principle #23Feedback

3Speed

If multiple web service calls are made in parallel, then processing speed improves, but thread pool exhaustion and denial of service risks increase

Engineering Contradiction:
Improveprocessing speedVSAvoiddenial of service resistance
Core Design Contradiction:
SpeedVSReliability

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.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11108847B2Asynchronous web service callouts and servlet handling
Publication Date: 2021.08.31 SALESFORCE INC
  • US11108847B2 patent drawing
  • US11108847B2 patent drawing
  • US11108847B2 patent drawing

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.