Question 121: What are the benefits of using RESTful web services?
Answer:
RESTful web services offer several advantages, including:
Support for various data formats, such as JSON and XML.
C… Read More
In Java development, exceptions are like unexpected roadblocks in your code. They can best describe those moments when you’re driving down a familiar road and suddenly hit a detour si… Read More
Posted on Aug 31 • Originally published at blog.frankel.ch One of my current talks focuses on Observability in general and Distributed Tracing in… Read More
In this
post, I am going to explain how to validate incoming data with Micronaut
controllers using @Validated advice.
Define
model class.@Introspected
public class EmployeeRequest {… Read More
You can
specify the media type that is consumed by a REST API in two ways.
a.
Using @Consumes annotation
@Consumes
annotation specify the media types consumed by a particular compo… Read More
HttpResponse
class can wrap the response payload and status code.
Example@Post(value = "/demo1", produces = MediaType.APPLICATION_JSON)
public HttpResponse> demo1() {
final Map data =… Read More
Some
parameters in Micronaut are recognized by their type instead of their
annotation.
For example,@Get(value = "/type-binding-demo", produces = MediaType.APPLICATION_JSON)
public M… Read More
Using the
exploded operator (?pojo*) in the URI template, we can bind all the query
parameters to a POJO.
Example@Get(value = "/even-numbers{?numbersMeta*}", produces = MediaType.TE… Read More
@CookieValue
annotaiton can be applied to method argument to indicate that the method
argument is bound from an HTTP cookie.
Example@Get(value = "/cookies", produces = MediaTy… Read More
@Body
annotation is applied to a method argument to indicate that the method argument
is bound from the HTTP body.
Example@Post
@Consumes(MediaType.APPLICATION_JSON)
@Produces(Media… Read More
All the
Micronaut routing annotations (@Delete, @Get, @Head, @Options, @Patch, @Put,
@Post, @Trace) support multiple URI templates.
Example@Get(uris = { "/{employeeId}", "/by-id/{em… Read More
@PostConstruct
annotation is applied on a method that needs to be executed after dependency
injection is done to perform any initialization. This method must be invoked before the clas… Read More
A method Adapter
advice applicable to a method that will create an entirely new bean definition
that delegates to the annotated method.
For
example the following snippet runs the lo… Read More
In this
post, let’s learn how to define an immutable configuration using @ConfigurationProperties
annotation.
How to
define an immutable configuration?
Just define an interfa… Read More
How to hire dedicated Java developers? Is there a magic spell you can cast at midnight, or perhaps, tea leaves at the bottom of a cup may direct you to LinkedIn profiles of ideal candidate… Read More
Simple Logging Facade for Java (SLF4J) is a logging facade that provides a unified interface for various logging frameworks, such as log4j, java.util.logging, and Logback. It allows for the… Read More
If you’ve ever tried to disconnect from a remote connection using Guacamole, you know it can be a real pain. The process is often buggy, and sometimes it can be next to impossible to… Read More
Introduction to Spring Boot Logback
Spring boot logback is the functionality provided by spring boot; when using spring boot starter dependency, it will automatically include the spring boo… Read More
Problem : I am using Logback in my spring boot application. The problem is logback do not print my logger messages in 'eclipse' console ?Solution ;-just reread the logback config d… Read More
File compression format can be specified via fileNamePattern property. ExamplerollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">fileNamePattern>${L… Read More