JEEConf 2018: Highlights
The past month was rich in conferences for SciForce team. Among others, our colleagues visited one of the largest Java conferences in Eastern Europe, JEEConf, which took place in Kyiv, May 18–19th.
Let’s have a look at what they found to be the most exciting newest developments and trends.
15 Years of Spring: Evolving a Java Application Framework
The opening speech was given by Juergen Hoeller, the co-founder of Spring Framework.
Spring is the most widely used application framework for Java developers which celebrates its 15-year anniversary. Mr. Hoeler started with a brief overview of Spring history as it evolved from a small open-source project to a true development philosophy and a huge ecosystem which supports new Java-based languages such as Groovy and Kotlin. In his speech, Juergen Hoeller presented new features for Java and Kotlin, including Reactive Web Stack on Reactor and the support of JDK 11.
Juergen Hoeller on Twitter and GitHub.
Building Event-Driven Microservices with Event Sourcing and CQRS
Lidan Hifi, a Team Lead at Wix, shared his experience on designing and supporting systems with Event-Sourcing and CQRS patterns for an invoice service. Before describing these patterns, he sketched the drawbacks of the state-based model for high-scaled and complex regulation rules as well as the advantages of saving the whole event sequence in order to rebuild the actual state once needed. Such approach, on the one hand, allows generating an audit log and, therefore, debugging the process at no expense; yet it adds additional complexity to the system.
Slides and video.
Lidan Hifi on Twitter and Medium.
Spring Framework 5: Feature Highlights & Hidden Gems
It was the second speech given by Juergen Hoeller, the co-founder of the Spring Framework. This time, he gave an overview of new features in Spring Framework 5, including the out-of-box first-class support for Kotlin and Java 8 and the functional-style API. He also presented a infrastructure-level reactive interaction model based on the publisher-subscriber pattern. This innovative model underlies new stream-based methods used in the framework. The presentation also touched upon a new stack named Spring WebFlux as a programming model for reactive microservices. Last, but not the least, Juergen Hoeller raised the curtain over the upcoming release 5.1.
Designing Fault Tolerant Microservices
Orkhan Gasimov, Senior Data Developer at AppsFlyer, gave in his speech an overview of popular approaches, patterns and complete solution cases in the field of microservices and distributed business applications.
First, he described the Service Discovery pattern which provides an means for service orchestration in network without preconfigured service locations and dynamic load-balancing.
The following approach described was an autoscaler-service, which balanced the infrastructure based on a range of metrics. This approach has a number of open-source solutions that make in potentially attractive for businesses.
The Circuit Breaker pattern helps identify an overloaded or corrupted path in the RPC services orchestration. The user is notified that his request can’t be processed, or another path will be chosen.
Afterwards, Mr. Gasimov discussed the advantages of N-module-redundancy both for fault-tolerance and for acceleration of processing. At the same time, he pointed out that we should always take into account a situation where more than one service will give a response at the same time.
The procedures of service recovery should not slow down the processing by default. The normal behavior should be processed as fast as possible. It is the pattern recovery blocks that realize this feature.
If a root (or parent) microservice fails, the whole job is compromised. These services are error kernels in the system. The instance healer service realizes event-sourcing and CQRS patterns (see the previous speech) for saving states of child services. This approach ensures that the jobs of executors will not be lost upon a failure of parent service.
Orkhan Gasimov on Facebook.
Hexagonal Architecture with Spring Boot
“Have you seen the Domain Driven Design in the real world?” — was the first question Mikalai Alimenkou, Founder and Coach at Xp Injection, asked. He represented the Hexagonal Architecture as the new level of Application Design that came just in time in the era of Microservices Architecture. The idea it rests upon is rather simple: logic inside, ports outside. With Spring Boot, it is possible to implement the application ports for external communications without the temptation for moving a part of the business logic to application bounds. Spring Boot and other Spring projects isolate the business logic inside the microservice around the domain and save it in the use cases structure. If you want an API or an UI, use Spring MVC. Want to connect to the databases — use Spring Data. Listen to message queues — Spring Messaging is ready to help. The Hexagonal Architecture brings the Domain Driven Design described by Eric Evans into the real world.
Mikalai Alimenkou Twitter and GitHub.
The second conference day began with a speech by Josh Long, Spring Developer Advocate. It was a very exciting and funny morning. With his sense of humor Josh presented the Kotlin support provided by Spring Framework 5.0 and demonstrated how quick and easy it might be to build apps with Kotlin + Spring Boot 2.0. Just go to start.spring.io which configures everything for you and do your best while coding. The second part is a little bit harder as Kotlin looks of course less verbose than Java. Therefore, you should be ready to spend some time trying it on try.kotlinlang.org.
Josh Long on Twitter, GitHub and on his Blog.
Building event sourced systems with Kafka Streams
This year, there were multiple presentations on Event sourcing and CQRS, because these techniques are suitable for big applications with huge amount of data and, therefore, have become quite popular nowadays. They solve a lot of problems but, as it usually happens, also cause new problems. Amitay Horwitz (Software Engineer at WIX) shared his team’s experience of using the Event Sourcing and showed how Kafka & Kafka Stream became a rescue for them.
Kafka is a distributed streaming platform that enables exchanging messages between producers and consumers which are actually microservices. The topic is a basic structure that Kafka gives us. The producer can send messages to different partitions of the topic which is configured by a message key. Kafka Streams is the library provided by Apache Kafka that does amazing things with messages in partitions. You can write a small app that takes messages from partition into a stream, transforms it by mapping, filtering, joining separate streams and sends the resulting stream to another partition which can be read by a consumer. Besides, with this tool you can add or change your query views easily.
Slides and video
Amitay Horwitz on Twitter, GitHub and Medium.
Dive into the Internet of Things with Java 9/10
Finally, we dived into the Internet of Things with Java 9/10. Alexander Belokrylov, CEO/Product Manager at BellSoft, shared his experience of using Embedded Java that has recently been included into OpenJDK 9. He presented a few features that simplify the usage of Java for hardware products: modularization, AppCDS, http/2, and Process API. Even for those who are not hardware developers, it was exciting to watch his demo cooling the beer bottle and notifying the user about the current and desired temperature in Telegram. Veronika Herasymenko, our Java developer, has admitted after the conference that she was so amused that the demo made her want to buy a Raspberry Pi 3 and try something similar just for fun.
As a concluding remark, we can say that, as you could notice, the main trends in Java 9/10 world are Event Sourcing + CQRS, Spring Framework and its projects, Reactive, and Kotlin. Now, with new insights and ideas, we will be waiting for Java 11… and, of course, for JEEConf 2019!