Skip to content

Tag: micronaut

Implementing a Dynamic REST Query Language in Micronaut with JPA and QueryDSL

Sometimes in web-based applications, you might end up needing an “advanced search” feature for your entities which happens to have many fields and relations. Supporting each of these search requirements results in a huge amount of code and a tight coupling between the backend code and UI. And if some business requirement changes, you have to update your backend code to support the newly requested features. On the other hand, a dynamic query builder, that can convert REST query parameters to SQL queries, can remove this tight coupling and make developers’ lives easier!

Spring framework has built-in support for these kinds of dynamic queries in its Spring Data module by leveraging the QueryDSL library and it also has web support so it can dynamically create SQL queries from the REST parameters.

By taking ideas from Spring Data, I tried to implement a dynamic REST query language in Micronaut by using JPA and QueryDSL and made it available as a library on Maven repository. This implementation uses little to no runtime reflections thanks to Micronaut’s awesome compile-time Introspection which can result in less memory usage and better performance and it’s suitable for Microservices architecture.

Reliable Messaging in Microservices – Implementing Outbox Pattern using Kafka, Debezium, Micronaut, and Oracle Database on Kubernetes

Designing a microservice-oriented application can result in making tens or hundreds of small loosely coupled services that interact with each other via a lightweight protocol. Many business transactions are made up of small transactions that get executed inside multiple microservices. In order to complete the transaction, microservices need to execute their own (local) transactions and pass the result or status of their own work to other involved microservices. If one microservice fails to do its part, the work of all involved microservices has to get discarded and rolled back.

Communication plays an important role in a microservices architecture. Microservices need to communicate with each other using a fast, lightweight, and reliable protocol to get the job done. A single message loss in the application may result in cascading failures that lead to great losses.

In this post, we are going to see how we can design and implement a reliable messaging system in a microservices architecture based on the Transactional Outbox pattern and using Apache Kafka, Debezium, Micronaut framework, and Oracle Database.