Slide 1

Slide 1 text

INTERNAL Piotr Wittchen, Arkadiusz Galwas, SAP Hybris Reactive Programming Efficient Server Applications

Slide 2

Slide 2 text

Let’s plan an application

Slide 3

Slide 3 text

3 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Basic application flow Client Data Acquisition Reading data from sensors. Client Sending Data Sending data from the Client to the Server over HTTP protocol. Server Data Handling Handling incoming data received from the Client. Server Data Processing Processing handled data and logging them.

Slide 4

Slide 4 text

4 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Flow of the data streams inside the application 1 Stream of Sensor Events Data acquired on a m obile device 2 Stream of HTTP Requests Data sent from the client to the server 3 Stream of HTTP Responses Data received by the server Continuous stream of the data without breaking a chain

Slide 5

Slide 5 text

5 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Technologies we are going to use ● Server ○ Gradle ○ Java 9 ○ RxJava 2 ○ Vert.x ■ Core ■ Rx ○ Logback ● Client ○ Gradle ○ Android ○ Java 7 ○ Retrolambda ○ RxJava 2 ○ RxAndroid ○ OkHttp 3 ○ ReactiveSensors Side note This is just a simple demo with the only one endpoint. For more endpoints it’s better to use Vertx-web on the server and Retrofit on the client.

Slide 6

Slide 6 text

Let’s make an application!

Slide 7

Slide 7 text

7 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Source code of this project can be found at: https://github.com/pwittchen/reactive-client-server/

Slide 8

Slide 8 text

Optimizing CPU usage with RxJava

Slide 9

Slide 9 text

9 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Optimizing CPU usage Core Core thread thread thread thread If we are not using all available cores efficiently, we’re wasting resources and applications are getting slow. CPU

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

11 INTERNAL © 2017 SAP SE or an SAP affiliate company. All rights reserved. ǀ Source code of this project can be found at: https://github.com/pwittchen/java-flow-experiments

Slide 12

Slide 12 text

Thank you Contact information: Piotr Wittchen, Arkadiusz Galwas piotr.wittchen@sap.com, arkadiusz.galwas@sap.com Software Developers SAP Hybris