How Spring Boot auto configuration Works

  Рет қаралды 20,956

Java Development Journal

Java Development Journal

Күн бұрын

A detailed guide to the Spring Boot auto-configuration. Learn how Spring Boot auto-configuration works internally and use of the @Conditional annotations.

Пікірлер: 65
@vijayiiitn
@vijayiiitn 3 жыл бұрын
The depth you covered with simple explanation is really awesome
@javadevjournal
@javadevjournal 3 жыл бұрын
Glad you liked it
@jamie-labradorpuppy9035
@jamie-labradorpuppy9035 5 жыл бұрын
This is the best explanation of Spring boot auto configuration. A real good tutorial.
@javadevjournal
@javadevjournal 5 жыл бұрын
Thanks Neha!! I am happy that you found this helpful!!
@avijitsharma5050
@avijitsharma5050 4 жыл бұрын
In depth discussion !! Really happy i found your channel .
@javadevjournal
@javadevjournal 4 жыл бұрын
I am happy that it helped you :)
@aditikumari5301
@aditikumari5301 4 жыл бұрын
Thanks for explaining auto-configuration in such simple language.
@javadevjournal
@javadevjournal 4 жыл бұрын
happy, it was helpful for you
@manishsharma3003
@manishsharma3003 4 жыл бұрын
In depth knowledge covered, great examples
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks!!
@alexanderkourgashov9259
@alexanderkourgashov9259 5 жыл бұрын
Thank you for video. Everything was clearly explained.
@javadevjournal
@javadevjournal 5 жыл бұрын
You are Welcome
@mercury801115
@mercury801115 2 жыл бұрын
Very detailed explanation. Thank you!
@javadevjournal
@javadevjournal 2 жыл бұрын
Glad it was helpful!
@blackpanther0990
@blackpanther0990 5 жыл бұрын
Good indepth explanation .Thank You!
@javadevjournal
@javadevjournal 5 жыл бұрын
Thanks Merlin, I am happy that you found this helpful!!
@84prabhumishra
@84prabhumishra 4 жыл бұрын
this is the best content on spring boot auto configuration..
@javadevjournal
@javadevjournal 4 жыл бұрын
Thanks!!
@devsecops4337
@devsecops4337 4 жыл бұрын
Very well explained, thank you!
@javadevjournal
@javadevjournal 3 жыл бұрын
Glad it was helpful!
@dheebanm3207
@dheebanm3207 2 жыл бұрын
Thank you so much, it very helpful for everyone, awesome explanation
@sekharr4163
@sekharr4163 2 жыл бұрын
Excellent. Much appreciated. Thank you . Please do the more and more videos..
@javadevjournal
@javadevjournal 2 жыл бұрын
Thanks, will do!
@RN-jo8zt
@RN-jo8zt 4 жыл бұрын
finally, I understood how it works internally
@javadevjournal
@javadevjournal 4 жыл бұрын
I am happy that it was helpful for you
@Rahulverma-zt3sx
@Rahulverma-zt3sx 3 жыл бұрын
You are god sir. Keep sharing knowledge. Thank you sir. 👌👌
@javadevjournal
@javadevjournal 2 жыл бұрын
Thanks and welcome
@kaasiimaginarium
@kaasiimaginarium 3 жыл бұрын
very well explained !!!
@javadevjournal
@javadevjournal 3 жыл бұрын
Glad it was helpful!
@basavarajsunkad4630
@basavarajsunkad4630 3 жыл бұрын
Excellent explanation
@javadevjournal
@javadevjournal 3 жыл бұрын
Glad it was helpful!
@pushpampatel9608
@pushpampatel9608 Жыл бұрын
Where is the rest of the videos on this playlist, I was really getting interested in your playlist, but it ended abruptly
@SinghRahul-
@SinghRahul- 5 жыл бұрын
Amazing thankyou :)
@javadevjournal
@javadevjournal 4 жыл бұрын
Thanks Rahul
@PrabodhPrakash
@PrabodhPrakash 3 жыл бұрын
best of all.
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks!!
@DurgaShiva7574
@DurgaShiva7574 2 жыл бұрын
thankyou for the content, one quick question, this spring.factories file is dynamically generated by spring boot (means the autoconfiguration entries in the file) on basis of the POM.xml dependencies, or it is STATIC in nature, and comes with the autoconfiguration jar ??
@javadevjournal
@javadevjournal 2 жыл бұрын
One is already created by Spring Boot (not dynamically) and you can always create your own based on the requirement. Hope this help !!
@9669sumit
@9669sumit 3 жыл бұрын
spring.factories file can not be edited? because we never keep dependencies on repository but pom.xml and src. Does that mean to avoid unwanted condition check we can use @SpringBootApplication(exclude = JacksonAutoConfiguration.class)?
@javadevjournal
@javadevjournal 3 жыл бұрын
Not sure if I understood your question completely. Can you provide more information?
@HimanshuKumar-zn9to
@HimanshuKumar-zn9to 5 жыл бұрын
If i will add gcp starter , and this peroperties file is not available in spring.factories then how it will do auto configuration .
@javadevjournal
@javadevjournal 4 жыл бұрын
Can you please provided more information ? Are you talking about Spring Boot cloud starter?
@Ravikumar-gj6qw
@Ravikumar-gj6qw 2 жыл бұрын
Can u increase the font size plz
@abhijeetatigre4626
@abhijeetatigre4626 2 жыл бұрын
perfrct \
@mehkarim
@mehkarim 4 жыл бұрын
Thaks for the great tutorial. I am kinda stuck at the execution, can you please help. Description: Field taxCalculationService in com.spark.expense.backend.controller.ConditionTestController required a bean of type 'com.spark.expense.backend.tax.TaxCalculationService' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Qualifier(value="taxCalculationService") - @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'com.spark.expense.backend.tax.TaxCalculationService' in your configuration.
@javadevjournal
@javadevjournal 4 жыл бұрын
It seems that the bean definition is missing.Can you also share bean definition.
@mehkarim
@mehkarim 4 жыл бұрын
@SpringBootApplication public class AutoConfigurationInternalApplication { private static final Logger LOG = LoggerFactory.getLogger(AutoConfigurationInternalApplication.class); public static void main(String[] args) { SpringApplication.run(AutoConfigurationInternalApplication.class, args); } @Bean(name="taxCalculationService") @Conditional(USTaxCalculationTypeCondition.class) public TaxCalculationService usTaxCalculationService() { LOG.info("Initiating US tax calculation bean"); return new USTaxCalculationService(); } @Bean(name="taxCalculationService") @Conditional(CATaxCalculationTypeCondition.class) public TaxCalculationService caTaxCalculationService() { LOG.info("Initiating CA tax calculation bean"); return new CATaxCalculationService(); } } ##and ConditionTestController @RestController public class ConditionTestController { private static final Logger LOG = LoggerFactory.getLogger(ConditionTestController.class); @Qualifier("taxCalculationService") @Autowired private TaxCalculationService taxCalculationService; @GetMapping(value = "/bean") public void checkBean() { LOG.info("Testing the bean {}", taxCalculationService.getTaxRate()); //LOG.info("testing app"); } }
@rexsam3134
@rexsam3134 3 жыл бұрын
@@mehkarim @Autowired private TaxCalculationService taxCalculationService; needs that Java file. the Locale check is done based on computer locale. Can you put that code too as I cannot see what the blogger has put in the code that is being tested by you too. How could we test if our locale is India?
@vishnugovindan8550
@vishnugovindan8550 4 жыл бұрын
Hi, Thanks for the video! I still have a doubt. Please let me know if my assumption is correct: If I create a class that is annotated @Configuration in my web application and also has a @ConditionalOnXXX annotation, would I still need to create a spring.factories file in my META-INF folder and add an entry?
@javadevjournal
@javadevjournal 4 жыл бұрын
Not sure if I understood your question, spring.factories is used to confifure list of autoconfiguration class.Your autoconfiguration class is nothing more than a configruration class and condtional one will let you kw when to load the class. You need spring.factories else you are forcing spring to scan all the classes and figure out what are auto-configuration classes.
@vishnugovindan8550
@vishnugovindan8550 4 жыл бұрын
@@javadevjournal i guess a better question is would you ever need your OWN spring.factories file in a normal web app. If I have my own config file with conditional, it will be picked up anyway by ComponentScan right?
@javadevjournal
@javadevjournal 4 жыл бұрын
@@vishnugovindan8550 That is correct, but it's different than auto configuration.Imagin an enterprise application with thousand of files with similar conditions, are you expecting spring boot to scan all components and den decide which are auto configurations and finally perform the auto configuration work, your application startup will take a ot of time.
@dowlathbashag65
@dowlathbashag65 4 жыл бұрын
Hi...excellent session, could you share your github?
@javadevjournal
@javadevjournal 4 жыл бұрын
Thanks,Here is the GitHub link github.com/javadevjournal/javadevjournal
@dowlathbashag65
@dowlathbashag65 4 жыл бұрын
Java Development Journal Thank you so much.
@rexsam3134
@rexsam3134 3 жыл бұрын
Please zoom in the code as its not that visible.
@javadevjournal
@javadevjournal 3 жыл бұрын
Thanks for your feedback, I think it should be good with full screen but will try to zoom in in next one.
@rexsam3134
@rexsam3134 3 жыл бұрын
@@javadevjournal I am not sure how many folks here do test out the actual code before commenting as the code on your website too does not display the taxrate which is additional code that we must write
@javadevjournal
@javadevjournal 3 жыл бұрын
@@rexsam3134 Which text area and post you are referring to ? Do you know what all posts on Javadevjournal have running example on the GitHub.
@rexsam3134
@rexsam3134 3 жыл бұрын
@@javadevjournal yes have been through all of them on github as well as on the website but what you need to know is checking for a locale for USA and Canada doesn't work unless you change the Locale of your machine to USA. Don't see you have posted any Github link?. I was referring to the tax rate that you have written for US and Canada unless you point to your Github where you have used that logic for the Demo
@javadevjournal
@javadevjournal 3 жыл бұрын
@@rexsam3134 A simple locale change interceptor will do that for you.Also its not always the locale from browser, I can even pass based on the user profile etc..
Spring Boot Auto Configuration
20:10
Java Development Journal
Рет қаралды 3,2 М.
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 63 МЛН
Tom & Jerry !! 😂😂
00:59
Tibo InShape
Рет қаралды 61 МЛН
ROCK PAPER SCISSOR! (55 MLN SUBS!) feat @PANDAGIRLOFFICIAL #shorts
00:31
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 81 МЛН
What are Spring Boot Starters?
11:39
Java Development Journal
Рет қаралды 8 М.
Creating a Custom Starter with Spring Boot
17:27
Java Development Journal
Рет қаралды 14 М.
How Spring Boot Autoconfigurations Work - by ​@MarcoCodes​
55:15
Spring ultimate basics: What are Spring Beans and what is the Spring Container?
16:30
WHAT is AUTOCONFIGURATION?
13:58
Pro Coder
Рет қаралды 2,5 М.
FOOLED THE GUARD🤢
00:54
INO
Рет қаралды 63 МЛН