Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reactive Programming - Efficient Server Applica...

Reactive Programming - Efficient Server Applications

The second part of the presentation for "Hack Your Career" event organized by SAP Hybris company at Silesian University of Technology in Gliwice, Poland

Slides are supportive for further live coding.
Code samples from this part the presentation are available at:
- https://github.com/pwittchen/reactive-client-server
- https://github.com/pwittchen/java-flow-experiments

Piotr Wittchen

November 08, 2017
Tweet

More Decks by Piotr Wittchen

Other Decks in Programming

Transcript

  1. 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.
  2. 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
  3. 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.
  4. 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/
  5. 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
  6. 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