InterviewSolution
| 1. |
What is the difference between Spring Boot 1 & Spring Boot 2? |
Answer»
With Spring Boot2, everything is secured, actuator endpoints as well as static resources.
New Starters for Reactive components like MongoDB, Redis, Cassandra.
All endpoints are now under /actuator endpoint. You can tweak this path by using management.endpoints.web.base-path property. All are disabled by DEFAULT( except /health & /info) . To enable you can use management.endpoints.web.exposure.include=* ( or list endpoints to be enabled) You can easily write a new endpoint using @Endpoint annotation and it will get listed under /actuator. For example, @Component @Endpoint(id = "newapp") public class NewAppEndpoint { private Map<String, NewApp> newAppStore = new ConcurrentHashMap<>(); @ReadOperation public Map<String, NewApp> newApps() { return newAppStore; } @ReadOperation public NewApp newApp(@SELECTOR String name) { return newAppStore.get(name); } @WriteOperation public void configureNewApp(@Selector String name, NewApp newApp) { newAppStore.put(name, newApp); } @DeleteOperation public void deleteNewApp(@Selector String name) { newAppStore.remove(name); } public static class NewApp { private Boolean enabled; //Other properties & their Setter/Getters.. } }SIMILARLY, we can use @EndPointWebExtension to extend an existing endpoint.
|
|