Micronaut + Flyway Database Schema Migrations
Learn how to integrate Flyway with Micronaut to manage database schema migrations effortlessly. This guide covers Flyway scripts, PostgreSQL, Docker, and full CRUD examples with tests.
Learn how to integrate Flyway with Micronaut to manage database schema migrations effortlessly. This guide covers Flyway scripts, PostgreSQL, Docker, and full CRUD examples with tests.
In this article, we show how to set up and use Log4j2 for logging in a Micronaut application.
In the Micronaut CLI mn, we can use mn create-app –list-features to list all available features. Table of Contents 1. List All Feature 2. Filter Features 3. Download Source Code 4. References P.S. Tested with Micronaut 4.7.6 1. List All Feature Terminal mn create-app –list-features This will output a categorized list of features like: Terminal …
Discover how to efficiently implement logging in your Micronaut applications using default Logback framework. Logging to the console, standard files, and rolling files with practical examples.
In this tutorial, we will create a Micronaut REST API that generates and returns a ZIP file for download. Table of contents 1. Create a Micronaut Controller 2. Unit Testing the Controller 3. Run the Application 4. Download Source Code 5. References Technologies used: Java 21 Micronaut 4.7.6 Maven 3.9.6 1. Create a Micronaut Controller …
In this tutorial, we will learn how to return a Excel file .xlsx in a Micronaut controller using Apache POI. Table of contents 1. Add Apache POI Dependency 2. Create the Excel Service 3. Create the Controller to return Excel file 4. Run the Application 5. Testing the Excel Download Endpoint 6. Download Source Code …
In this tutorial, we will create a Micronaut REST API that generates and returns a PDF file using OpenPDF. Table of contents 1. Add OpenPDF Dependency 2. Creating the PDF Controller 3. Testing the API 4. Writing Unit Tests 5. FAQs 6. Download Source Code 7. References Technologies used: Java 21 Micronaut 4.7.6 Maven 3.9.6 …
When building applications with Micronaut, we often need to execute some logic when the application starts. This could include tasks like initializing resources, seeding a database, or logging system information. In this article, we will explore how to run startup code in Micronaut using ApplicationEventListener and @EventListener. Table of contents 1. Implements ApplicationEventListener to Run …
Learn how to effectively use dependency injection in Micronaut with real-world examples, covering constructor injection, multiple implementations, field injection, method injection, and unit testing.
In this tutorial, we will learn how to return JSON in a Micronaut controller using simple and practical examples. Table of contents 1. Setting Up the Micronaut Project 2. Returning a JSON Object Define a Data Model What is @Serdeable? Create a Controller Run the Application 3. Returning a List of JSON Objects Run the …
In this tutorial, we will explore how to load an external YAML file in a Micronaut application. Table of contents 1. Why Load External Configuration Files? 2. Defining an External YAML File 3. Configuring Micronaut to Load the External YAML File Using Command Line Argument Using Environment Variable 4. Accessing Configuration Values in Micronaut Using …
Micronaut provides a powerful way to manage configuration using @ConfigurationProperties. This annotation allows us to bind external configuration properties (such as values from application.yml or application.properties) directly to Java objects. Table of contents 1. Setting Up the Micronaut Project 2. Defining Configuration in application.yml 3. Setting Up the Configuration 4. Injecting the Configuration into a …
Micronaut @ConfigurationBuilder allows us to bind configuration files to Java objects using builder pattern. Table of contents 1. Defining Configuration in application.yml 2. Builder Pattern 3. Using @ConfigurationBuilder 4. Injecting the Configured Database 5. Running the Application 6. Unit Tests 7. Download Source Code 8. References Technologies used: Java 21 Micronaut 4.7.6 Maven 3.x 1. …
Learn how to install Micronaut CLI on Windows, macOS, and Linux using SDKMAN!, Homebrew, Chocolatey, or manual installation.
Learn how to create a simple “Hello, World!” application using the Micronaut framework
In this tutorial, we will learn how to return XML responses in a Micronaut application using Jackson XML. Table of contents 1. Setting Up the Micronaut Project Add Jackson XML Dependency 2. Creating the XML Model 3. Creating a Controller to Return XML 4. Running and Testing the Application 5. Writing Unit Tests 6. Download …
By default, a Micronaut application runs on port 8080. In this guide, we will explore multiple ways to change the default Micronaut server port. Table of Contents: 1. Changing the Server Port in application.yml 2. Changing the Server Port in application.properties 3. Setting the Port Using Environment Variables 4. Setting a Random Port 5. Download …