WASdev/sample.async.jaxrs

Name: sample.async.jaxrs

Owner: WASdev

Description: This is a collection of samples that illustrate the async capabilities of JAX-RS 2.0 in Java EE7 that can be used to make your applications more responsive. #JavaEE7

Created: 2015-06-25 14:40:10.0

Updated: 2017-12-18 09:47:59.0

Pushed: 2017-10-24 19:56:17.0

Homepage:

Size: 154

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Java EE7: JAX-RS 2.0 Async Request processing Build Status

Java EE7 added support for asynchronous request processing of REST requests in JAX-RS 2.0.

This sample contains a few variations to illustrate how to use async request processing in JAX-RS 2.0 applications. It is organized around a generic Item, that is manipulated by an ItemService that happens to take a long time (it sleeps for a few seconds). Each variation copes with this slow service in a different way, to illustrate how JAX-RS Async requests work and how Concurrency Utilities and EJBs can be used to offload work to other threads while keeping the EE container happy.

AsyncResponse objects can be configured to handle timeouts. There are two examples showing that:

Getting Started

Browse the code to see what it does, or build and run it yourself:

In your browser, enter the URL for the application: http://localhost:9081/jaxrs-async/ (where port 9081 assumes the httpEndpoint provided in the sample server.xml has not been modified).

More on JAX-RS 2.0 and related technologies
Notice

© Copyright IBM Corporation 2015, 2017.

License
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.