Giter Site home page Giter Site logo

Comments (1)

wilkinsona avatar wilkinsona commented on May 1, 2024 1

Unfortunately, it isn't practical to provide examples for every bean that's auto-configured showing how it can be overridden as it would make the documentation overly verbose. Instead, we prefer to take advantage of the fact that Spring Boot is open source and that you can use the condition evaluation report that see what is being auto-configured and why.

If you start an app that uses Spring Data MongoDB with --debug, you'll see something similar to the following in the output:

============================
CONDITIONS EVALUATION REPORT
============================


Positive matches:
-----------------

…

MongoDataConfiguration#mongoCustomConversions matched:
      - @ConditionalOnMissingBean (types: org.springframework.data.mongodb.core.convert.MongoCustomConversions; SearchStrategy: all) did not find any beans (OnBeanCondition)

From this you can learn that mongoCustomConversions was auto-configured because there was no existing MongoCustomConversions bean in the context. This means that it will back off if you define your own. You can also look at the problem from those other side and start with the auto-configuration classes that are listed in the appendix.

The benefit of this approach is that it is generally applicable to any auto-configuration. Thanks anyway for the suggestion but we feel that our current approach is more practical approach as it doesn't require individual examples in the reference documentation for every single different bean that Spring Boot can auto-configure.

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.