+

Search Tips   |   Advanced Search

Asynchronous request dispatcher

Asynchronous request dispatcher (ARD) can improve servlet, portlet, and JSP response time when slow operations can be logically separated and performed concurrently with other operations required to complete the response. ARD enables servlet programmers to perform javax.servlet.RequestDispatcher include calls for the same request concurrently on separate threads. These calls are completed sequentially on the same thread. ARD is also useful in low CPU, long wait situations like waiting for a database connection.

If there are large CPU or memory requirements, ARD alone does not alleviate those issues. However, in combination with the remote request dispatcher, operations driven by one servlet request that can be performed concurrently on multiple application servers, alleviating resource demand on a single server and decreasing the risk of a system down situation.

ARD extends the Java Servlet Specification, which only describes synchronous request dispatching. ARD requires a new channel, called the ARD channel, between the HTTP and web container channels to form a new channel chain. These new chains correspond only to the existing default host chains and reuse the same ports.

Each include can write output to the client and because ordering is important for valid results, there must be some aggregation of the data written. Typically, a servlet writes data to a buffer and once full, it is flushed to client. For server-side aggregation, the ARD channel cannot flush until any includes that had placeholders written to the current buffer are finished.

Client-side aggregation automatically adds JavaScript to dynamically update the page. For non-JavaScript clients, we can switch ARD to server-side aggregation, which gives equivalent results. We can deny non-JavaScript clients when using client-side aggregation.

ARD uses the web container APIs to plug in request dispatching logic, interacting with WebSphere Common Configuration Model (WCCM) to read in configuration information for enablement status per enterprise application as well as a global appserver setting. We can use the console and wsadmin to enable or disable ARD.


Subtopics


Related tasks

  • Develop servlet applications using asynchronous request dispatcher
  • Asynchronous request dispatcher application design considerations