Introduction
Dropwizard has a crucial role in microservice architecture. As time progresses, microservice architectures are becoming more and more common.
Dropwizard is a framework for creating RESTful web services, or more specifically, it is a collection of frameworks and tools for creating RESTful web services. Quick project bootstrapping is made possible for developers. Making apps easily deployable as independent services in a production environment is made easier with the aid of this packaging.
Annotations

@NotNull & @NotEmpty
Dropwizard will not launch if the messageQueue.host entry in your YAML (Yet Another Markup Language or YAML ain't markup language) configuration file are empty or missing, and it would also print an error message outlining the problems.
@NotNull and @NotEmpty follows with (message = "Name may not be empty")
public class Student{
@NotEmpty
private String name;
@NotEmpty
@Size(min = 0, max = 30, message = "Name must be between 0 and 30 characters long")
private String name;
}
@Min & @Max
The age contained can attain a min value of 0 and a max of 10.
@Min(value = 0 , payload = Unwrapping.Unwrap.class)
@Max(value = 10, payload = Unwrapping.Unwrap.class)
private final Optional<Integer> age;
@Path
An annotation named @Path is required for each resource class. Rather than being a static string, the @Path annotation is a URI Template. The "user" component designates a named variable, and when the template matches a URI, the value of that variable will be available through method arguments annotated with the @PathParam annotation.
@HttpMethod
The @HttpMethod annotation allows for the addition of support for any new methods.
@Timed, @Metered, @ResponseMetered & @ExceptionMetered
The annotations @Timed, @Metered, @ResponseMetered, and @ExceptionMetered can be added to any resource function or the class itself. All the resource methods in the class will be affected by the annotation if placed there.
If the names of @Timed and @Metered are distinct, they can only be used simultaneously on the same resource method.
@CacheControl
All of the options from the Cache-Control header will be accepted by the @CacheControl annotation.
@JsonProperty
You can add a specific field name to the @JsonProperty annotation if you need to modify the name of either the Java field or the JSON field without changing the other.
public class Ping{
private final String message
@JsonCreator
Public Ping(@JsonProperty("message") String message) {
this.message = message;
}
}
@ValidationMethod
For more complicated validations (such as cross-field comparisons, for instance), declarative annotations are sometimes challenging to use, which is why Dropwizard introduces @ValidationMethod.




