September 2019
Intermediate to advanced
668 pages
15h 59m
English
If we want to override Spring Boot's default configuration or if we want to add our own configuration, we can simply annotate a class with @Configuration and it will be picked up by the component scanning mechanism we described previously.
If we, for example, want to set up a filter in the processing of HTTP requests (handled by Spring WebFlux, which is described as follows) that writes a log message at the beginning and at the end of the processing of the request, we can configure a log-filter, as follows:
@Configurationpublic class SubscriberApplication { @Bean public Filter logFilter() { CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter(); filter.setIncludeQueryString(true); filter.setIncludePayload( ...