Skip to Content
Hands-On Microservices with Spring Boot and Spring Cloud
book

Hands-On Microservices with Spring Boot and Spring Cloud

by Magnus Larsson
September 2019
Intermediate to advanced
668 pages
15h 59m
English
Packt Publishing
Content preview from Hands-On Microservices with Spring Boot and Spring Cloud

Java-based configuration

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( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Master Microservices with Spring Boot and Spring Cloud

Master Microservices with Spring Boot and Spring Cloud

In28Minutes Official

Publisher Resources

ISBN: 9781789613476Supplemental Content