Spring Boot Actuator

Actuators are nothing but Spring Boot provided production-ready features to our application. Spring Boot includes a number of additional features to help you monitor and manage your application when you push it to production. You can choose to manage and monitor your application by using HTTP endpoints. Monitoring of application, gathering metrics, understanding traffic becomes … More Spring Boot Actuator

@SpringBootApplication Annotation

@SpringBootApplication attribute is used to enable auto-configuration, component scan and to define extra configuration in a single application class. @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } Though the same things can be achieved using following annotations individually @EnableAutoConfiguration: enable Spring Boot’s auto-configuration mechanism automatically configure your Spring application based … More @SpringBootApplication Annotation

@ComponentScan vs @EntityScan

@ComponentScan is used for scanning all your components those are marked as @Controller, @Service, @Repository, @Component etc… where @EntityScan is used to scan all your Entities those are marked @Entity for any configured JPA in your application.   @ComponentScan: @Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Repeatable(value=ComponentScans.class) public @interface ComponentScan Configures component scanning directives for use with @Configuration classes. It … More @ComponentScan vs @EntityScan

@Inject vs. @Autowired

@Inject and @Autowired both annotations are used in Java and Spring do achieve Dependency Injection respectively. Please read our blog Dependency Injection for better understanding. @Inject is part of the Java CDI (Contexts and Dependency Injection) standard introduced in Java EE 6 (JSR-299). Basically, Classes typically acquire references to other Classes through dependency injection. The dependency … More @Inject vs. @Autowired