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

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 100

  • @diboracle123
    @diboracle123 4 роки тому +90

    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.

  • @shrabontipal6699
    @shrabontipal6699 4 роки тому +4

    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 роки тому +8

    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.

  • @amplipeter
    @amplipeter 4 роки тому +12

    I searched half the web how it works..(and naming convention in profile!) Java Brains explains and I get it at once!

  • @SatyaUpendra
    @SatyaUpendra 4 роки тому +1

    I watched this course in most rated paid online learning platform. That is no where near to your explnation. Koushik Your are The Man.

  • @vinodhkumarummaneni9627
    @vinodhkumarummaneni9627 4 роки тому +25

    If this video is spring bean, it goes to @Profile("Awesome Explanation") ❤

  • @harshverm776
    @harshverm776 Рік тому

    I never want disappointed by the Explanation of Sir.
    Thanks for your videos !!!
    You are always the Best.

  • @kaushikmitra28
    @kaushikmitra28 3 роки тому +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

  • @Blueflamey
    @Blueflamey Рік тому

    This is a very good explanation of what @Profile is. 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

  • @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.

  • @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👌

  • @harshadholkar
    @harshadholkar 4 роки тому +1

    Trust me this guy is a genius

  • @yashpalgandhi4108
    @yashpalgandhi4108 4 роки тому +2

    Nice explanation as always! Please start another series for deploying micro services

  • @pablon3115
    @pablon3115 4 роки тому +2

    Amazing. Perfect mix between theory and practice. Thanks!

  • @hyperborean72
    @hyperborean72 4 роки тому +1

    You are doing a fantastic job Sir

  • @GuitarreroDaniel
    @GuitarreroDaniel 4 роки тому +1

    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!

  • @Creeper-dc9oz
    @Creeper-dc9oz Рік тому

    Thankyou. Clear, informative and to the point. Spring profiles...done

  • @rajmiglani4159
    @rajmiglani4159 4 роки тому

    In this era of netflix and stuff, I am glad to binge watch these 😎

  • @kumarchandresh0
    @kumarchandresh0 4 роки тому +3

    Happy Republic Day Koushik.!

  • @marekdarek7299
    @marekdarek7299 2 роки тому

    Yours videos are so helpful! Thank you!

  • @BalajiChinnuSha
    @BalajiChinnuSha 4 роки тому +1

    Nice tutorial... pls see if you can put something on exception in spring boot

  • @sauravsrivastava9019
    @sauravsrivastava9019 3 роки тому

    Very useful I like the way you explain...Thanks

  • @mickyo9223
    @mickyo9223 3 роки тому +1

    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!?!?

  • @AbhishekSharma7
    @AbhishekSharma7 4 роки тому +1

    Great tutorial so far! Can you please have a tutorial for JWT

  • @jishuschannel
    @jishuschannel 4 роки тому

    Lovely...very crisp and clear 👌👌

  • @ramlimbu2167
    @ramlimbu2167 4 роки тому +1

    Great tutorial!! This is what i was looking for implement in my project.

  • @karthikgotrala580
    @karthikgotrala580 4 роки тому +3

    Great Thank you for the video series

  • @bogdanmazur3256
    @bogdanmazur3256 2 роки тому

    Thank you for such great explanation

  • @sonofgod00
    @sonofgod00 2 роки тому

    great sir god bless you thanks for helping

  • @josephnairpudupermanil8679
    @josephnairpudupermanil8679 3 роки тому

    Awesome Koushik..

  • @digvijaypatil5358
    @digvijaypatil5358 4 роки тому +1

    Nice Tutorial !! One question Can we set XSD of mainframe environment with specific properties with Spring Profiles?

  • @AmittSpeaking
    @AmittSpeaking 3 роки тому

    Amazing explanation!

  • @RohitPal-lz1wf
    @RohitPal-lz1wf 3 роки тому

    Please start series for AWS core services

  • @АртёмГубанов-ц3ц
    @АртёмГубанов-ц3ц 4 роки тому +1

    Огромное, СПАСИБО! Ты просто молодец! :)

  • @luizconrado
    @luizconrado 3 роки тому

    @Java Brains - Is there a way I can get in contact with you? I would very much appreciate that. Thank you.

  • @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

  • @santhoshbasineni
    @santhoshbasineni 4 роки тому +1

    Can you please publish Microservice Saga or event sourcing example. Thanks

  • @prabhuprasaddevanaboina3889

    Very good sir.

  • @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?

  • @manjum143
    @manjum143 4 роки тому

    Thanks Kaushik. Is there any chance you will share the GIT link of all the programs you explain the concepts on?

  • @aleksandrkravtsov8727
    @aleksandrkravtsov8727 3 роки тому

    very cool lesson 👍

  • @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 ?

  • @vijaysingh-zu3fh
    @vijaysingh-zu3fh 4 роки тому +1

    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

  • @rbelatamas
    @rbelatamas 3 роки тому

    Brilliant tutorial! Thank you so much!

  • @mrpotatohasabanana
    @mrpotatohasabanana 2 роки тому +1

    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?

  • @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.

  • @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.

  • @hyperborean72
    @hyperborean72 3 роки тому

    can we have beans configured for a specific profile but without corresponding specific property file?

  • @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.

  • @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?

  • @danieldiaz6025
    @danieldiaz6025 4 роки тому

    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".

  • @glchiu5292
    @glchiu5292 2 роки тому

    useful skills, thank you

  • @gchandrasekharreddy2907
    @gchandrasekharreddy2907 4 роки тому +1

    Thanking you Guru ji.....🤝🤝

  • @susanpeter3950
    @susanpeter3950 2 роки тому

    Super excellent..

  • @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.

  • @-indeed8285
    @-indeed8285 4 роки тому +2

    Amazing ❤

  • @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

  • @haribachala
    @haribachala 4 роки тому +1

    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 роки тому +1

      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

  • @vipin0705
    @vipin0705 4 роки тому +1

    What happened if we have @profile("dev") & @profile("production") and we not activated dev or production profile than which bean should be initiated.

  • @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?

  • @punithgowda8890
    @punithgowda8890 3 роки тому

    Very useful..feature

  • @FatovMikhail
    @FatovMikhail 4 роки тому +1

    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 роки тому +2

      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

  • @menabebawy390
    @menabebawy390 2 роки тому

    great, thank you

  • @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 роки тому +3

    The video number is wrong. It should be [08]

  • @sreeshakv5405
    @sreeshakv5405 Рік тому

    nice, thanks sir

  • @jithinmv6516
    @jithinmv6516 3 роки тому

    Perfect!

  • @刘恒-o7k
    @刘恒-o7k 3 роки тому

    how come you know so much about this thing, dude?

  • @bishwajitvikram3794
    @bishwajitvikram3794 4 роки тому +1

    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 роки тому +1

      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 роки тому +2

      @@bikramnarayankundu2924 Thanks a lot Bikram ! It worked. I git it all wrong. BTW, it working correctly.

  • @atmiksoni5859
    @atmiksoni5859 4 роки тому

    Where i can find your code . how you can define Map value in yaml file?

  • @uma_r
    @uma_r 4 роки тому

    Wonderful ❣️

  • @kamalkant3225
    @kamalkant3225 3 роки тому

    Sir how we run spring boot test from command line with profiles ?

  • @gnanrajv
    @gnanrajv 4 роки тому

    Awesome

  • @romantsyupryk3009
    @romantsyupryk3009 4 роки тому

    Thank you so much

  • @maurov2104
    @maurov2104 4 роки тому +5

    Spring docs are garbage, man. Fortunately, there is Java Brains to save the day

  • @SmileKaroYaar
    @SmileKaroYaar 2 роки тому

    Note - 11:34

  • @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 ua-cam.com/video/P91tqdWUHE4/v-deo.html.
    But wouldn't it be ideal to separate out config from the jar files similar to ua-cam.com/video/P91tqdWUHE4/v-deo.html 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.

  • @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