My jPrime 2016 presentation shows example of Domain-Driven Design (DDD), Event Sourcing (ES) and Functional Reactive Programming (FRP) using Reactor and Redux in a showcase of Java robotics - two small robots IPTPI (Raspberry Pi 2 + Ardiuno) and LeJaRo (LeJOS).
IPT presentation @ jProfessionals 2016 on Java and JavaScipt Reactive Robotics and IoT including: Domain Driven Design (DDD), high-performance reactive micro-services development using Spring Reactor, state-of-the-art component-based client side MVVM implementation with Angular 2, ngrx (Redux pattern), TypeScript and reactive WebSockets.
IPT High Performance Reactive Programming with JAVA 8 and JavaScriptTrayan Iliev
Presentation @ jProfessionals BGJUG Conference
Sofia, November 22, 2015 by IPT – IT Education Evolved, High Performance Reactive Programming Workshop - Dec 15-17,2015 http://iproduct.org/en/course-reactive-java-js/
You are welcome to join us!
Low-latency, high-throughput reactive and functional programming in Java using Spring Reactor, RxJava, RxJS, Facebook React, Angular 2, Reactive Streams, Disruptor (ring buffer), Reactor & Proactor design patterns, benchmarking & comparison of concurrency implementations. December 15 - 17, 2015 - Workshop: High Performance Reactive Programming with JAVA 8 and JavaScript - http://iproduct.org/en/course-reactive-java-js/
Sensor data is streamed in realtime from Arduino + accelerometeres, gyroscopes & compass 3D, ultrasound distance sensor, etc. using UDP protocol. The data processing is done with reactive Java alterantive implementations: callbacks, CompletableFutures and using Spring 5 Reactor library. The web 3D visualization with Three.js is streamed using Server Sent Events (SSE).
A video for the IoT demo is available @YouTube: https://www.youtube.com/watch?v=AB3AWAfcy9U
All source code of the demo is freely available @GitHub: https://github.com/iproduct/reactive-demos-iot
There are more reactive Java demos in the same repository - callbacks, CompletableFuture, realtime event streaming. Soon I'll add a description how to build the device and upload Arduino sketch, as well as describe CompletableFuture and Reactor demos and 3D web visualization part with Three.js. Please stay tuned :)
Presentation from BGOUG conference Nov 17, 2017.
Since September 2017, Java 9 is generally available. It offers many enhancements:
• Modularity – provides clear separation between public and private APIs, stronger encapsulation & dependency management.
• JShell – using and customizing Java 9 interactive shell by example
• Process API updates – feature-rich, async OS process management and statistics
• Reactive Streams, CompletableFuture and Stream API updates
• Building asynchronous HTTP/2 and WebSocket pipelines using HTTP/2 Client and CompletableFuture composition
• Collection API updates
• Stack walking, and other language enhancements (Project Coin)
Discussed topics are accompanied by live demos available for further review @ github.com/iproduct.
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
Stream based data / event / message processing becomes preferred way of achieving interoperability and real-time communication in distributed SOA / microservice / database architectures.
Beside lambdas, Java 8 introduced two new APIs explicitly dealing with stream data processing:
- Stream - which is PULL-based and easily parallelizable;
- CompletableFuture / CompletionStage - which allow composition of PUSH-based, non-blocking, asynchronous data processing pipelines.
Java 9 will provide further support for stream-based data-processing by extending the CompletableFuture with additional functionality – support for delays and timeouts, better support for subclassing, and new utility methods.
More, Java 9 provides new java.util.concurrent.Flow API implementing Reactive Streams specification that enables reactive programming and interoperability with libraries like Reactor, RxJava, RabbitMQ, Vert.x, Ratpack, and Akka.
The presentation will discuss the novelties in Java 8 and Java 9 supporting stream data processing, describing the APIs, models and practical details of asynchronous pipeline implementation, error handling, multithreaded execution, asyncronous REST service implementation, interoperability with existing libraries.
There are provided demo examples (code on GitHub) using Completable Future and Flow with:
- JAX-RS 2.1 AsyncResponse, and more importantly unit-testing the async REST service method implementations;
- CDI 2.0 asynchronous observers (fireAsync / @ObservesAsync);
My jPrime 2016 presentation shows example of Domain-Driven Design (DDD), Event Sourcing (ES) and Functional Reactive Programming (FRP) using Reactor and Redux in a showcase of Java robotics - two small robots IPTPI (Raspberry Pi 2 + Ardiuno) and LeJaRo (LeJOS).
IPT presentation @ jProfessionals 2016 on Java and JavaScipt Reactive Robotics and IoT including: Domain Driven Design (DDD), high-performance reactive micro-services development using Spring Reactor, state-of-the-art component-based client side MVVM implementation with Angular 2, ngrx (Redux pattern), TypeScript and reactive WebSockets.
IPT High Performance Reactive Programming with JAVA 8 and JavaScriptTrayan Iliev
Presentation @ jProfessionals BGJUG Conference
Sofia, November 22, 2015 by IPT – IT Education Evolved, High Performance Reactive Programming Workshop - Dec 15-17,2015 http://iproduct.org/en/course-reactive-java-js/
You are welcome to join us!
Low-latency, high-throughput reactive and functional programming in Java using Spring Reactor, RxJava, RxJS, Facebook React, Angular 2, Reactive Streams, Disruptor (ring buffer), Reactor & Proactor design patterns, benchmarking & comparison of concurrency implementations. December 15 - 17, 2015 - Workshop: High Performance Reactive Programming with JAVA 8 and JavaScript - http://iproduct.org/en/course-reactive-java-js/
Sensor data is streamed in realtime from Arduino + accelerometeres, gyroscopes & compass 3D, ultrasound distance sensor, etc. using UDP protocol. The data processing is done with reactive Java alterantive implementations: callbacks, CompletableFutures and using Spring 5 Reactor library. The web 3D visualization with Three.js is streamed using Server Sent Events (SSE).
A video for the IoT demo is available @YouTube: https://www.youtube.com/watch?v=AB3AWAfcy9U
All source code of the demo is freely available @GitHub: https://github.com/iproduct/reactive-demos-iot
There are more reactive Java demos in the same repository - callbacks, CompletableFuture, realtime event streaming. Soon I'll add a description how to build the device and upload Arduino sketch, as well as describe CompletableFuture and Reactor demos and 3D web visualization part with Three.js. Please stay tuned :)
Presentation from BGOUG conference Nov 17, 2017.
Since September 2017, Java 9 is generally available. It offers many enhancements:
• Modularity – provides clear separation between public and private APIs, stronger encapsulation & dependency management.
• JShell – using and customizing Java 9 interactive shell by example
• Process API updates – feature-rich, async OS process management and statistics
• Reactive Streams, CompletableFuture and Stream API updates
• Building asynchronous HTTP/2 and WebSocket pipelines using HTTP/2 Client and CompletableFuture composition
• Collection API updates
• Stack walking, and other language enhancements (Project Coin)
Discussed topics are accompanied by live demos available for further review @ github.com/iproduct.
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
On November 27 Trayan Iliev from IPT presented “Reactive microservices with Spring 5: WebFlux” @Dev.bg in Betahaus Sofia. IPT – Intellectual Products & Technologies has been organizing Java & JavaScript trainings since 2003.
Spring 5 introduces a new model for end-to-end functional and reactive web service programming with Spring 5 WebFlow, Spring Data & Spring Boot. The main topics include:
– Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure)
– REST services with WebFlux – comparison between annotation-based and functional reactive programming approaches for building.
– Router, handler and filter functions
– Using reactive repositories and reactive database access with Spring Data. Building end-to-end non-blocking reactive web services using Netty-based web runtime
– Reactive WebClients and integration testing. Reactive WebSocket support
– Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
Stream Processing with CompletableFuture and Flow in Java 9Trayan Iliev
Stream based data / event / message processing becomes preferred way of achieving interoperability and real-time communication in distributed SOA / microservice / database architectures.
Beside lambdas, Java 8 introduced two new APIs explicitly dealing with stream data processing:
- Stream - which is PULL-based and easily parallelizable;
- CompletableFuture / CompletionStage - which allow composition of PUSH-based, non-blocking, asynchronous data processing pipelines.
Java 9 will provide further support for stream-based data-processing by extending the CompletableFuture with additional functionality – support for delays and timeouts, better support for subclassing, and new utility methods.
More, Java 9 provides new java.util.concurrent.Flow API implementing Reactive Streams specification that enables reactive programming and interoperability with libraries like Reactor, RxJava, RabbitMQ, Vert.x, Ratpack, and Akka.
The presentation will discuss the novelties in Java 8 and Java 9 supporting stream data processing, describing the APIs, models and practical details of asynchronous pipeline implementation, error handling, multithreaded execution, asyncronous REST service implementation, interoperability with existing libraries.
There are provided demo examples (code on GitHub) using Completable Future and Flow with:
- JAX-RS 2.1 AsyncResponse, and more importantly unit-testing the async REST service method implementations;
- CDI 2.0 asynchronous observers (fireAsync / @ObservesAsync);
The document outlines a presentation given by Trayan Iliev on building robots with Java. It discusses various robotics platforms that can be used like Lego Mindstorms, Raspberry Pi, Arduino, and shows example Java code for controlling motors and sensors on a Lego robot using the LeJOS library. The code sample moves the robot forward until detecting an obstacle based on color sensor readings, then backs up and turns to repeat the process in a loop.
The document discusses the Disruptor, a high performance inter-thread messaging library created by LMAX. It introduces key concepts like the ring buffer, producer-consumer pattern, and consumer dependency graphs. It then explains the Disruptor architecture which uses a multithreaded producer to populate a ring buffer of event data which is consumed by handler threads in a specified order without blocking. Finally, it outlines examples of unicast, multicast and pipelined consumer configurations and references additional resources to learn more about the Disruptor and related concurrency concepts.
Why Are Digital Disruptors Successful And How Can You Become One? VMware Tanzu
Who are the leading digital disruptors, and what if you were able to identify the secret of their success and apply it to your business? In this session we will do exactly that: review which digital businesses are successful and why, identifying the capabilities you need to be a successful digital business.
Speaker: Rached Dabboussi, Regional Director, Middle East, Pivotal
Презентация на Български от Open Fest 2015.
Презентацията е насочена към хора, които желаят да използват Yocto и OpenEmbedded, за да разработват системи, които пасват на техните нужди и поддържат специфичен хардуер. С течение на времето Yocto се утвърди като де факто стандарт за вградени системи и преносими устройства. Ще бъде предоставена информация как да се изгради Linux система за вградени устроиства и да се създадат софтуерни приложения за нея.
The document discusses the Disruptor, an ultrafast communication framework. It describes the problems with traditional concurrent queues, such as lock contention. The Disruptor uses a novel ring buffer approach with barriers to allow producers to add events and consumers to process them in parallel without synchronization overhead. This architecture enables it to achieve throughput of over 6 million transactions per second. The Disruptor exploits hardware characteristics to achieve extremely low latency communication between threads.
MVC 1.0 is an action-oriented framework building on experience with previous frameworks such as Struts, Spring MVC, VRaptor etc. It is based on JAX-RS, CDI and BeanValidation JavaEE technologies and provides a standard, view specification neutral way to build web applications. Among supported view template frameworks are: JSP, Facelets, Freemarker, Handlebars, Jade, Mustache, Velocity, Thymeleaf, etc.
NOTE: MVC 1.0 JavaEE 8 API Specification is in early draft stage, and is subject to change based on open community process.
This document discusses challenges in writing concurrent programs and provides examples of concurrency techniques. It explains that hardware and compiler optimizations can result in unexpected program behaviors. It then describes memory model definitions, performance patterns like LMAX and RCU, and security issues such as timing side-channel attacks using Intel TSX. The goal is to understand how to write correct and efficient concurrent code despite relaxed memory consistency models.
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOpen Mobile Alliance
Julien Vermillard from Sierra Wireless presented during the Open Mobile Alliance LwM2M Workshop event on January 28, 2015. This is a copy of the slides presented for his session titled, "OMA LwM2M Projects in Eclipse Foundation".
Successful Disruption: how to be the disruptor not disruptedAndy Ng
We all know that disruption is here to stay, but how can we be the disruptor and not disrupted? In this short but high impact seminar, AndyTheCoach at www.asiatrainers.com share with us secrets to succeed in today's world: successful disruption. Watch Andy's videos at www.youtube.com/AndyNgCoach/videos
SemIoT is a project funded by The Ministry of Education and Science of Russian Federation which aims to provide an access to sensor networks using unified data models and interfaces that hide heterogeneity of the network and facilitate effective data access, interoperability, resource search and discovery
Concurrent Programming Using the DisruptorTrisha Gee
Presented to the London Java Community at Skillsmatter on 1st March 2012.
Full presentation can be viewed here: http://skillsmatter.com/podcast/home/the-disruptor/js-3798
This document provides an overview of a hands-on workshop on the Constrained Application Protocol (CoAP). It outlines the agenda which includes introductions to CoAP, the Californium CoAP framework, and hands-on projects. Attendees will work through example CoAP client and server code using the Californium libraries and test their implementations. Advanced CoAP topics like security, proxies, and resource directories are also discussed.
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Julien Vermillard
M2M/IoT is rapidly growing and since its early days different “standard” protocols have emerged (e.g. OMA-DM, TR-069, MQTT, …) or are emerging (e.g. CoAP or Lightweight M2M). Understanding which protocol to use for which application can be intimidating, therefore we propose to give an overview of these protocols to help you understand their goals and characteristics. We’ll present common M2M use cases and why they usually require more than just one protocol ; we will also see whether CoAP associated with Lightweight M2M allows to forge “one protocol to rule them all”.
Standards are driving the growth of the Internet of Things by enabling new business models, rapid development, and global markets. Key standardization activities include work by the IETF on networking protocols like IPv6, CoAP, and security, as well as work by OMA, IPSO Alliance, and OneM2M on lightweight M2M, web objects, and a common M2M system standard. Building a Web of Things involves using standards like CoAP, 6LoWPAN, and IPSO web objects to connect M2M devices to backend systems over various network types.
My slide at the Milan Codemotion 2015, a session called "An Adventure with ESP8266 and IOT" about using the esp8266 with NodeMCU, mosquitto, nodejs and an accelerometer. All the sourcecode will be available at http://pestohacks.blogspot.com soon
The Internet of Things is rising fast, but how to run it safely and efficiently using standards?
OMA Lightweight M2M is the brand new IoT protocol for managing smart objects. It provides answers to the typical IoT needs: monitoring, configuring, securing and upgrading devices.
It’s bandwidth efficient and fits in constrained embedded environments while providing friendly and discoverable RESTful API.
This tutorial aims at giving you a hands-on experience with Lightweight M2M by showing you the power and simplicity of the Eclipse Leshan library for managing real world IoT application.
Agenda:
- Introduction to CoAP and Lightweight M2M
- Demo and live discovery of a connected smartwatch
- Presentation of Eclipse Leshan, a lightweight M2M implementation for Java
- Code your own Java server, and start managing fleet of smartwatches!
- Presentation of more advanced lightweight M2M topic: firmware upgrade, security, bootstrap, Wakaama and Tinydtls
- Code a smartwatch application using Lightweight M2M
Zach Shelby, Chief Nerd and co-founder of Sensinode, gives a high-level tutorial of the new OMA Lightweight M2M standard for Device Management, Network Mangement and Application Data for the Internet of Things. This new CoAP and DTLS based standard provides a complete system interface solution for M2M devices and services.
This document provides a summary of an ESP8266 workshop covering:
- Introduction to the ESP8266 hardware and software
- Setting up ESP-01 and ESP-12 modules for development
- Flashing firmware using esptool
- Introduction to NodeMCU and Lua
- Using the ESPlorer IDE
- Examples of using buttons, LEDs, WiFi, UDP, and MQTT with the ESP8266
The document introduces Akka, an open-source toolkit for building distributed, concurrent applications on the JVM. It provides a programming model called the actor model that makes it easier to build scalable and fault-tolerant systems. Actors process messages asynchronously and avoid shared state, providing a simpler approach to concurrency than traditional threads and locks. Akka allows actors to be distributed across a network, enabling applications to scale out elastically.
A reference architecture for the internet of thingsCharles Gibbons
The document proposes a reference architecture for the Internet of Things (IoT). It consists of distributed devices that communicate using various protocols. These devices are supported by a distributed service layer that provides functions like messaging, data transformation and protocol support. This service layer connects to business support systems providing capabilities like fulfilment, assurance and billing. The architecture supports various channels for device management and integration with identity management systems.
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
The document discusses reactive microservices using Spring 5 WebFlux. It introduces reactive programming concepts like Reactive Streams and Project Reactor. It explains how Spring 5 supports reactive programming with WebFlux, reactive repositories, and hot event streaming. Code examples for WebFlux routing, handlers, and reactive clients are available on GitHub.
Spring 5 Webflux - Advances in Java 2018Trayan Iliev
The document discusses a presentation on functional reactive services with Spring 5 WebFlux. It introduces functional reactive programming (FRP), Project Reactor, building REST services with Spring 5 WebFlux including routers, handlers, filters, and reactive repositories. It also covers end-to-end non-blocking reactive service-oriented architecture with Netty, reactive WebClients, and real-time event streaming to JavaScript clients using server-sent events (SSE). The presentation code examples are available on GitHub.
The document outlines a presentation given by Trayan Iliev on building robots with Java. It discusses various robotics platforms that can be used like Lego Mindstorms, Raspberry Pi, Arduino, and shows example Java code for controlling motors and sensors on a Lego robot using the LeJOS library. The code sample moves the robot forward until detecting an obstacle based on color sensor readings, then backs up and turns to repeat the process in a loop.
The document discusses the Disruptor, a high performance inter-thread messaging library created by LMAX. It introduces key concepts like the ring buffer, producer-consumer pattern, and consumer dependency graphs. It then explains the Disruptor architecture which uses a multithreaded producer to populate a ring buffer of event data which is consumed by handler threads in a specified order without blocking. Finally, it outlines examples of unicast, multicast and pipelined consumer configurations and references additional resources to learn more about the Disruptor and related concurrency concepts.
Why Are Digital Disruptors Successful And How Can You Become One? VMware Tanzu
Who are the leading digital disruptors, and what if you were able to identify the secret of their success and apply it to your business? In this session we will do exactly that: review which digital businesses are successful and why, identifying the capabilities you need to be a successful digital business.
Speaker: Rached Dabboussi, Regional Director, Middle East, Pivotal
Презентация на Български от Open Fest 2015.
Презентацията е насочена към хора, които желаят да използват Yocto и OpenEmbedded, за да разработват системи, които пасват на техните нужди и поддържат специфичен хардуер. С течение на времето Yocto се утвърди като де факто стандарт за вградени системи и преносими устройства. Ще бъде предоставена информация как да се изгради Linux система за вградени устроиства и да се създадат софтуерни приложения за нея.
The document discusses the Disruptor, an ultrafast communication framework. It describes the problems with traditional concurrent queues, such as lock contention. The Disruptor uses a novel ring buffer approach with barriers to allow producers to add events and consumers to process them in parallel without synchronization overhead. This architecture enables it to achieve throughput of over 6 million transactions per second. The Disruptor exploits hardware characteristics to achieve extremely low latency communication between threads.
MVC 1.0 is an action-oriented framework building on experience with previous frameworks such as Struts, Spring MVC, VRaptor etc. It is based on JAX-RS, CDI and BeanValidation JavaEE technologies and provides a standard, view specification neutral way to build web applications. Among supported view template frameworks are: JSP, Facelets, Freemarker, Handlebars, Jade, Mustache, Velocity, Thymeleaf, etc.
NOTE: MVC 1.0 JavaEE 8 API Specification is in early draft stage, and is subject to change based on open community process.
This document discusses challenges in writing concurrent programs and provides examples of concurrency techniques. It explains that hardware and compiler optimizations can result in unexpected program behaviors. It then describes memory model definitions, performance patterns like LMAX and RCU, and security issues such as timing side-channel attacks using Intel TSX. The goal is to understand how to write correct and efficient concurrent code despite relaxed memory consistency models.
OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse FoundationOpen Mobile Alliance
Julien Vermillard from Sierra Wireless presented during the Open Mobile Alliance LwM2M Workshop event on January 28, 2015. This is a copy of the slides presented for his session titled, "OMA LwM2M Projects in Eclipse Foundation".
Successful Disruption: how to be the disruptor not disruptedAndy Ng
We all know that disruption is here to stay, but how can we be the disruptor and not disrupted? In this short but high impact seminar, AndyTheCoach at www.asiatrainers.com share with us secrets to succeed in today's world: successful disruption. Watch Andy's videos at www.youtube.com/AndyNgCoach/videos
SemIoT is a project funded by The Ministry of Education and Science of Russian Federation which aims to provide an access to sensor networks using unified data models and interfaces that hide heterogeneity of the network and facilitate effective data access, interoperability, resource search and discovery
Concurrent Programming Using the DisruptorTrisha Gee
Presented to the London Java Community at Skillsmatter on 1st March 2012.
Full presentation can be viewed here: http://skillsmatter.com/podcast/home/the-disruptor/js-3798
This document provides an overview of a hands-on workshop on the Constrained Application Protocol (CoAP). It outlines the agenda which includes introductions to CoAP, the Californium CoAP framework, and hands-on projects. Attendees will work through example CoAP client and server code using the Californium libraries and test their implementations. Advanced CoAP topics like security, proxies, and resource directories are also discussed.
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Julien Vermillard
M2M/IoT is rapidly growing and since its early days different “standard” protocols have emerged (e.g. OMA-DM, TR-069, MQTT, …) or are emerging (e.g. CoAP or Lightweight M2M). Understanding which protocol to use for which application can be intimidating, therefore we propose to give an overview of these protocols to help you understand their goals and characteristics. We’ll present common M2M use cases and why they usually require more than just one protocol ; we will also see whether CoAP associated with Lightweight M2M allows to forge “one protocol to rule them all”.
Standards are driving the growth of the Internet of Things by enabling new business models, rapid development, and global markets. Key standardization activities include work by the IETF on networking protocols like IPv6, CoAP, and security, as well as work by OMA, IPSO Alliance, and OneM2M on lightweight M2M, web objects, and a common M2M system standard. Building a Web of Things involves using standards like CoAP, 6LoWPAN, and IPSO web objects to connect M2M devices to backend systems over various network types.
My slide at the Milan Codemotion 2015, a session called "An Adventure with ESP8266 and IOT" about using the esp8266 with NodeMCU, mosquitto, nodejs and an accelerometer. All the sourcecode will be available at http://pestohacks.blogspot.com soon
The Internet of Things is rising fast, but how to run it safely and efficiently using standards?
OMA Lightweight M2M is the brand new IoT protocol for managing smart objects. It provides answers to the typical IoT needs: monitoring, configuring, securing and upgrading devices.
It’s bandwidth efficient and fits in constrained embedded environments while providing friendly and discoverable RESTful API.
This tutorial aims at giving you a hands-on experience with Lightweight M2M by showing you the power and simplicity of the Eclipse Leshan library for managing real world IoT application.
Agenda:
- Introduction to CoAP and Lightweight M2M
- Demo and live discovery of a connected smartwatch
- Presentation of Eclipse Leshan, a lightweight M2M implementation for Java
- Code your own Java server, and start managing fleet of smartwatches!
- Presentation of more advanced lightweight M2M topic: firmware upgrade, security, bootstrap, Wakaama and Tinydtls
- Code a smartwatch application using Lightweight M2M
Zach Shelby, Chief Nerd and co-founder of Sensinode, gives a high-level tutorial of the new OMA Lightweight M2M standard for Device Management, Network Mangement and Application Data for the Internet of Things. This new CoAP and DTLS based standard provides a complete system interface solution for M2M devices and services.
This document provides a summary of an ESP8266 workshop covering:
- Introduction to the ESP8266 hardware and software
- Setting up ESP-01 and ESP-12 modules for development
- Flashing firmware using esptool
- Introduction to NodeMCU and Lua
- Using the ESPlorer IDE
- Examples of using buttons, LEDs, WiFi, UDP, and MQTT with the ESP8266
The document introduces Akka, an open-source toolkit for building distributed, concurrent applications on the JVM. It provides a programming model called the actor model that makes it easier to build scalable and fault-tolerant systems. Actors process messages asynchronously and avoid shared state, providing a simpler approach to concurrency than traditional threads and locks. Akka allows actors to be distributed across a network, enabling applications to scale out elastically.
A reference architecture for the internet of thingsCharles Gibbons
The document proposes a reference architecture for the Internet of Things (IoT). It consists of distributed devices that communicate using various protocols. These devices are supported by a distributed service layer that provides functions like messaging, data transformation and protocol support. This service layer connects to business support systems providing capabilities like fulfilment, assurance and billing. The architecture supports various channels for device management and integration with identity management systems.
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
The document discusses reactive microservices using Spring 5 WebFlux. It introduces reactive programming concepts like Reactive Streams and Project Reactor. It explains how Spring 5 supports reactive programming with WebFlux, reactive repositories, and hot event streaming. Code examples for WebFlux routing, handlers, and reactive clients are available on GitHub.
Spring 5 Webflux - Advances in Java 2018Trayan Iliev
The document discusses a presentation on functional reactive services with Spring 5 WebFlux. It introduces functional reactive programming (FRP), Project Reactor, building REST services with Spring 5 WebFlux including routers, handlers, filters, and reactive repositories. It also covers end-to-end non-blocking reactive service-oriented architecture with Netty, reactive WebClients, and real-time event streaming to JavaScript clients using server-sent events (SSE). The presentation code examples are available on GitHub.
This document provides an overview and introduction to reactive robotics and the Internet of Things (IoT). It discusses several key concepts including reactive programming, functional reactive programming, and high-performance reactive Java. It also covers topics like concurrency, parallelism, queues, and the LMAX Disruptor design pattern. Code examples are provided to demonstrate reactive programming concepts using tools like RxJava. The document aims to explain reactive approaches that can help address complexity in robotics and IoT systems.
The document discusses various topics related to reactive and functional programming including NGRX, RxJS, Redux, Reactive Streams specification, and computing derived data using Reselect. It provides code examples for setting up an NGRX application with state management, effects, selectors, and composing the root reducer. It also discusses hot and cold streams, converting cold streams to hot, and the anatomy of RxJS operators.
Reactive Java Robotics & IoT with Spring ReactorTrayan Iliev
On April 4-th, 2017 in cosmos coworking camp – Sofia, Trayan Iliev will talk about “Reactive Java Robotics and IoT with Spring Reactor” (http://robolearn.org/reactive-java-robotics-iot-spring-reactor/).
The event is organized by DEV.BG and it is part from the user group Internet of Things.
Program:
1. Robotics, IoT & Complexity. Domain-Driven Design (DDD). Reactive programming. Reactive Streams (java.util.concurrent.Flow);
2. High performance non-blocking asynchronous programming on JVM using Reactor project (using Disruptor/RingBuffer);
3. Implementig reactive hot event streams processing with Reactor: Flux & Mono, Processors;
4. End-to-end reactive web applications and services: Reactor IO (REST, WebSocket) + RxJS + Angular 2;
5. IPTPI robot demo – reactive hot event streams processing on Raspberry Pi 2 + Arduino with embedded and mobile interfaces: http://robolearn.org/
For the lecturer: Trayan Iliev
– founder and manager of IPT – Intellectual Products & Technologies (http://iproduct.org/) – company for IT trainings and consultancy, specialized in Java, Fullstack JavaScipt, web and mobile technologies
– 15+ years training and consulting experience
– lecturer on the conferences, organized by BGJUG and BGOUG – 9 presentations
– organizer of hackathons on Java robotics & IoT in Sofia and Plovdiv
– presenter on international developer conferences: jPrime, jPofessionals, Voxxed Days
This document provides a disclaimer and overview of a presentation on reactive Java, robotics, and IoT using technologies like Reactor, RxJava, Angular 2, and Raspberry Pi. It discusses key concepts like reactive programming, reactive streams, functional reactive programming, and achieving high performance. The presentation will include tales about robotics complexity, domain-driven design, imperative vs reactive programming, and code demonstrations.
Mary Grygleski and myself, gave a very successful workshop to 51 attendees in NYC on April 15th - here is the updated presentation
https://www.linkedin.com/in/mary-grygleski/
https://www.linkedin.com/in/grant-steinfeld/
Reactor is a foundational library for building reactive, fast data applications on the JVM. It provides components and abstractions like selectors, streams, and promises that allow applications to route and process events asynchronously at high throughput and low latency. Reactor draws from other reactive patterns and libraries and is used in various Pivotal projects like Spring and Spring XD to enable fast, event-driven architectures.
Making Machine Learning Easy with H2O and WebFluxTrayan Iliev
Machine learning is becoming a must for many business domains and applications. H2O is a best-of-breed, open source, distributed machine learning library written in Java. The presentation shows how to create and train machine learning models easily using H2O Flow web interface, including Deep Learning Neural Networks (DNNs). The session provides a tutorial how to develop and deploy fullstack-reactive face recognition demo using React + RxJS WebSocket front-end, OpenCV, Caffe CNN for image segmentation, OpenFace CNN for feature extraction, H20 Flow for face recognition interactive model training and export as POJO. The trained POJO model is incorporated in a real-time streaming web service implemented using Spring 5 Web Flux and Spring Boot. All demo is 100% Java!
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleSean Zhong
Gearpump is a Akka based realtime streaming engine, it use Actor to model everything. It has super performance and flexibility. It has performance of 18000000 messages/second and latency of 8ms on a cluster of 4 machines.
Microservices Part 4: Functional Reactive ProgrammingAraf Karsh Hamid
ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming. It combines the Observer pattern, Iterator pattern, and functional programming concepts. ReactiveX allows for asynchronous and event-based programming by using the Observer pattern to push data to observers, rather than using a synchronous pull-based approach.
How Java 19 Influences the Future of Your High-Scale Applications .pdfAna-Maria Mihalceanu
Java 19 introduces several new features and improvements to help applications scale better. These include virtual threads which allow efficient asynchronous programming without blocking threads, pattern matching for more readable code, and improvements to JNI for safer native code integration. Java 19 also deprecates some legacy methods and makes timezone data updates to improve sustainability. Overall, the release focuses on enhancing scalability and maintainability for high performance applications.
The word "Reactive" can be confusing. As the founder of the Reactive Amsterdam meetup, I can tell there are two main topics here: Functional Reactive Programming (here with reference to Android) and "Reactive" in the sense of the Reactive Manifesto.
This document discusses Typesafe's Reactive Platform and Apache Spark. It describes Typesafe's Fast Data strategy of using a microservices architecture with Spark, Kafka, HDFS and databases. It outlines contributions Typesafe has made to Spark, including backpressure support, dynamic resource allocation in Mesos, and integration tests. The document also discusses Typesafe's customer support and roadmap, including plans to introduce Kerberos security and evaluate Tachyon.
OS for AI: Elastic Microservices & the Next Gen of MLNordic APIs
AI has been a hot topic lately, with advances being made constantly in what is possible, there has not been as much discussion of the infrastructure and scaling challenges that come with it. How do you support dozens of different languages and frameworks, and make them interoperate invisibly? How do you scale to run abstract code from thousands of different developers, simultaneously and elastically, while maintaining less than 15ms of overhead?
At Algorithmia, we’ve built, deployed, and scaled thousands of algorithms and machine learning models, using every kind of framework (from scikit-learn to tensorflow). We’ve seen many of the challenges faced in this area, and in this talk I’ll share some insights into the problems you’re likely to face, and how to approach solving them.
In brief, we’ll examine the need for, and implementations of, a complete “Operating System for AI” – a common interface for different algorithms to be used and combined, and a general architecture for serverless machine learning which is discoverable, versioned, scalable and sharable.
Akshay Kalghatgi is seeking a full-time position in computer engineering. He has a M.S. in Computer Engineering from Arizona State University and is currently interning at Limelight Networks where he works on consolidating their network infrastructure and internal systems. Previously, he worked at Tata Consultancy Services as a Systems Engineer developing PLC and HMI/SCADA systems for water utilities. He has strong skills in programming languages like Python, C/C++, and Java as well as software like Linux, git, MySQL, and more. For his projects, he has worked on areas like Linux device drivers, distributed systems, real-time systems, and more.
This document discusses functional reactive programming and RxJava. It begins with an overview of functional reactive programming principles like being responsive, resilient, elastic and message-driven. It then covers architectural styles like hexagonal architecture and onion architecture. The rest of the document dives deeper into RxJava concepts like Observables, Observers, Operators, and Schedulers. It provides code examples to demonstrate merging, filtering and transforming streams of data asynchronously using RxJava.
Reactive Programming on Android - RxAndroid - RxJavaAli Muzaffar
Introduction to RxJava for reactive programming and how to use RxAndroid to do reactive programming on Android.
There is a sample android app to go with the slides that has all the source shown in the project.
Covers how we built a set of high-speed reactive microservices and maximized cloud/hardware costs while meeting objectives in resilience and scalability. Talks about Akka, Kafka, QBit, in-memory computing, from a practitioners point of view. Based on the talks delivered by Geoff Chandler, Jason Daniel, and Rick Hightower at JavaOne 2016 and SF Fintech at Scale 2017, but updated.
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-orsLee Calcote
The document provides an overview and comparison of several container orchestration platforms: Docker Swarm, Kubernetes, and Mesos/Marathon. It characterizes each based on their origins, support levels, scheduling approaches, modularity, updating processes, networking implementations, and abilities to scale and maintain high availability. While each has strengths for certain use cases, no single orchestrator is argued to be universally superior.
Similaire à IPT High Performance Reactive Java BGOUG 2016 (20)
Rapid Web API development with Kotlin and KtorTrayan Iliev
Introduction to Kotlin and Ktor with flow, async and channel examples. Ktor is an async web framework with minimal ceremony that leverages the advantages of Kotlin like coroutines and extensible functional DSLs..
Learning Programming Using Robots - Sofia University Conference 2018 Trayan Iliev
Learn information technologies by creating your own robots and IoT projects. Robotics and IoT offer rich opportunities for practical and active learning of core information technologies, programming languages and software architectures. Presentation includes examples of teaching practices and robotics projects, and offers suggestions why and how to use them to achieve better students' motivation, engagement, creativity, and connection between theory and practice.
Active Learning Using Connected Things - 2018 (in Bulgarian)Trayan Iliev
Learn about active learning methods and practices using Robotics, IoT, and "smart things" projects. Includes examples of teaching practices and robotics projects, and offers suggestions why and how to use them to achieve better students' motivation, engagement, creativity, and connection between theory and practice. Several blended learning models are compared - Flipped Classroom, Stations/Labs Rotation, Flex model. Project support for individual learning styles is discussed.
Fog computing is a system-level architecture that distributes computing, storage, control and networking functions closer to users along the continuum between IoT devices and the cloud. It aims to address issues like high latency and network congestion that result from processing all IoT data in the cloud. Key characteristics of fog computing include its ability to support location awareness, mobility and real-time interactions through a geographically distributed deployment.
Presentation discusses the best practices when writing higher order components (HOCs), and presents examples how to write them according to React recommendations.
Topics include: maximizing HOC factories composability, using ES7 decorators, wrapping context DI in HOCs, handling async state changes using RxJS Observanels and separation of concerns between presentation and business logic components. Examples (@GitHub projects - referenced in the presentation) are given using react, redux, react-router-redux, redux-observable, recompose, and reselect.
Hackathon: “IPTPI and LeJaRo Meet The Real World”Trayan Iliev
This document discusses a hackathon event called "RoboLearn Hackathon: IPTPI and LeJaRo meet the Real World" hosted in Sofia, Bulgaria on December 4, 2015. It introduces Trayan Iliev, the presenter, and his company IPT that specializes in Java training. The presentation covers how to build robots with Java platforms like Lego Mindstorms, Raspberry Pi, Arduino and others. Code examples are provided for controlling motors and sensors on Lego robots using the LeJOS Java library.
Presentation is highlighting novelties in SPA development with Angular 2 (+Ionic 2 demo) with real code examples.
We created together simple Ng2 application with Angular CLI.
All the code is available on GitHub (link to demos is at the end of presentation).
Prerequisites:
1. Install NodeJS. It is better to install version 6 or 4x. Read about NPM.
2. Install TypeScript + editor (Visual Studio Code or Sublime 3).
3. Install Angular 2 Command Line Interface (Angular CLI):
npm install -g angular-cli
IPT Workshops on Java Robotics and IoTTrayan Iliev
Learn how to build your own robot & how to program it in Java with IPT workshops & hackathons. Two small robots: LeJaRo - "the leJOS java robot" & IPTPI - Raspberry Pi 2 enabled robot with higher processing capabilities + distance US and optical sensors, line follow sensor array, cameras, encoders and more. Get first hand experience and jump start in JAVA robotics. Find more on http://robolearn.org/. Children of ALL AGES are Welcome :)
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Trayan Iliev
Presentation shows by example (IPT Polling Demo JAXRS20 HATEOAS, https://github.com/iproduct/IPT-Polling-Demo-JAXRS20-HATEOAS/wiki) the novelties in JAX-RS 2.0 and REST HATEOAS:
- Standardized REST Client API;
- Client and server-side asynchronous HTTP request processing;
- Integration of declarative validation using JSR 349: Bean Validation 1.1;
- Improved server-suggested content negotiation;
- Aspect-oriented extensibility of request/response processing using Filters and Interceptors;
- Dynamic extension registration using DynamicFeature interface;
- Hypermedia As The Engine Of Application State (HATEOAS) REST architectural constraint support using state transition links (support for new HTTP Link header as well as JAXB serialization of resource links).
[IPT, http://iproduct.org]
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
When it is all about ERP solutions, companies typically meet their needs with common ERP solutions like SAP, Oracle, and Microsoft Dynamics. These big players have demonstrated that ERP systems can be either simple or highly comprehensive. This remains true today, but there are new factors to consider, including a promising new contender in the market that’s Odoo. This blog compares Odoo ERP with traditional ERP systems and explains why many companies now see Odoo ERP as the best choice.
What are ERP Systems?
An ERP, or Enterprise Resource Planning, system provides your company with valuable information to help you make better decisions and boost your ROI. You should choose an ERP system based on your company’s specific needs. For instance, if you run a manufacturing or retail business, you will need an ERP system that efficiently manages inventory. A consulting firm, on the other hand, would benefit from an ERP system that enhances daily operations. Similarly, eCommerce stores would select an ERP system tailored to their needs.
Because different businesses have different requirements, ERP system functionalities can vary. Among the various ERP systems available, Odoo ERP is considered one of the best in the ERp market with more than 12 million global users today.
Odoo is an open-source ERP system initially designed for small to medium-sized businesses but now suitable for a wide range of companies. Odoo offers a scalable and configurable point-of-sale management solution and allows you to create customised modules for specific industries. Odoo is gaining more popularity because it is built in a way that allows easy customisation, has a user-friendly interface, and is affordable. Here, you will cover the main differences and get to know why Odoo is gaining attention despite the many other ERP systems available in the market.
What is Master Data Management by PiLog Groupaymanquadri279
PiLog Group's Master Data Record Manager (MDRM) is a sophisticated enterprise solution designed to ensure data accuracy, consistency, and governance across various business functions. MDRM integrates advanced data management technologies to cleanse, classify, and standardize master data, thereby enhancing data quality and operational efficiency.
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j
Dr. Jesús Barrasa, Head of Solutions Architecture for EMEA, Neo4j
Découvrez les dernières innovations de Neo4j, et notamment les dernières intégrations cloud et les améliorations produits qui font de Neo4j un choix essentiel pour les développeurs qui créent des applications avec des données interconnectées et de l’IA générative.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsPeter Muessig
The UI5 tooling is the development and build tooling of UI5. It is built in a modular and extensible way so that it can be easily extended by your needs. This session will showcase various tooling extensions which can boost your development experience by far so that you can really work offline, transpile your code in your project to use even newer versions of EcmaScript (than 2022 which is supported right now by the UI5 tooling), consume any npm package of your choice in your project, using different kind of proxies, and even stitching UI5 projects during development together to mimic your target environment.
SOCRadar's Aviation Industry Q1 Incident Report is out now!
The aviation industry has always been a prime target for cybercriminals due to its critical infrastructure and high stakes. In the first quarter of 2024, the sector faced an alarming surge in cybersecurity threats, revealing its vulnerabilities and the relentless sophistication of cyber attackers.
SOCRadar’s Aviation Industry, Quarterly Incident Report, provides an in-depth analysis of these threats, detected and examined through our extensive monitoring of hacker forums, Telegram channels, and dark web platforms.
1. Trayan Iliev
CEO of IPT – Intellectual
Products & Technologies
tiliev@iproduct.org
http://iproduct.org
BGOUG Conference
June 3-5 ‘16, Borovetz
High Performance
Reactive Programing
with Java 8
2. 2
IPT – Intellectual Products &
Technologies: IT Education Evolved
Since 2003 we provide trainings and share skills &
knowledge in Java SE/ EE/ Web/ JS/ Angular / React:
Java EE/Web, JSF 2, Portlets, Portals: Liferay, GateIn
Reactive IoT with Reactor / RxJava / RxJS
Angular 2 + Ionic 2+ TypeScript web/mobile client MV*
frameworks
REST HATEOAS – Distributed Hypermedia APIs
Domain Driven Design, Reactive Microservices,
CQRS and Event Sourcing
Oracle® & Java™ are (registered) trademarks of Oracle and/or its affiliates. Liferay® is
registered trademark of Liferay, Inc. Other names may be trademarks of their respective owners.
3. 3
High Performnce Reactive JAVA
Reactive programming. Reactor & Proactor design
patterns. Reactive Streams (java.util.concurrent.Flow)
High performance non-blocking asynchronous apps
on JVM using Reactor project & RxJava
Disruptor (RingBuffer), Flux & Mono, Processors
End-to-end reactive web applications and services:
Reactor IO (REST, WebSocket) + RxJS + Angular 2
Demo - reactive hot event streams processing on
Raspberry Pi 2 (ARM v7) based robot IPTPI.
RxJava (not Zen only :) coans for self assessment
4. 4
The Internet of Things has the potential to change the
world, just as the Internet did. Maybe even more so.
Nearly 50 petabytes of data are captured and created
by human beings
People have limited time, attention and accuracy
Capturing data about things in the real world in real time
Track and count everything, reduce waste, loss & cost.
Know when things need replacing, repairing or recalling
— Kevin Ashton, 'That 'Internet of Things' Thing', RFID Journal,
2009
Internet of Things (IoT)
5. 5
Robots: The Most Intelligent Things
CC BY 2.0, Source:
https://www.flickr.com/photos/wilgengebroed/8249565455/
Radar, GPS, lidar for navigation and obstacle
avoidance ( 2007 DARPA Urban Challenge )
6. 6
Tracking Complexity
We need tools to cope with all that complexity inherent in
robotics and IoT domains.
Simple solutions are needed – cope with problems through
divide and concur on different levels of abstraction:
Domain Driven Design (DDD) – back to basics:
domain objects, data and logic.
Described by Eric Evans in his book:
Domain Driven Design: Tackling Complexity in the Heart of
Software, 2004
7. 7
Be Reactive: What It Really Means?
My Favourite Definition of
Reactive Streams :)
https://youtu.be/qybUFnY7Y8w
8. 8
Imperative and Reactive
We live in a Connected Universe
... there is hypothesis that all
the things in the Universe are
intimately connected, and you
can not change a bit without
changing all.
Action – Reaction principle is
the essence of how Universe
behaves.
9. 9
Imperative and Reactive
Reactive Programming: using static or dynamic data
flows and propagation of change
Example: a := b + c
Functional Programming: evaluation of mathematical
functions,
− Avoids changing-state and mutable data, declarative
programming
− Side effects free => much easier to understand and
predict the program behavior.
Example: books.stream().filter(book -> book.getYear() > 2010)
.forEach( System.out::println )
10. 10
Functional Reactive (FRP)
According to Connal Elliot's (ground-breaking paper @
Conference on Functional Programming, 1997), FRP is:
(a) Denotative
(b) Temporally continuous
13. 13
Reactive Streams Spec.
Reactive Streams – provides standard for
asynchronous stream processing with non-blocking
back pressure.
Minimal set of interfaces, methods and protocols for
asynchronous data streams
April 30, 2015: has been released version 1.0.0 of
Reactive Streams for the JVM (Java API,
Specification, TCK and implementation examples)
Java 9: java.util.concurrent.Flow
14. 14
Reactive Streams Spec.
Publisher – provider of potentially unbounded number
of sequenced elements, according to Subscriber(s)
demand.
Publisher.subscribe(Subscriber) => onSubscribe onNext*
(onError | onComplete)?
Subscriber – calls Subscription.request(long) to
receive notifications
Subscription – one-to-one Subscriber ↔ Publisher,
request data and cancel demand (allow cleanup).
Processor = Subscriber + Publisher
15. 15
FRP = Async Data Streams
FRP is asynchronous data-flow programming using the
building blocks of functional programming (e.g. map,
reduce, filter) and explicitly modeling time
Used for GUIs, robotics, and music. Example (RxJava):
Observable.from(
new String[]{"Reactive", "Extensions", "Java"})
.take(2).map(s -> s + " : on " + new Date())
.subscribe(s -> System.out.println(s));
Result:
Reactive : on Wed Jun 17 21:54:02 GMT+02:00 2015
Extensions : on Wed Jun 17 21:54:02 GMT+02:00 2015
16. 16
Performance is about 2 things (Martin Thompson –
http://www.infoq.com/articles/low-latency-vp ):
– Throughput – units per second, and
– Latency – response time
Real-time – time constraint from input to response
regardless of system load.
Hard real-time system if this constraint is not honored then
a total system failure can occur.
Soft real-time system – low latency response with little
deviation in response time
100 nano-seconds to 100 milli-seconds. [Peter Lawrey]
What About High Performance?
17. 17
Mechanical Sympathy – hardware (CPU, cache, memory,
IO, Network), operating system, language implementation
platform (e.g. JVM), and application level code are working
in harmony to minimize the time needed for event (request,
message) processing => 10% / 90% principle
Throughput vs. latency – bus vs. car traveling
Throughput ~ System Capacity / Latency
Achieving low latency may mean additional work done
by system => lowered System Capacity and Throughput
Horizontal scalability is valuable for high throughput. For
low latency, you need simplicity – critical path.
Throughput vs. Latency
18. 18
JVMs are often faster than custom C++ code because of the
holistic optimizations that they can apply across an application
[Andy Piper].
Developers can take advantage of hardware guarantees through
a detailed understanding of:
– Java Memory Model & mapping to underlying hardware
– low latency software system hardware (CPU, cache, memory,
IO, Network)
– avoiding lock-contention and garbage collection
– Compre-And-Swap – CAS (java.util.concurrent.atomic)
– lock-free, wait-free techniques – using standard libraries (e.g.
the LMAX Disruptor)
High Performance Java
19. 19
CPU Cache – False Sharing
Core 2 Core NCore 1 ...
Registers
Execution Units
L1 Cache A | | B |
L2 Cache A | | B |
L3 Cache A | | B |
DRAM Memory
A | | B |
Registers
Execution Units
L1 Cache A | | B |
L2 Cache A | | B |
20. 20
Low garbage by reusing existing objects + infrequent GC
when application not busy – can improve app 2 - 5x
JVM generational GC startegy – ideal for objects living very
shortly (garbage collected next minor sweep) or be immortal
Non-blocking, lockless coding or CAS
Critical data structures – direct memory access using
DirectByteBuffers or Unsafe => predictable memory layout
and cache misses avoidance
Busy waiting – giving the CPU to OS kernel slows program
2-5x => avoid context switches
Amortize the effect of expensive IO - blocking
Low Latency: Things to Remember
21. 21
Parallel tasks can increase your throughput by increasing
system capacity – it is GOOD!
But comes together with concurrent access to shared
resources => you have to provide mutual exclusion (MutEx)
by parallel threads when changing the resources' state (read
only access can be shared by multiple threads)
Mutual exclusion can be achieved in several ways:
– synchronized – hardwired in HotSpot JVM, optimized in J^6
– ReentrantLock, ReadWriteLock, StampedLock →
java.util.concurrent.locks.*
– Optimistic Locking → tryLock(), CAS
Parallelism & Concurrency
22. 22
Simple problem: incrementing a long value 500 000 000 times.
9 implementations:
‒ SynchronousCounter – while (counter++ < 500000000){}
‒ SingleThreadSynchronizedCounter – 1T using synchronized
‒ TwoThreadsSynchronizedCounter – 2T using synchronized
‒ SingleThreadCASCounter – 1T using AtomicLong
‒ TwoThreadsCASCounter – 2T using AtomicLong
‒ TwoThreadsCASCounterLongAdder – 1T using LongAdder
‒ SingleThreadVolatileCounter – 1T, memory barrier (volatile)
‒ TwoThreadsVolatileCounter – 2T, memory barrier (volatile)
Comparing Concurrent Impl.
23. 23
Test results (on my laptop - quad core Intel i7@2.2GHz):
− SynchronousCounter – 190ms
− SingleThreadSynchronizedCounter – 15000 ms
− TwoThreadsSynchronizedCounter – 21000 ms
− SingleThreadCASCounter – 4100 ms
− TwoThreadsCASCounter – 12000 ms
− TwoThreadsCASCounterLongAdder – 12800 ms
− SingleThreadVolatileCounter – 4100 ms
− TwoThreadsVolatileCounter – 20000 ms
Comparing Concurrent Impl.
24. 24
For more complete micro-benchmarking of
different Mutex implementations see:
http://blog.takipi.com/java-8-stampedlocks-vs-
readwritelocks-and-synchronized/
http://www.slideshare.net/haimyadid/java-8-
stamped-lock
Comparing Concurrent Impl.
25. 25
Non-blocking (synchronous) implementation is 2 orders of
magnitude better then synchronized
We should try to avoid blocking and especially contended
blocking if want to achieve low latency
If blocking is a must we have to prefer CAS and optimistic
concurrency over blocking (but have in mind it always
depends on concurrent problem at hand and how much
contention do we experience – test early, test often,
microbenchmarks are unreliable and highly platform dependent
– test real application with typical load patterns)
The real question is: HOW is is possible to build concurrency
without blocking?
Mutex Comparison => Conclusions
26. 26
Message Driven – asynchronous message-passing allows
to establish a boundary between components that ensures
loose coupling, isolation, location transparency, and
provides the means to delegate errors as messages
[Reactive Manifesto].
The main idea is to separate concurrent producer and
consumer workers by using message queues.
Message queues can be unbounded or bounded (limited
max number of messages)
Unbounded message queues can present memory
allocation problem in case the producers outrun the
consumers for a long period → OutOfMemoryError
Scalable, Massively Concurrent
27. 27
Queues typically use either linked-lists or arrays for the
underlying storage of elements. Linked lists are not
„mechanically sympathetic” – there is no predictable
caching “stride” (should be less than 2048 bytes in each
direction).
Bounded queues often experience write contention on
head, tail, and size variables. Even if head and tail
separated using CAS, they usually are in the same cache-
line.
Queues produce much garbage.
Typical queues conflate a number of different concerns –
producer and consumer synchronization and data storage
Queues Disadvantages
[http://lmax-exchange.github.com/disruptor/files/Disruptor-1.0.pdf]
28. 28
LMAX Disruptor design pattern separates different
concerns in a “mechanically sympathetic” way:
- Storage of items being exchanged
- Producer coordination – claiming the next sequence
- Consumers coordination – notified new item is available
Single Writer principle is employed when writing data in
the Ring Buffer from single producer thread only (no
contention),
When multiple producers → CAS
Memory pre-allocated – predictable stride, no garbage
LMAX Disruptor (RingBuffer)
[http://lmax-exchange.github.com/disruptor/files/Disruptor-1.0.pdf]
29. 29
LMAX Disruptor (RingBuffer) High Performance
[http://lmax-exchange.github.com/disruptor/files/Disruptor-
1.0.pdf]
Source: LMAX Disruptor github wiki - https://raw.githubusercontent.com/wiki/LMAX-
Exchange/disruptor/images/Models.png
LMAX-Exchange Disruptor License @ GitHub: Apache License Version 2.0, January 2004 -
http://www.apache.org/licenses/
30. 30
LMAX Disruptor (RingBuffer) High Performance
[http://lmax-exchange.github.com/disruptor/files/Disruptor-
1.0.pdf]
Source: LMAX Disruptor @ GitHub - https://github.com/LMAX-
Exchange/disruptor/blob/master/docs/Disruptor.docx
LMAX-Exchange Disruptor License @ GitHub: Apache License Version 2.0, January 2004 -
http://www.apache.org/licenses/
31. 31
Project Reactor
Reactor project allows building high-performance (low
latency high throughput) non-blocking asynchronous
applications on JVM.
Reactor is designed to be extraordinarily fast and can
sustain throughput rates on order of 10's of millions of
operations per second.
Reactor has powerful API for declaring data
transformations and functional composition.
Makes use of the concept of Mechanical Sympathy
built on top of Disruptor / RingBuffer.
32. 32
Project Reactor
Pre-allocation at startup-time
Message-passing structures are bounded
Using Reactive and Event-Driven Architecture patterns
=> non-blocking end-to-end flows, replies
Implement Reactive Streams Specification – efficient
bounded structures requesting no more than capacity
Applies above features to IPC and provides non-
blocking IO drivers that are flow-control aware
Expose a Functional API – organize their code in a
side-effect free way, which helps you determine you are
thread-safe and fault-tolerant
45. 45
LeJaRo: Lego®
Java Robot
Modular – 3 motors (with encoders) – one driving each
track, and third for robot clamp.
Three sensors: touch sensor (obstacle avoidance), light
color sensor (follow line), IR sensor (remote).
LeJaRo is programmed in Java using LeJOS library.
More information about LeJaRo:
http://robolearn.org/lejaro/
Programming examples available @GitHub:
https://github.com/iproduct/course-social-robotics/tre
e/master/motors_demo
LEGO® is a registered trademark of LEGO® Group. Programs of IPT are not
affiliated, sponsored or endorsed by LEGO® Education or LEGO® Group.
47. 47
Let's See Some Real Code
Reactive Websocket Demo available @GitHub:
https://github.com/iproduct/ipt-angular2-
reactive-websocket-demo
Reactive Robotics Demo available @GitHub:
https://github.com/iproduct/jprime-demo
59. 59
Takeaways: Why Go Reactive?
Benefits using Reactive Programming + DDD:
DDD helps to manage complexity in IoT and Robotics -
many subsystems = sub-domains
Reactive Streams (Fluxes, Monos) = uni-directional data
flows, CQRS, event sourcing, microservices
Reactive Streams can be non-blocking and highly
efficient, or can utilize blocking if needed
Naturally implement state management patterns like
Redux, allow time travel, replay and data analytics
Clear, declarative data transforms that scale (Map-
Reduce, BigData, PaaS)
60. 60
Takeaways: Why Maybe Not?
Cons using Reactive Programming + DDD:
DDD requires additional efforts to clearly separate
different (sub) domains – DSL translators, factories...
Reactive Streams utilize functional composition and
require entirely different mindset then imperative – feels
like learning foreign language
Pure functions and Redux provide much benefits,
but there's always temptation to “do it the old way” :)
Tool support for functional programming in Java is still
not perfect (in Eclipse at least :)
61. 61
Resources: RxMarbles & Rx Coans
RxMarbles:
http://rxmarbles.com/
RxJava Koans – Let's try to solve them at:
https://github.com/mutexkid/rxjava-koans
RxJS Koans – for those who prefer JavaScript :)
https://github.com/Reactive-Extensions/RxJSKoans
62. 62
Interested in Reactive?
IPT Reactive Java and Angular 2 + Typescript
courses: http://iproduct.org
More information about robots @RoboLearn:
http://robolearn.org/
TuxCon – 9-10 July, Plovdiv:
http://tuxcon.mobi/#schedule