In this case I have 1.2.20 in my properties, when at the day of writing this article, Kotlin is in version 1.2.31. Unfortunately, it’s not always up to date. Generated pom.xml inspectionĪt first sight, what jumps out at me is the version of Kotlin. Now let’s see what’s happening in our pom.xml. Unzip it and import to your IDE of choice. Let’s set it up according to our needs and hit “Generate Project”:ĭownload of an archive will start. It has a possibility to define all the aspects of the project you want to work on: JVM language and its version (currently three available: Java, Kotlin, Groovy), dependencies, project naming etc. With minimal participation, anyone can configure a fully working web application. Project bootstrappingĪs many of you may know, one of the Spring’s components is a quickstart project initializer called Spring Initializr. It’s enough introduction, let me show you how reactive programming works in practice and what are new Spring Boot 2 features made especially for Kotlin. These two types implement the Publisher interface and they have one clear difference: In our case, Spring uses Project Reactor that implements Reactive Streams and extends it with additional types – Mono and Flux. To put it in more technical context, based on Reactive Streams Specification – we subscribe to a publisher’s result of action. We don’t perform the same sequence of moves everyday and we don’t say same things in the same order everytime. Like in real life – we react accordingly to what’s happening around us. This allows applications to react on changes. To keep it as simple as possible, reactive programming is programming with asynchronous data streams. Then we’ll dive into the process of creation a reactive web service using Spring WebFlux and Kotlin – with a closer look on the superb Kotlin support in Spring. As always, you can find the complete source code on this GitHub repository. This article starts with walking you through introduction to reactive programming. Highlights of this release include reactive web framework – WebFlux, and extended Kotlin support. In February Pivotal released Spring Boot 2, the first release officially supporting Spring 5.
0 Comments
Leave a Reply. |