SlideShare a Scribd company logo
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS and CDI Bike the
(Reactive) Bridge
CON2549
David Delabassée (@delabassee) - Oracle
José Paumard (@josepaumard) - Consultant
October, 2017
2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 3
@delabassee
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 4
@JosePaumard
@JosePaumard
https://github.com/JosePaumard
https://www.slideshare.net/jpaumard
https://www.youtube.com/user/JPaumard
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 5
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
6
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 7
reactive
adjective | re·ac·tive |  rē-ˈak-tiv 
1 :of, relating to, or marked by reaction or reactance
2 a :readily responsive to a stimulus
https://www.merriam-webster.com/dictionary/reactive
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS
8
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS 2.1
• JSR 370
– Java EE 8
• Async
– New Reactive Client API
– New method for pausing resquest processing, etc.
• Server-Sent Event support
• JSON-P & JSON-B support
• …
Java API for RESTful Web Services
9
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
// JAX-RS 2.0
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://weath.er/api")
.queryParam("city", "Paris");
Forecast forecast = target.request()
.get(Forecast.class);
// …
client.close();
JAX-RS Client API
10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
• Fluent API
– Client Builder  Client  Web Target  Request building  Response
javax.ws.rs.client.Client interface
11
List<Forecast> forecast = ClientBuilder.newClient()
.target("http://weath.er/cities")
.request()
.accept("application/json")
.header("Foo","bar")
.get(new GenericType<List<Forecast>>() {});
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
• Synchronous invoker
• Asynchronous invoker
JAX-RS 2.0 Invokers
12
String city = client.target("http://locati.on/api")
.queryParam("city", "Paris")
.request()
.get(String.class);
Future<String> fCity = client.target("http://locati.on/api")
.queryParam("city", "Paris")
.request()
.async()
.get(String.class);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
Asynchronous invocation
13
Future<String> fCity = client.target("http://locati.on/api")
.queryParam("city", "Paris")
.request()
.async()
.get(String.class);
String city = fCity.get();
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
Asynchronous invocation
14
Future<String> fCity = client.target("http://locati.on/api")
.queryParam("city", "Paris")
.request()
.async()
.get(String.class);
try {
String city = fCity.get(5, TimeUnit.SECONDS);
} catch(TimeoutException timeout) {
// …
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
Asynchronous invocation
15
// Set ClientProperties.CONNECT_TIMEOUT & READ_TIMEOUT
Future<String> fCity = client.target("http://locati.on/api")
.queryParam("city", "Paris")
.request()
.async()
.get(String.class);
while ( !fCity.isDone() ) {
// response hasn't been received yet
}
String city = fCity.get();
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
• InvocationCallback Interface
– javax.ws.rs.client.InvocationCallback<RESPONSE>
• Container will receive async processing events from an invocation
– completed(RESPONSE response)
– failed(Throwable throwable)
Asynchronous invocation
16
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
WebTarget myResource = client.target("http://examp.le/api/read");
Future<Customer> future = myResource.request(MediaType.TEXT_PLAIN)
.async()
.get(new InvocationCallback<Customer>() {
@Override
public void completed (Customer customer) {
// do something with the customer
}
@Override
public void failed (Throwable throwable) {
// Oops!
}
});
…
InvocationCallback
17
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
18
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
• Customer details: 150 ms
• Recommended destinations: 250 ms
• Price calculation for a customer and destination: 170 ms (each)
• Weather forecast for a destination: 330 ms (each)
Synchronous
19
5 400 ms
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
Asynchronous
20
730 ms
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
21
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
22
destination.path("recommended").request()
.header("Rx-User", "Async")
.async()
.get(new InvocationCallback<List<Destination>>() {
@Override
public void completed(final List<Destination> recommended) {
final CountDownLatch innerLatch = new CountDownLatch(recommended.size());
final Map<String, Forecast> forecasts =
Collections.synchronizedMap(new HashMap<>());
for (final Destination dest : recommended) {
forecast.resolveTemplate("dest", dest.getDestination()).request()
.async()
.get(new InvocationCallback<Forecast>() {
@Override
public void completed(final Forecast forecast) {
forecasts.put(dest.getDestination(), forecast);
innerLatch.countDown();
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
23
// cont.
@Override
public void failed(final Throwable throwable) {
innerLatch.countDown();
}
});
}
try {
if (!innerLatch.await(10, TimeUnit.SECONDS)) { // timeout }
} catch (final InterruptedException e) { // Ooops, interrupted! }
// Continue with processing…
}
@Override
public void failed(final Throwable throwable) { // Recommendation error }
});
// ...
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Client API
New JAX-RS Reactive Invoker
24
// JAX-RS 2.0
Response response = client.target(recommandationService)
.request()
.get();
Future<Response> futureResponse = client.target(recommandationService)
.request()
.async()
.get();
// JAX-RS 2.1
CompletionStage<Response> completionStageResp = client.target(recommandationService)
.request()
.rx()
.get();
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CompletionStage API
• A model for a Task
– That performs an action and may return a value
– That can be triggered by another task
– That may trigger another task
– That can be executed in a different thread
• A CompletionStage is an element of an asynchronous chain
25
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CompletionStage Pipeline
26
CS1 CS21
CS22
CS31 CS41
CS32
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
27
CompletionStage<JsonObject> queryForecastCS = client.target("forecast")
.queryParam("format", "json").request()
.rx()
.get(JsonObject.class);
Function<JsonObject, Forecast> unmarshallForecast =
jsonObject -> JsonBuilder.create().fromJson(jsonObject.toString(), Forecast.class);
Function<Destination, CompletionStage<Void>> populateWithForecast =
destination ->
queryForecastCS.thenApply(unmarshallForecast)
.thenAccept(forecast -> destination.setForecast(forecast));
Function<Destination, CompletionStage<Void>> populateWithQuotation =
destination ->
queryQuotationCS.thenApply(unmarshallQuotation)
.thenAccept(quotation -> destination.setQuotation(quotation));
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
28
Function<Destination, CompletableFuture<Void>> populateDestination =
destination ->
CompletableFuture.allOf(
populateWithForecast.apply(destination).toCompletableFuture(),
populateWithQuotation.apply(destination).toCompletableFuture()
)
.toCompletableFuture();
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
29
Function<Destination, CompletableFuture<Void>> populateDestination =
destination ->
CompletableFuture.allOf(
populateWithForecast.apply(destination).toCompletableFuture(),
populateWithQuotation.apply(destination).toCompletableFuture()
)
.toCompletableFuture();
Function<List<Destination>, CompletableFuture<?>[]> populateDestinations =
destinations ->
destinations.stream().map(populateDestination)
.toArray(CompletableFuture[]::new);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
30
@GET
public void populateDestination(@Suspended final AsyncResponse asyncResponse) {
CompletionStage<List<Destination>> destinationCS = client.target("destination")
.queryParam("format", "json").request()
.rx()
.get(/* some JSONB code */);
CompletionStage<List<Destination>> updatedDestinationsCS =
destinationCS.thenCompose(CompletableFuture.allOf(populateDestinations));
asyncResponse.resume(updatedDestinationsCS.toCompletableFuture().get());
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
The Travel Service
31
@GET
public CompletionStage<Destination> populateDestination() {
CompletionStage<List<Destination>> destinationCS = client.target("destination")
.queryParam("format", "json").request()
.rx()
.get(/* some JSONB code */);
CompletionStage<List<Destination>> updatedDestinationsCS =
destinationCS.thenCompose(CompletableFuture.allOf(populateDestinations));
return updatedDestinationsCS;
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
32
CS1 CS21
CS22
CS31 CS41
CS32
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
Returns a new CompletionStage
• That completes when the CS completes
• Either with the same result (normal completion)
• Or with the transformed exception
33
exceptionaly()
stage.exceptionaly( // Function
exception -> doSomethingNotTooStupidWith(exception));
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
Returns a new CompletionStage
• That completes when the CS completes
• Calls the BiFunction with a null as result or exception
34
handle()
stage.handle( // BiFunction
(result, exception) -> doSomethingWith(result, exception));
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
Returns a new CompletionStage
• With the same result or exception as this stage
• That executes the given action when this stage completes
35
whenComplete()
stage.whenComplete( // BiConsumer + async version
(result, exception) -> doSomethingWith(result, exception));
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
36
CompletionStage<Void> quotation = client.target("quotation")
.request().rx().get(JsonObject.class)
.thenApply(unmarshallQuotation)
.exceptionnaly(throwable -> null)
.thenAccept(destination::setQuotation);
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Exception Handling
37
CompletionStage<Void> quotation = client.target("quotation")
.request().rx().get(JsonObject.class)
.thenApply(unmarshallQuotation)
.handle(((quotation, throwable) -> {
if (throwable == null) {
destination.setQuotation(quotation);
} else {
// try to do something smart with the exception
}
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Reactive Extensions
• Supported on all HTTP Methods of the Client API
– DELETE
– GET
– HEAD
– OPTIONS
– POST
– PUT
– TRACE
38
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
JAX-RS Reactive Extensions
• Implementations MUST support an invoker for CompletionStage
• Implementations MAY support other reactive APIs
• Jersey
– CompletionStageRxInvoker (Default)
– RxListenableFutureInvoker – Guava
39
https://github.com/jersey/jersey/tree/master/ext/rx
client.register(RxFlowableInvokerProvider.class);
client.target(...)...
.rx(RxFlowableInvoker.class)
.get();
– RxObservableInvoker – RxJava
– RxFlowableInvoker – RxJava2
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CDI
40
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
CDI 2.0
• JSR 365
– Java EE 8
• Java SE focus
– Modular specification
– CDI Container bootstraping
• Observers Ordering
• Asynchronous Events
• …
Context and Dependency Injection
41
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Asynchronous Events
42
// Producer
@Inject
Event<Payload> event;
public void aCriticalBusinessMethod() {
CompletionStage<Payload> cs = event.fireAsync(new Payload());
}
// Consumer
public void anOberser(@ObservesAsync Payload event) {
// do something with the payload
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Asynchronous Events
43
// Producer
@Inject
Event<Payload> event;
public void aCriticalBusinessMethod() {
CompletionStage<Payload> cs =
event.fireAsync(new Payload(), executor);
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Asynchronous Events
44
// Producer
@Inject
Event<Payload> event;
public void aCriticalBusinessMethod() {
CompletionStage<Payload> cs =
event.fireAsync(new Payload(), SwingUtilities::invokeLater);
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Wrap-up
45
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Java EE 8 – Modernization & Simplification
46
CDI 2.0
JSON-B 1.0 (*)
Security 1.0 (*)
Bean Validation 2.0
JSF 2.3
Servlet 4.0
JSON-P 1.1
JAX-RS 2.1 Reactive Client API, Server-Sent Events, …
HTTP/2, Server Push, …
Java <-> JSON binding
Updates to JSON standards, JSON Collectors, …
Async Event, Observers ordering, SE support, …
Embrace Java SE 8, new constraints, …
Improved CDI, WebSocket, SE 8 integration, …
Portable Identity Store, Authentication & Security Context
JAX RS and CDI bike the reactive bridge
JAX RS and CDI bike the reactive bridge

More Related Content

What's hot

Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
David Gómez García
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
Peter Pilgrim
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
Grzegorz Duda
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
Carol McDonald
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
David Delabassee
 
JSR 354 LJC-Hackday
JSR 354 LJC-HackdayJSR 354 LJC-Hackday
JSR 354 LJC-Hackday
Anatole Tresch
 
JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...
Anatole Tresch
 
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Vadym Kazulkin
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendKirill Chebunin
 
What's new in DWR version 3
What's new in DWR version 3What's new in DWR version 3
What's new in DWR version 3
Joe Walker
 
Functional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritterFunctional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritter
Simon Ritter
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
Simon Ritter
 
Introduction to Asynchronous scala
Introduction to Asynchronous scalaIntroduction to Asynchronous scala
Introduction to Asynchronous scalaStratio
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
Nate Abele
 
Java: Create The Future Keynote
Java: Create The Future KeynoteJava: Create The Future Keynote
Java: Create The Future Keynote
Simon Ritter
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)
Logico
 
Sane Sharding with Akka Cluster
Sane Sharding with Akka ClusterSane Sharding with Akka Cluster
Sane Sharding with Akka Cluster
miciek
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
Kirill Chebunin
 

What's hot (20)

Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5
 
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVMQCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
QCon 2015 Scala for the Enterprise: Get FuNkEd Up on the JVM
 
Advanced akka features
Advanced akka featuresAdvanced akka features
Advanced akka features
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
 
JSR 354 LJC-Hackday
JSR 354 LJC-HackdayJSR 354 LJC-Hackday
JSR 354 LJC-Hackday
 
JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...
 
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
Highlights from Java 10-13 and Future of Java at JCON 2019 by Alukhanov and K...
 
Symfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friendSymfony2 Service Container: Inject me, my friend
Symfony2 Service Container: Inject me, my friend
 
What's new in DWR version 3
What's new in DWR version 3What's new in DWR version 3
What's new in DWR version 3
 
Functional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritterFunctional programming with_jdk8-s_ritter
Functional programming with_jdk8-s_ritter
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
Introduction to Asynchronous scala
Introduction to Asynchronous scalaIntroduction to Asynchronous scala
Introduction to Asynchronous scala
 
Practical PHP 5.3
Practical PHP 5.3Practical PHP 5.3
Practical PHP 5.3
 
Java: Create The Future Keynote
Java: Create The Future KeynoteJava: Create The Future Keynote
Java: Create The Future Keynote
 
Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)Nashorn: JavaScript Running on Java VM (English)
Nashorn: JavaScript Running on Java VM (English)
 
Sane Sharding with Akka Cluster
Sane Sharding with Akka ClusterSane Sharding with Akka Cluster
Sane Sharding with Akka Cluster
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
 

Viewers also liked

Java 9 modulo les modules devoxx fr 2017
Java 9 modulo les modules devoxx fr 2017Java 9 modulo les modules devoxx fr 2017
Java 9 modulo les modules devoxx fr 2017
Jean-Michel Doudoux
 
Retours sur java 8 devoxx fr 2016
Retours sur java 8 devoxx fr 2016Retours sur java 8 devoxx fr 2016
Retours sur java 8 devoxx fr 2016
Jean-Michel Doudoux
 
NightClazz Java 8 Decouverte
NightClazz Java 8 DecouverteNightClazz Java 8 Decouverte
NightClazz Java 8 Decouverte
Zenika
 
What HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouWhat HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For You
Mark Nottingham
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
EUR ING Ioannis Kolaxis MSc
 
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelleAgile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
Zenika
 
NightClazz Build Tools & Continuous Delivery Avancé
NightClazz Build Tools & Continuous Delivery AvancéNightClazz Build Tools & Continuous Delivery Avancé
NightClazz Build Tools & Continuous Delivery Avancé
Zenika
 
Going reactive in java
Going reactive in javaGoing reactive in java
Going reactive in java
José Paumard
 
HTTP2 : ce qui va changer par Julien Landuré
HTTP2 : ce qui va changer par Julien LanduréHTTP2 : ce qui va changer par Julien Landuré
HTTP2 : ce qui va changer par Julien Landuré
Zenika
 
Http2
Http2Http2
Business intelligence v0.3
Business intelligence v0.3Business intelligence v0.3
Business intelligence v0.3
Luca Mauri
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2
Ido Flatow
 
The Case for HTTP/2
The Case for HTTP/2The Case for HTTP/2
The Case for HTTP/2
Andy Davies
 
Open Data v0.3
Open Data v0.3Open Data v0.3
Open Data v0.3
Luca Mauri
 
So, you wanna migrate to Java 9?
So, you wanna migrate to Java 9?So, you wanna migrate to Java 9?
So, you wanna migrate to Java 9?
Tomek Adamczewki
 
Optimisez la performance de votre service client tout en maîtrisant votre b...
Optimisez la performance  de votre service client  tout en maîtrisant votre b...Optimisez la performance  de votre service client  tout en maîtrisant votre b...
Optimisez la performance de votre service client tout en maîtrisant votre b...
Experian
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
Lori MacVittie
 
Matinale DevOps / Docker
Matinale DevOps / DockerMatinale DevOps / Docker
Matinale DevOps / Docker
Zenika
 
Better Product Definition with Lean UX and Design Thinking
Better Product Definition with Lean UX and Design ThinkingBetter Product Definition with Lean UX and Design Thinking
Better Product Definition with Lean UX and Design ThinkingJeff Gothelf
 

Viewers also liked (20)

Java 9 modulo les modules devoxx fr 2017
Java 9 modulo les modules devoxx fr 2017Java 9 modulo les modules devoxx fr 2017
Java 9 modulo les modules devoxx fr 2017
 
Retours sur java 8 devoxx fr 2016
Retours sur java 8 devoxx fr 2016Retours sur java 8 devoxx fr 2016
Retours sur java 8 devoxx fr 2016
 
NightClazz Java 8 Decouverte
NightClazz Java 8 DecouverteNightClazz Java 8 Decouverte
NightClazz Java 8 Decouverte
 
What HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For YouWhat HTTP/2.0 Will Do For You
What HTTP/2.0 Will Do For You
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
 
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelleAgile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
Agile Wake Up #1 du 01/12/2015 : L'agilité à grande échelle
 
NightClazz Build Tools & Continuous Delivery Avancé
NightClazz Build Tools & Continuous Delivery AvancéNightClazz Build Tools & Continuous Delivery Avancé
NightClazz Build Tools & Continuous Delivery Avancé
 
Going reactive in java
Going reactive in javaGoing reactive in java
Going reactive in java
 
HTTP2 : ce qui va changer par Julien Landuré
HTTP2 : ce qui va changer par Julien LanduréHTTP2 : ce qui va changer par Julien Landuré
HTTP2 : ce qui va changer par Julien Landuré
 
Http2
Http2Http2
Http2
 
Business intelligence v0.3
Business intelligence v0.3Business intelligence v0.3
Business intelligence v0.3
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2
 
The Case for HTTP/2
The Case for HTTP/2The Case for HTTP/2
The Case for HTTP/2
 
Open Data v0.3
Open Data v0.3Open Data v0.3
Open Data v0.3
 
So, you wanna migrate to Java 9?
So, you wanna migrate to Java 9?So, you wanna migrate to Java 9?
So, you wanna migrate to Java 9?
 
Optimisez la performance de votre service client tout en maîtrisant votre b...
Optimisez la performance  de votre service client  tout en maîtrisant votre b...Optimisez la performance  de votre service client  tout en maîtrisant votre b...
Optimisez la performance de votre service client tout en maîtrisant votre b...
 
Company_Profile_Digital_1
Company_Profile_Digital_1Company_Profile_Digital_1
Company_Profile_Digital_1
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
 
Matinale DevOps / Docker
Matinale DevOps / DockerMatinale DevOps / Docker
Matinale DevOps / Docker
 
Better Product Definition with Lean UX and Design Thinking
Better Product Definition with Lean UX and Design ThinkingBetter Product Definition with Lean UX and Design Thinking
Better Product Definition with Lean UX and Design Thinking
 

Similar to JAX RS and CDI bike the reactive bridge

Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Oracle Developers
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018
harvraja
 
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX LondonJAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
Arun Gupta
 
JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013
Jagadish Prasath
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
Nic Raboy
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
Arun Gupta
 
Adopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS updateAdopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS update
Pavel Bucek
 
Reactive Jersey Client
Reactive Jersey ClientReactive Jersey Client
Reactive Jersey Client
Michal Gajdos
 
Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)
Logico
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)
Logico
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
PetrosPlakogiannis
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018
Oracle Developers
 
12 Things Developers Will Love About Oracle Database 12c Release 2
12 Things Developers Will Love About Oracle Database 12c Release 212 Things Developers Will Love About Oracle Database 12c Release 2
12 Things Developers Will Love About Oracle Database 12c Release 2
Chris Saxon
 
PGQL: A Language for Graphs
PGQL: A Language for GraphsPGQL: A Language for Graphs
PGQL: A Language for Graphs
Jean Ihm
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
Ivan Ma
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
Michal Gajdos
 
Developing Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database DevelopersDeveloping Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database Developers
Revelation Technologies
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
Bruno Borges
 
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX London
 
Mashups
MashupsMashups
Mashups
Johan Eltes
 

Similar to JAX RS and CDI bike the reactive bridge (20)

Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018
 
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX LondonJAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
 
JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013JAX RS 2.0 - OTN Bangalore 2013
JAX RS 2.0 - OTN Bangalore 2013
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
 
JAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web ServicesJAX-RS 2.0: RESTful Web Services
JAX-RS 2.0: RESTful Web Services
 
Adopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS updateAdopt-a-jsr Mar 1 2017 JAX-RS update
Adopt-a-jsr Mar 1 2017 JAX-RS update
 
Reactive Jersey Client
Reactive Jersey ClientReactive Jersey Client
Reactive Jersey Client
 
Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)Project Helidon Overview (Japanese)
Project Helidon Overview (Japanese)
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018
 
12 Things Developers Will Love About Oracle Database 12c Release 2
12 Things Developers Will Love About Oracle Database 12c Release 212 Things Developers Will Love About Oracle Database 12c Release 2
12 Things Developers Will Love About Oracle Database 12c Release 2
 
PGQL: A Language for Graphs
PGQL: A Language for GraphsPGQL: A Language for Graphs
PGQL: A Language for Graphs
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
 
Developing Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database DevelopersDeveloping Web Services from Scratch - For DBAs and Database Developers
Developing Web Services from Scratch - For DBAs and Database Developers
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
 
Mashups
MashupsMashups
Mashups
 

More from José Paumard

Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19
José Paumard
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdf
José Paumard
 
The Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingThe Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern Matching
José Paumard
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
José Paumard
 
Designing functional and fluent API: application to some GoF patterns
Designing functional and fluent API: application to some GoF patternsDesigning functional and fluent API: application to some GoF patterns
Designing functional and fluent API: application to some GoF patterns
José Paumard
 
The Sincerest Form of Flattery
The Sincerest Form of FlatteryThe Sincerest Form of Flattery
The Sincerest Form of Flattery
José Paumard
 
The Sincerest Form of Flattery
The Sincerest Form of FlatteryThe Sincerest Form of Flattery
The Sincerest Form of Flattery
José Paumard
 
Designing functional and fluent API: example of the Visitor Pattern
Designing functional and fluent API: example of the Visitor PatternDesigning functional and fluent API: example of the Visitor Pattern
Designing functional and fluent API: example of the Visitor Pattern
José Paumard
 
Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapes
José Paumard
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!
José Paumard
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2
José Paumard
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1
José Paumard
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
José Paumard
 
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
José Paumard
 
Collectors in the Wild
Collectors in the WildCollectors in the Wild
Collectors in the Wild
José Paumard
 
Streams in the wild
Streams in the wildStreams in the wild
Streams in the wild
José Paumard
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
José Paumard
 
L'API Collector dans tous ses états
L'API Collector dans tous ses étatsL'API Collector dans tous ses états
L'API Collector dans tous ses états
José Paumard
 
Linked to ArrayList: the full story
Linked to ArrayList: the full storyLinked to ArrayList: the full story
Linked to ArrayList: the full story
José Paumard
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
José Paumard
 

More from José Paumard (20)

Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19Loom Virtual Threads in the JDK 19
Loom Virtual Threads in the JDK 19
 
From Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdfFrom Java 11 to 17 and beyond.pdf
From Java 11 to 17 and beyond.pdf
 
The Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern MatchingThe Future of Java: Records, Sealed Classes and Pattern Matching
The Future of Java: Records, Sealed Classes and Pattern Matching
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Designing functional and fluent API: application to some GoF patterns
Designing functional and fluent API: application to some GoF patternsDesigning functional and fluent API: application to some GoF patterns
Designing functional and fluent API: application to some GoF patterns
 
The Sincerest Form of Flattery
The Sincerest Form of FlatteryThe Sincerest Form of Flattery
The Sincerest Form of Flattery
 
The Sincerest Form of Flattery
The Sincerest Form of FlatteryThe Sincerest Form of Flattery
The Sincerest Form of Flattery
 
Designing functional and fluent API: example of the Visitor Pattern
Designing functional and fluent API: example of the Visitor PatternDesigning functional and fluent API: example of the Visitor Pattern
Designing functional and fluent API: example of the Visitor Pattern
 
Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapes
 
Java Keeps Throttling Up!
Java Keeps Throttling Up!Java Keeps Throttling Up!
Java Keeps Throttling Up!
 
Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2Lambdas and Streams Master Class Part 2
Lambdas and Streams Master Class Part 2
 
Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1Lambda and Stream Master class - part 1
Lambda and Stream Master class - part 1
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Java Full Throttle
Java Full ThrottleJava Full Throttle
Java Full Throttle
 
Collectors in the Wild
Collectors in the WildCollectors in the Wild
Collectors in the Wild
 
Streams in the wild
Streams in the wildStreams in the wild
Streams in the wild
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
 
L'API Collector dans tous ses états
L'API Collector dans tous ses étatsL'API Collector dans tous ses états
L'API Collector dans tous ses états
 
Linked to ArrayList: the full story
Linked to ArrayList: the full storyLinked to ArrayList: the full story
Linked to ArrayList: the full story
 
Free your lambdas
Free your lambdasFree your lambdas
Free your lambdas
 

Recently uploaded

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 

Recently uploaded (20)

Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 

JAX RS and CDI bike the reactive bridge

  • 1.
  • 2. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS and CDI Bike the (Reactive) Bridge CON2549 David Delabassée (@delabassee) - Oracle José Paumard (@josepaumard) - Consultant October, 2017 2
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 3 @delabassee
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 4 @JosePaumard @JosePaumard https://github.com/JosePaumard https://www.slideshare.net/jpaumard https://www.youtube.com/user/JPaumard
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 5
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 6
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 7 reactive adjective | re·ac·tive | rē-ˈak-tiv 1 :of, relating to, or marked by reaction or reactance 2 a :readily responsive to a stimulus https://www.merriam-webster.com/dictionary/reactive
  • 8. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS 8
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS 2.1 • JSR 370 – Java EE 8 • Async – New Reactive Client API – New method for pausing resquest processing, etc. • Server-Sent Event support • JSON-P & JSON-B support • … Java API for RESTful Web Services 9
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | // JAX-RS 2.0 Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://weath.er/api") .queryParam("city", "Paris"); Forecast forecast = target.request() .get(Forecast.class); // … client.close(); JAX-RS Client API 10
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API • Fluent API – Client Builder  Client  Web Target  Request building  Response javax.ws.rs.client.Client interface 11 List<Forecast> forecast = ClientBuilder.newClient() .target("http://weath.er/cities") .request() .accept("application/json") .header("Foo","bar") .get(new GenericType<List<Forecast>>() {});
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API • Synchronous invoker • Asynchronous invoker JAX-RS 2.0 Invokers 12 String city = client.target("http://locati.on/api") .queryParam("city", "Paris") .request() .get(String.class); Future<String> fCity = client.target("http://locati.on/api") .queryParam("city", "Paris") .request() .async() .get(String.class);
  • 13. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API Asynchronous invocation 13 Future<String> fCity = client.target("http://locati.on/api") .queryParam("city", "Paris") .request() .async() .get(String.class); String city = fCity.get();
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API Asynchronous invocation 14 Future<String> fCity = client.target("http://locati.on/api") .queryParam("city", "Paris") .request() .async() .get(String.class); try { String city = fCity.get(5, TimeUnit.SECONDS); } catch(TimeoutException timeout) { // … }
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API Asynchronous invocation 15 // Set ClientProperties.CONNECT_TIMEOUT & READ_TIMEOUT Future<String> fCity = client.target("http://locati.on/api") .queryParam("city", "Paris") .request() .async() .get(String.class); while ( !fCity.isDone() ) { // response hasn't been received yet } String city = fCity.get();
  • 16. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API • InvocationCallback Interface – javax.ws.rs.client.InvocationCallback<RESPONSE> • Container will receive async processing events from an invocation – completed(RESPONSE response) – failed(Throwable throwable) Asynchronous invocation 16
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API WebTarget myResource = client.target("http://examp.le/api/read"); Future<Customer> future = myResource.request(MediaType.TEXT_PLAIN) .async() .get(new InvocationCallback<Customer>() { @Override public void completed (Customer customer) { // do something with the customer } @Override public void failed (Throwable throwable) { // Oops! } }); … InvocationCallback 17
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 18
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service • Customer details: 150 ms • Recommended destinations: 250 ms • Price calculation for a customer and destination: 170 ms (each) • Weather forecast for a destination: 330 ms (each) Synchronous 19 5 400 ms
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service Asynchronous 20 730 ms
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 21
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 22 destination.path("recommended").request() .header("Rx-User", "Async") .async() .get(new InvocationCallback<List<Destination>>() { @Override public void completed(final List<Destination> recommended) { final CountDownLatch innerLatch = new CountDownLatch(recommended.size()); final Map<String, Forecast> forecasts = Collections.synchronizedMap(new HashMap<>()); for (final Destination dest : recommended) { forecast.resolveTemplate("dest", dest.getDestination()).request() .async() .get(new InvocationCallback<Forecast>() { @Override public void completed(final Forecast forecast) { forecasts.put(dest.getDestination(), forecast); innerLatch.countDown(); }
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 23 // cont. @Override public void failed(final Throwable throwable) { innerLatch.countDown(); } }); } try { if (!innerLatch.await(10, TimeUnit.SECONDS)) { // timeout } } catch (final InterruptedException e) { // Ooops, interrupted! } // Continue with processing… } @Override public void failed(final Throwable throwable) { // Recommendation error } }); // ...
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Client API New JAX-RS Reactive Invoker 24 // JAX-RS 2.0 Response response = client.target(recommandationService) .request() .get(); Future<Response> futureResponse = client.target(recommandationService) .request() .async() .get(); // JAX-RS 2.1 CompletionStage<Response> completionStageResp = client.target(recommandationService) .request() .rx() .get();
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CompletionStage API • A model for a Task – That performs an action and may return a value – That can be triggered by another task – That may trigger another task – That can be executed in a different thread • A CompletionStage is an element of an asynchronous chain 25
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CompletionStage Pipeline 26 CS1 CS21 CS22 CS31 CS41 CS32
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 27 CompletionStage<JsonObject> queryForecastCS = client.target("forecast") .queryParam("format", "json").request() .rx() .get(JsonObject.class); Function<JsonObject, Forecast> unmarshallForecast = jsonObject -> JsonBuilder.create().fromJson(jsonObject.toString(), Forecast.class); Function<Destination, CompletionStage<Void>> populateWithForecast = destination -> queryForecastCS.thenApply(unmarshallForecast) .thenAccept(forecast -> destination.setForecast(forecast)); Function<Destination, CompletionStage<Void>> populateWithQuotation = destination -> queryQuotationCS.thenApply(unmarshallQuotation) .thenAccept(quotation -> destination.setQuotation(quotation));
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 28 Function<Destination, CompletableFuture<Void>> populateDestination = destination -> CompletableFuture.allOf( populateWithForecast.apply(destination).toCompletableFuture(), populateWithQuotation.apply(destination).toCompletableFuture() ) .toCompletableFuture();
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 29 Function<Destination, CompletableFuture<Void>> populateDestination = destination -> CompletableFuture.allOf( populateWithForecast.apply(destination).toCompletableFuture(), populateWithQuotation.apply(destination).toCompletableFuture() ) .toCompletableFuture(); Function<List<Destination>, CompletableFuture<?>[]> populateDestinations = destinations -> destinations.stream().map(populateDestination) .toArray(CompletableFuture[]::new);
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 30 @GET public void populateDestination(@Suspended final AsyncResponse asyncResponse) { CompletionStage<List<Destination>> destinationCS = client.target("destination") .queryParam("format", "json").request() .rx() .get(/* some JSONB code */); CompletionStage<List<Destination>> updatedDestinationsCS = destinationCS.thenCompose(CompletableFuture.allOf(populateDestinations)); asyncResponse.resume(updatedDestinationsCS.toCompletableFuture().get()); }
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | The Travel Service 31 @GET public CompletionStage<Destination> populateDestination() { CompletionStage<List<Destination>> destinationCS = client.target("destination") .queryParam("format", "json").request() .rx() .get(/* some JSONB code */); CompletionStage<List<Destination>> updatedDestinationsCS = destinationCS.thenCompose(CompletableFuture.allOf(populateDestinations)); return updatedDestinationsCS; }
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling 32 CS1 CS21 CS22 CS31 CS41 CS32
  • 33. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling Returns a new CompletionStage • That completes when the CS completes • Either with the same result (normal completion) • Or with the transformed exception 33 exceptionaly() stage.exceptionaly( // Function exception -> doSomethingNotTooStupidWith(exception));
  • 34. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling Returns a new CompletionStage • That completes when the CS completes • Calls the BiFunction with a null as result or exception 34 handle() stage.handle( // BiFunction (result, exception) -> doSomethingWith(result, exception));
  • 35. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling Returns a new CompletionStage • With the same result or exception as this stage • That executes the given action when this stage completes 35 whenComplete() stage.whenComplete( // BiConsumer + async version (result, exception) -> doSomethingWith(result, exception));
  • 36. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling 36 CompletionStage<Void> quotation = client.target("quotation") .request().rx().get(JsonObject.class) .thenApply(unmarshallQuotation) .exceptionnaly(throwable -> null) .thenAccept(destination::setQuotation);
  • 37. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Exception Handling 37 CompletionStage<Void> quotation = client.target("quotation") .request().rx().get(JsonObject.class) .thenApply(unmarshallQuotation) .handle(((quotation, throwable) -> { if (throwable == null) { destination.setQuotation(quotation); } else { // try to do something smart with the exception } }
  • 38. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Reactive Extensions • Supported on all HTTP Methods of the Client API – DELETE – GET – HEAD – OPTIONS – POST – PUT – TRACE 38
  • 39. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | JAX-RS Reactive Extensions • Implementations MUST support an invoker for CompletionStage • Implementations MAY support other reactive APIs • Jersey – CompletionStageRxInvoker (Default) – RxListenableFutureInvoker – Guava 39 https://github.com/jersey/jersey/tree/master/ext/rx client.register(RxFlowableInvokerProvider.class); client.target(...)... .rx(RxFlowableInvoker.class) .get(); – RxObservableInvoker – RxJava – RxFlowableInvoker – RxJava2
  • 40. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CDI 40
  • 41. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | CDI 2.0 • JSR 365 – Java EE 8 • Java SE focus – Modular specification – CDI Container bootstraping • Observers Ordering • Asynchronous Events • … Context and Dependency Injection 41
  • 42. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Asynchronous Events 42 // Producer @Inject Event<Payload> event; public void aCriticalBusinessMethod() { CompletionStage<Payload> cs = event.fireAsync(new Payload()); } // Consumer public void anOberser(@ObservesAsync Payload event) { // do something with the payload }
  • 43. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Asynchronous Events 43 // Producer @Inject Event<Payload> event; public void aCriticalBusinessMethod() { CompletionStage<Payload> cs = event.fireAsync(new Payload(), executor); }
  • 44. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Asynchronous Events 44 // Producer @Inject Event<Payload> event; public void aCriticalBusinessMethod() { CompletionStage<Payload> cs = event.fireAsync(new Payload(), SwingUtilities::invokeLater); }
  • 45. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Wrap-up 45
  • 46. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Java EE 8 – Modernization & Simplification 46 CDI 2.0 JSON-B 1.0 (*) Security 1.0 (*) Bean Validation 2.0 JSF 2.3 Servlet 4.0 JSON-P 1.1 JAX-RS 2.1 Reactive Client API, Server-Sent Events, … HTTP/2, Server Push, … Java <-> JSON binding Updates to JSON standards, JSON Collectors, … Async Event, Observers ordering, SE support, … Embrace Java SE 8, new constraints, … Improved CDI, WebSocket, SE 8 integration, … Portable Identity Store, Authentication & Security Context