Spring profiles explained - Microservice configuration with Spring Boot [08]

  Рет қаралды 161,177

Java Brains

Java Brains

Күн бұрын

Have you seen the new Java Brains? Check out www.javabrains.io now for awesome courses and content!
Full course: • Spring Boot Microservi...
Learn what Spring Profiles are and how you can use them to achieve environment specific configuration for your Spring Microservices.
#JavaBrains #Microservices #SpringBoot #Configuration #Course

Пікірлер: 100
@diboracle123
@diboracle123 4 жыл бұрын
I personally like your tutorials. Could you also start a tutorial of any cloud (Aws/Azure/GCP) after micro service. It would be really helpful if you could do so.
@amplipeter
@amplipeter 4 жыл бұрын
I searched half the web how it works..(and naming convention in profile!) Java Brains explains and I get it at once!
@shrabontipal6699
@shrabontipal6699 3 жыл бұрын
I am an IT professional but your videos makes me travel back to my college days where I was blessed with some excellent professors. Thanks to you , the way you explain gives me opportunity to feel like I am in the same classroom and you are one of those excellent professors. I personally like your explanation because answer all WHY questions. We know WHAT to use where but you emphasise more on WHY should we use that.
@aswarthanarayanareddyb176
@aswarthanarayanareddyb176 4 жыл бұрын
this is why I'm, again and again, fall in love with java brains, Thank you java brains for enhancing my skills of 'spring profiles'. this is very helpful for me in development. I'm waiting for the actual microservice series.
@harshverm776
@harshverm776 Жыл бұрын
I never want disappointed by the Explanation of Sir. Thanks for your videos !!! You are always the Best.
@vinodhkumarummaneni9627
@vinodhkumarummaneni9627 4 жыл бұрын
If this video is spring bean, it goes to @Profile("Awesome Explanation") ❤
@shayon16
@shayon16 4 жыл бұрын
Lol
@pablon3115
@pablon3115 3 жыл бұрын
Amazing. Perfect mix between theory and practice. Thanks!
@SatyaUpendra
@SatyaUpendra 4 жыл бұрын
I watched this course in most rated paid online learning platform. That is no where near to your explnation. Koushik Your are The Man.
@Blueflamey
@Blueflamey 11 ай бұрын
This is a very good explanation of what @Profile is. Thanks!
@GuitarreroDaniel
@GuitarreroDaniel 3 жыл бұрын
Hey man, this was amazing. Before this video I was wondering how I was gonna set up profiles in maven! It's such a relief that this could be done via jar. Thank you very much!
@ramlimbu2167
@ramlimbu2167 4 жыл бұрын
Great tutorial!! This is what i was looking for implement in my project.
@VivekYadav-hx3hp
@VivekYadav-hx3hp 2 жыл бұрын
Really liked your tutorials. I was confused that how exactly the profiles are being choosed. You explain it quite nice👌
@krimarokadiya2611
@krimarokadiya2611 3 жыл бұрын
Very helpful tutorial for learning profile in spring boot , I like the way that sir explain with real time examples in coding.
@yashpalgandhi4108
@yashpalgandhi4108 4 жыл бұрын
Nice explanation as always! Please start another series for deploying micro services
@kaushikmitra28
@kaushikmitra28 3 жыл бұрын
Note - This method will work till spring boot 2.3. Starting from 2.4 there can be one single application.properties file separated by #--- for env specific values using spring.config.activate.on-profile= at the start followed by the env specific values
@hyperborean72
@hyperborean72 4 жыл бұрын
You are doing a fantastic job Sir
@harshadholkar
@harshadholkar 4 жыл бұрын
Trust me this guy is a genius
@Creeper-dc9oz
@Creeper-dc9oz Жыл бұрын
Thankyou. Clear, informative and to the point. Spring profiles...done
@marekdarek7299
@marekdarek7299 2 жыл бұрын
Yours videos are so helpful! Thank you!
@karthikgotrala580
@karthikgotrala580 4 жыл бұрын
Great Thank you for the video series
@user-hk8gi8fe3n
@user-hk8gi8fe3n 4 жыл бұрын
Огромное, СПАСИБО! Ты просто молодец! :)
@jishuschannel
@jishuschannel 4 жыл бұрын
Lovely...very crisp and clear 👌👌
@rbelatamas
@rbelatamas 3 жыл бұрын
Brilliant tutorial! Thank you so much!
@rajmiglani4159
@rajmiglani4159 4 жыл бұрын
In this era of netflix and stuff, I am glad to binge watch these 😎
@sauravsrivastava9019
@sauravsrivastava9019 3 жыл бұрын
Very useful I like the way you explain...Thanks
@JeevanSunkersett
@JeevanSunkersett 2 жыл бұрын
Thank you. Your tutorials are just too good. In this particular context of spring profiles, I would like to add I needed to start my application with TWO profiles active... My React front end was facing CORS issue when accessing my spring boot backend - so had a special bean with a @Profile("corsSecurity") and to have TWO profiles (dev and prod) had this in my default application.properties spring.profiles.group.dev=dev,corsSecurity spring.profiles.group.prod=prod,corsSecurity and started my application with either java -jar --spring.profiles.active=dev or --spring.profiles.active=prod
@bogdanmazur3256
@bogdanmazur3256 2 жыл бұрын
Thank you for such great explanation
@AmittSpeaking
@AmittSpeaking 3 жыл бұрын
Amazing explanation!
@kumarchandresh0
@kumarchandresh0 4 жыл бұрын
Happy Republic Day Koushik.!
@sonofgod00
@sonofgod00 2 жыл бұрын
great sir god bless you thanks for helping
@gchandrasekharreddy2907
@gchandrasekharreddy2907 4 жыл бұрын
Thanking you Guru ji.....🤝🤝
@josephnairpudupermanil8679
@josephnairpudupermanil8679 2 жыл бұрын
Awesome Koushik..
@-indeed8285
@-indeed8285 4 жыл бұрын
Amazing ❤
@uma_r
@uma_r 4 жыл бұрын
Wonderful ❣️
@AbhishekSharma7
@AbhishekSharma7 4 жыл бұрын
Great tutorial so far! Can you please have a tutorial for JWT
@aleksandrkravtsov8727
@aleksandrkravtsov8727 3 жыл бұрын
very cool lesson 👍
@prabhuprasaddevanaboina3889
@prabhuprasaddevanaboina3889 Жыл бұрын
Very good sir.
@glchiu5292
@glchiu5292 2 жыл бұрын
useful skills, thank you
@menabebawy390
@menabebawy390 Жыл бұрын
great, thank you
@susanpeter3950
@susanpeter3950 2 жыл бұрын
Super excellent..
@romantsyupryk3009
@romantsyupryk3009 4 жыл бұрын
Thank you so much
@mickyo9223
@mickyo9223 3 жыл бұрын
thumbs up for him to sell some merch. I've watch enough of your vids to justify buying some. Think of a nice pc sticker, or cooler sticker. JB-Vids!?!?
@BalajiChinnuSha
@BalajiChinnuSha 4 жыл бұрын
Nice tutorial... pls see if you can put something on exception in spring boot
@sreeshakv5405
@sreeshakv5405 11 ай бұрын
nice, thanks sir
@jithinmv6516
@jithinmv6516 3 жыл бұрын
Perfect!
@punithgowda8890
@punithgowda8890 3 жыл бұрын
Very useful..feature
@gnanrajv
@gnanrajv 4 жыл бұрын
Awesome
@digvijaypatil5358
@digvijaypatil5358 4 жыл бұрын
Nice Tutorial !! One question Can we set XSD of mainframe environment with specific properties with Spring Profiles?
@MzamoHerbza
@MzamoHerbza 4 жыл бұрын
Hi Kaushik, thanks for the awesome tutorial, my question , is it possible to define profiles for external Property Files and configuration (properties) without using for example application.prop or Is it also possible to have profiles for external Property Files and configurations.
@_dinesh
@_dinesh 3 жыл бұрын
As always thank you for the great video. On a completely different topic, I am curious to know why you are using package view as opposed to the project files in IntelliJ project explorer. In my optional project view is more intuitive and exactly represents the actual folder structure. That's one of the reasons I switched to intelliJ.
@manjum143
@manjum143 4 жыл бұрын
Thanks Kaushik. Is there any chance you will share the GIT link of all the programs you explain the concepts on?
@danieldiaz6025
@danieldiaz6025 3 жыл бұрын
I'm enjoying these videos, I really like how they are structured around the desirable properties a configuration system should have. I have a question about the "default profile", though. Is it really correct to say that it's "always active"? My understanding is that, as soon as a different profile is explicitly set with "spring.profiles.active", beans in the default profile won't get loaded into the context. Even beans that are not "overridden" by the explicit profile. Also, is it correct to say (around 15:00) that setting @Profile("default") and not including any @Profile annotation in a bean are equivalent? I believe that no @Profile = "always present", while @Profile("default") = "present only when no explicit profile is given".
@RohitPal-lz1wf
@RohitPal-lz1wf 3 жыл бұрын
Please start series for AWS core services
@FatovMikhail
@FatovMikhail 4 жыл бұрын
what about unit tests? what profile will they use? how to control it? is it possible to have test profile that will not make it's way to the artifact and will be used only in the tests scope?
@shobhit321
@shobhit321 3 жыл бұрын
V Good explanation. One question , if everything remains in jar , and we have to say change some config value for prod , do we need to change the jar to include that new config value? As the production config sits in jar. We will have to build the code again to generate new build version. Isn't? M I missing something?
@santhoshbasineni
@santhoshbasineni 4 жыл бұрын
Can you please publish Microservice Saga or event sourcing example. Thanks
@vinayrathod9972
@vinayrathod9972 3 жыл бұрын
Also, we can have multiple profiles configured under one config file. Can u explain a bit about it how to set it
@mrpotatohasabanana
@mrpotatohasabanana 2 жыл бұрын
at 9:10 you said it overrides but i faced this issue, I did exactly what you did with previous project rather then creating new project with just web dependency, i was able to have two properties but new properties file was not overriding values written in default properties file, but moment i switched to yaml files overriding worked. can someone tell me why?
@vijaysingh-zu3fh
@vijaysingh-zu3fh 4 жыл бұрын
Nice explanation Have one doubt how can I change the profile in pcf using command line
@vijaysingh-zu3fh
@vijaysingh-zu3fh 4 жыл бұрын
I think in manifest-env.yml we need to write active profile name
@SmileKaroYaar
@SmileKaroYaar 2 жыл бұрын
Note - 11:34
@tomknud
@tomknud 2 жыл бұрын
12 step process architecture doesn't like it but selecting beans based upon external input, ie. config file, brings Spring back to inversion of control and code-reuse, which it seems to lose with annotations.
@jeeperscreepers7
@jeeperscreepers7 3 жыл бұрын
What if you can't specify the profile in command line arguments because you have to deploy the .war in an environment such as Jboss? thanks
@gillianbc
@gillianbc 4 жыл бұрын
I needed a bean for an integration test. I didn't use a profile annotation so it was instantiated via the default profile. I could see that in the log. However, I got no bean found when autowiring it into my integration test. How can that be when I could see that the bean had been created?
@shemantsingh765
@shemantsingh765 Жыл бұрын
Hi @JavaBrains , if we define @Profile("dev") on class say ABC then only ABC class bean will be instantiated in whole application when ran in dev environment, is my understanding correct ? can you share your thoughts over this ?
@GovindSingh-sg8lx
@GovindSingh-sg8lx 2 жыл бұрын
what about if we are creating War or EAR and deploying to Different Env, how I will choose profile there.
@mrpotatohasabanana
@mrpotatohasabanana 2 жыл бұрын
at 9:10 you said two properties files can be there in our project but when they are present at same location (src/main/resources) overriding is not working , different profile gets selected but values are not overridden, but two yaml files work how you told even in same location.
@user-nf8tw8sk5t
@user-nf8tw8sk5t 3 жыл бұрын
how come you know so much about this thing, dude?
@FatovMikhail
@FatovMikhail 4 жыл бұрын
is it ok to have no default profile in the aplication and provide it manually for each environment with only the profile name in it? this could protect from running application with a wrong profile
@Java.Brains
@Java.Brains 4 жыл бұрын
You can, but remember that there’s always a default profile active. So, even if you have one configuration value in your app that’s common across all profiles, it would be silly to duplicate it across all your profiles. Hope that clarifies
@vipin0705
@vipin0705 4 жыл бұрын
What happened if we have @profile("dev") & @profile("production") and we not activated dev or production profile than which bean should be initiated.
@rupeshpatil6957
@rupeshpatil6957 4 жыл бұрын
Default
@haribachala
@haribachala 4 жыл бұрын
Question: Lets say you have a bean called Repository( in source code with active profile "production") in source code , in test (folder, for functional tests) having another Bean called Repository( to connect embedded H2 instead of actual DB) with active profile as "test" , when we run application will test bean will be injected to container? (It does not worked for me)
@ayushgupta8239
@ayushgupta8239 4 жыл бұрын
What's the order of profile in ur application file??
@haribachala
@haribachala 4 жыл бұрын
@@ayushgupta8239 - we are running test base class with with @activeprofile as test, qq: will spring context will consider Repository bean which is in src/test/jav?
@ayushgupta8239
@ayushgupta8239 4 жыл бұрын
@@haribachala i don't think so
@hyperborean72
@hyperborean72 2 жыл бұрын
can we have beans configured for a specific profile but without corresponding specific property file?
@atmiksoni5859
@atmiksoni5859 4 жыл бұрын
Where i can find your code . how you can define Map value in yaml file?
@mohammedshabbirahmed976
@mohammedshabbirahmed976 3 жыл бұрын
You are Awesome Bro You are A Hero You ROCK THE WORLD BRO YOU ARE SUPER AND THE BEST
@nolan_villeneuve
@nolan_villeneuve 4 жыл бұрын
The video number is wrong. It should be [08]
@Java.Brains
@Java.Brains 4 жыл бұрын
Thanks! Fixed.
@luizconrado
@luizconrado 2 жыл бұрын
@Java Brains - Is there a way I can get in contact with you? I would very much appreciate that. Thank you.
@bishwajitvikram3794
@bishwajitvikram3794 4 жыл бұрын
i added this property on application-test.yml file spring.profiles.active: test Still it load the default profile. i am using the spring boot v2.2.4.RELEASE. is there any more change to do ?
@bikramnarayankundu2924
@bikramnarayankundu2924 4 жыл бұрын
i guess you need to add spring.profiles.active: test to application.yml and NOT application-test.yml
@bishwajitvikram3794
@bishwajitvikram3794 4 жыл бұрын
@@bikramnarayankundu2924 Suppose i have three version of the profile. 1. Dev 2. QA 3. PROD i need to keep three separate files for the three env, correct me if i am wrong. so in that case, based on the requirement, we will add the "spring.profiles.active: test" i the file name application-test.yml as per the naming convention.. application-.yml eg:: application-test.yml, applciation-dev.yml, application-prod.yml
@bikramnarayankundu2924
@bikramnarayankundu2924 4 жыл бұрын
@@bishwajitvikram3794 I guess this is wrong... 1. Have all the files 2. Just change the application.yml file with the property spring.profiles.active: Dev Or spring.profiles.active: QA Or spring.profiles.active: PROD
@bishwajitvikram3794
@bishwajitvikram3794 4 жыл бұрын
@@bikramnarayankundu2924 Thanks a lot Bikram ! It worked. I git it all wrong. BTW, it working correctly.
@kamalkant3225
@kamalkant3225 3 жыл бұрын
Sir how we run spring boot test from command line with profiles ?
@manishdas2471
@manishdas2471 3 жыл бұрын
-Dspring.profiles.active=
@MrRavihr
@MrRavihr 4 жыл бұрын
Awesome tutorial! Thanks for putting this up! One confusion I still have is, you mention about having multiple configurations (as a result of multiple profiles) in one jar file at kzbin.info/www/bejne/hmqUpaSajLp7e5Y. But wouldn't it be ideal to separate out config from the jar files similar to kzbin.info/www/bejne/hmqUpaSajLp7e5Y because configs have a different lifecycle than the application itself. For instance, I do not need to release a new version of a jar for a config change.
@himanshutripathi7441
@himanshutripathi7441 2 жыл бұрын
yes but you can override configs from environment variables. so for minor change you dont have to release the app.
@maurov2104
@maurov2104 4 жыл бұрын
Spring docs are garbage, man. Fortunately, there is Java Brains to save the day
@mariaaasanhce
@mariaaasanhce Жыл бұрын
yhooooo
@wazeeharaa8100
@wazeeharaa8100 2 жыл бұрын
Better have full screen. No value showing up you
@mysocial
@mysocial 2 жыл бұрын
The density of information is very low. So much blah blah. Anyway, thanks for such video
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 10 МЛН
БАБУШКИН КОМПОТ В СОЛО
00:23
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 18 МЛН
What is API gateway really all about? Java Brains - Brain Bytes
8:56
What is the structure of a JWT - Java Brains
17:46
Java Brains
Рет қаралды 399 М.
Microservices explained - the What, Why and How?
18:30
TechWorld with Nana
Рет қаралды 834 М.
How to do logging in Spring Boot - Brain Bytes
13:46
Java Brains
Рет қаралды 264 М.
5 questions to ask the interviewer!
18:23
Java Brains
Рет қаралды 6 М.
Little girl's dream of a giant teddy bear is about to come true #shorts
00:32