Develop servlet applications using asynchronous request dispatcher
Web modules can dispatch requests concurrently on separate threads. Requests can be dispatched by the server or client.
For additional information about the AsyncRequestDispatcherConfig and the AsyncRequestDispatcher interfaces, review the com.ibm.websphere.webcontainer.async package in the API documentation. The generated API documentation is available in the information center table of contents from the path Reference > APIs - Application Programming Interfaces.
Review the asynchronous request dispatcher application (ARD) design considerations topic before completing the following steps.
Concurrent dispatching can improve servlet response time. If operations are dependant on each other, do not enable asynchronous request dispatching, therefore, select Disabled. Concurrent dispatching might result in errors when operations are dependant. Select Server side to enable the server to aggregate requests dispatched concurrently. Select Client side to enable the client to aggregate requests dispatched concurrently.
Tasks
- Logically separate resource intensive operations.
- Develop servlets that use an asynchronous request dispatcher to include these operations.
- Enable asynchronous request dispatching on an application server.
- Deploy the application in an application server that has asynchronous request dispatching enabled.
- Select an aggregation type for the application that needs ARD.
- Optional: Configure the AsyncRequestDispatcherWorkManager work manager used for the request dispatch threads.
- Restart the application server.
What to do next
Restart the modified applications if already installed or start newly installed applications to enable ARD on each application.
Subtopics
- Asynchronous request dispatcher
Asynchronous request dispatcher (ARD) can improve Servlet response time when slow operations can be logically separated and performed concurrently with other operations required to complete the response. ARD enables Java servlet programmers to perform standard javax.servlet.RequestDispatcher include calls for the same request concurrently on separate threads. These javax.servlet.RequestDispatcher include calls are completed sequentially on the same thread. ARD is also useful in low CPU, long wait situations like waiting for a database connection.- Asynchronous request dispatcher application design considerations
Asynchronous request dispatcher (ARD) is not a one-size-fits-all solution to servlet programming. We must evaluate the needs of the application and the caveats of using ARD. Switching all includes to start asynchronously is not the solution for every scenario, but when used wisely, ARD can increase response time.- Asynchronous request dispatching settings
Use this page to enable the asynchronous request dispatcher (ARD), which enables servlets and JSP pages to make standard include calls concurrently on separate threads.