Java Magazine, Mar/Apr 2018
ORACLE COM JAVAMAGAZINE MARCH APRIL 2018 82 reactive programming @ Profile mvc style @ RestController class BookRestController private final BookRepository bookRepository BookRestController BookRepository bookRepository this bookRepository bookRepository @ GetMapping books Flux Book all return this bookRepository findAll @ GetMapping books author Flux Book byAuthor@ PathVariable String author return this bookRepository findByAuthor author Spring has the concept of profiles Profiles are essentially labels or tags for Spring beans Beans in a given profile dont exist unless that profile is activated The easiest way to activate a profile is to use a command line argument when you run the java command For example if you want to activate all the beans under the profile1 and profile2 profiles youd use a command line like this java Dspring profiles active profile1 profile2 jar The benefit of the profile in this case is that you can have the same HTTP endpoints implemented three diferent ways in the same codebase and activate only one at a time The controller
You must have JavaScript enabled to view digital editions.