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 […]

Read more List all available features in the Micronaut CLI (mn)

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 […]

Read more How to Run Startup Code When Micronaut Starts

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 […]

Read more Micronaut – Loading external yaml or configuration file

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 […]

Read more Micronaut @ConfigurationProperties Example

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. […]

Read more Micronaut @ConfigurationBuilder Example

List of the Micronaut examples, updating still in progress… 1. Getting Started Micronaut Hello World Example Micronaut @ConfigurationProperties Example Micronaut @ConfigurationBuilder Example Micronaut Loading external yaml or configuration file How to Use Dependency Injection in Micronaut Return XML in a Micronaut Controller Return JSON in a Micronaut Controller Return PDF in a Micronaut Controller Return […]

Read more Micronaut Tutorials

Encountering a java.lang.OutOfMemoryError can be frustrating, but we can take several practical steps to prevent it. In this article, we explain what causes this error, provide real world examples, and discuss effective techniques to manage memory in our Java applications. Table of contents Understanding java.lang.OutOfMemoryError Common Causes and Prevention Techniques 1. Optimize Heap Size 2. […]

Read more How to Prevent java.lang.OutOfMemoryError in Java

Java remains one of the most powerful and versatile programming languages, widely used in enterprise applications, web development, microservices, and cloud-based solutions. As technology evolves, new frameworks continue to emerge, improving development efficiency, scalability, and security. In this article, we explore the top 10 Java frameworks to watch in 2025. Java Frameworks 2025 Framework Microservices […]

Read more Top 10 Java Frameworks to Watch in 2025

Java application servers play a crucial role in deploying and managing Java-based applications. They provide essential features such as security, transaction management, scalability, and performance optimization. In this article, we explore the top 10 Java application servers that developers and enterprises commonly use. Java Application Servers Server Jakarta EE Support Cloud-Native Performance Scalability Use Case […]

Read more Top 10 Java Application Servers for 2025

When writing Kotlin code, you should prefer using val instead of var whenever possible. This simple practice enhances code safety, improves performance, and makes your code easier to read and maintain. In this article, we’ll explore why val is preferable, how it compares to var, and provide real-world examples, including a comparison with Java. Table […]

Read more Kotlin – Use val Instead of var Wherever Possible

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 […]

Read more How to Change the Default Micronaut Server Port

This article shows how to pretty print JSON with JSON.simple. Table of contents: 1. Setup JSON.simple 2. Default Compact Print JSON 3. Pretty Print JSON with JSON.simple 4. Write Pretty Print JSON to a File 5. Download Source Code 6. References P.S Tested with json-simple 4.0.1 1. Setup JSON.simple pom.xml <dependency> <groupId>com.github.cliftonlabs</groupId> <artifactId>json-simple</artifactId> <version>4.0.1</version> </dependency> […]

Read more Pretty Print JSON with JSON.simple

In GSON, we can use the transient keyword, ExclusionStrategy, and @Expose to exclude fields during the JSON serialization or deserialization process. Table of contents: 1. Setup Google Gson 2. Using the "transient" Keyword 3. Using the "ExclusionStrategy" 4. Using the "ExclusionStrategy" and custom annotation 5. Using the @Expose annotation 6. Download Source Code 7. References […]

Read more How to exclude fields in Gson