A detailed guide to the Spring Boot auto-configuration. Learn how Spring Boot auto-configuration works internally and use of the @Conditional annotations.
Пікірлер: 65
@vijayiiitn3 жыл бұрын
The depth you covered with simple explanation is really awesome
@javadevjournal3 жыл бұрын
Glad you liked it
@jamie-labradorpuppy90355 жыл бұрын
This is the best explanation of Spring boot auto configuration. A real good tutorial.
@javadevjournal5 жыл бұрын
Thanks Neha!! I am happy that you found this helpful!!
@avijitsharma50504 жыл бұрын
In depth discussion !! Really happy i found your channel .
@javadevjournal4 жыл бұрын
I am happy that it helped you :)
@aditikumari53014 жыл бұрын
Thanks for explaining auto-configuration in such simple language.
@javadevjournal4 жыл бұрын
happy, it was helpful for you
@manishsharma30034 жыл бұрын
In depth knowledge covered, great examples
@javadevjournal3 жыл бұрын
Thanks!!
@alexanderkourgashov92595 жыл бұрын
Thank you for video. Everything was clearly explained.
@javadevjournal5 жыл бұрын
You are Welcome
@mercury8011152 жыл бұрын
Very detailed explanation. Thank you!
@javadevjournal2 жыл бұрын
Glad it was helpful!
@blackpanther09905 жыл бұрын
Good indepth explanation .Thank You!
@javadevjournal5 жыл бұрын
Thanks Merlin, I am happy that you found this helpful!!
@84prabhumishra4 жыл бұрын
this is the best content on spring boot auto configuration..
@javadevjournal4 жыл бұрын
Thanks!!
@devsecops43374 жыл бұрын
Very well explained, thank you!
@javadevjournal3 жыл бұрын
Glad it was helpful!
@dheebanm32072 жыл бұрын
Thank you so much, it very helpful for everyone, awesome explanation
@sekharr41632 жыл бұрын
Excellent. Much appreciated. Thank you . Please do the more and more videos..
@javadevjournal2 жыл бұрын
Thanks, will do!
@RN-jo8zt4 жыл бұрын
finally, I understood how it works internally
@javadevjournal4 жыл бұрын
I am happy that it was helpful for you
@Rahulverma-zt3sx3 жыл бұрын
You are god sir. Keep sharing knowledge. Thank you sir. 👌👌
@javadevjournal2 жыл бұрын
Thanks and welcome
@kaasiimaginarium3 жыл бұрын
very well explained !!!
@javadevjournal3 жыл бұрын
Glad it was helpful!
@basavarajsunkad46303 жыл бұрын
Excellent explanation
@javadevjournal3 жыл бұрын
Glad it was helpful!
@pushpampatel9608 Жыл бұрын
Where is the rest of the videos on this playlist, I was really getting interested in your playlist, but it ended abruptly
@SinghRahul-5 жыл бұрын
Amazing thankyou :)
@javadevjournal4 жыл бұрын
Thanks Rahul
@PrabodhPrakash3 жыл бұрын
best of all.
@javadevjournal3 жыл бұрын
Thanks!!
@DurgaShiva75742 жыл бұрын
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 ??
@javadevjournal2 жыл бұрын
One is already created by Spring Boot (not dynamically) and you can always create your own based on the requirement. Hope this help !!
@9669sumit3 жыл бұрын
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)?
@javadevjournal3 жыл бұрын
Not sure if I understood your question completely. Can you provide more information?
@HimanshuKumar-zn9to5 жыл бұрын
If i will add gcp starter , and this peroperties file is not available in spring.factories then how it will do auto configuration .
@javadevjournal4 жыл бұрын
Can you please provided more information ? Are you talking about Spring Boot cloud starter?
@Ravikumar-gj6qw2 жыл бұрын
Can u increase the font size plz
@abhijeetatigre46262 жыл бұрын
perfrct \
@mehkarim4 жыл бұрын
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.
@javadevjournal4 жыл бұрын
It seems that the bean definition is missing.Can you also share bean definition.
@mehkarim4 жыл бұрын
@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"); } }
@rexsam31343 жыл бұрын
@@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?
@vishnugovindan85504 жыл бұрын
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?
@javadevjournal4 жыл бұрын
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.
@vishnugovindan85504 жыл бұрын
@@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?
@javadevjournal4 жыл бұрын
@@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.
@dowlathbashag654 жыл бұрын
Hi...excellent session, could you share your github?
@javadevjournal4 жыл бұрын
Thanks,Here is the GitHub link github.com/javadevjournal/javadevjournal
@dowlathbashag654 жыл бұрын
Java Development Journal Thank you so much.
@rexsam31343 жыл бұрын
Please zoom in the code as its not that visible.
@javadevjournal3 жыл бұрын
Thanks for your feedback, I think it should be good with full screen but will try to zoom in in next one.
@rexsam31343 жыл бұрын
@@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
@javadevjournal3 жыл бұрын
@@rexsam3134 Which text area and post you are referring to ? Do you know what all posts on Javadevjournal have running example on the GitHub.
@rexsam31343 жыл бұрын
@@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
@javadevjournal3 жыл бұрын
@@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..