kotlin

Spring Reactive Transaction With Mongo

Vikas Ve2ma
Introduction In this blog post we will use ReactiveMongoTransactionManager class to manage the transaction. Along with that we shall use the mongo db. Version Kotlin: 1.3.71 Spring-boot: 2.2.6.RELEASEA Java: 11 mongo db: 4.2.0-rc2-bionic Dependencies You can use Spring Initializer to initialize the project you need following dependencies - Spring Reactive Web Spring Data Reactive MongoDB Create docker-compose.yml file I use docker for running the mongo db the docker compose file looks like this -

Spring+kotlin+mongo+testcontainer

Vikas Ve2ma
Introduction In this project we shall see how to use testcontainer to test the repository created in mongodb As per their document Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. Prerequisit Docker Create sample project Go to the spring initializer and create project with language as kotlin and dependencies required are webflux & reactive mongo db

Add swagger to the kotlin spring

Vikas Ve2ma
Introduction In this short article we shall see how to configure swagger with spring webflux project. We create a project on spring initializer and then shall configure swagger. Dependencies Create a project on the spring boot initializer page with dependency as ‘webflux’ and language as ‘java’ In order to work swagger with kotlin you need to add the following repositories in you pom.xml file. Since the swagger dependencyis available in another repository you need to add that repository as well in you ‘pom.