ConfigurationProperties explained - Microservice configuration with Spring Boot [06]

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 66

  • @ReinerSaddey
    @ReinerSaddey 8 หลายเดือนก่อน

    Ingenious! A very welcome alternative to numerous tutorials that focus on syntax ("put @... in your file"). Instead, we are given a perspective on what (and why) you can (and should) do with it.

  • @narendra9903
    @narendra9903 3 ปีที่แล้ว +6

    I like the way when you say what are we going to discuss next and why we need it👌👌👌👌

  • @brotherly9058
    @brotherly9058 5 ปีที่แล้ว +3

    My best microservice mentor.

  • @iamsushiil
    @iamsushiil 2 ปีที่แล้ว +2

    Your teaching method is just incredible Koushik sir, really fantastic. You have taught me alot.

  • @sugumarnarasimman7299
    @sugumarnarasimman7299 2 ปีที่แล้ว

    The way you explain simply awesome. I always prefer to watch your videos. Thanks a lot

  • @kaushalmzp
    @kaushalmzp 4 ปีที่แล้ว +2

    you are rockstar Koushik :-)

  • @azharmobeen
    @azharmobeen 5 ปีที่แล้ว +2

    It's really good, manythings I don't know before but now definitely I'm gona use it.

  • @swapankumarsoren2356
    @swapankumarsoren2356 4 ปีที่แล้ว +2

    @
    Java Brains : are you using any UI plugins or you have created the UI ?

  • @mohammedshabbirahmed976
    @mohammedshabbirahmed976 3 ปีที่แล้ว +1

    You are Awesome Bro You are A Hero You ROCK THE WORLD BRO YOU ARE SUPER AND THE BEST

  • @maxisperera3024
    @maxisperera3024 4 ปีที่แล้ว +3

    WOW nice bro !! all 3 courses are exceptionally good. but seems now the things have been changed with Spring Boot 2.4 specially latest Spring Cloud version (2020) does not support most Netflix technologies. Please provide a separate video to upgrade our self to latest Spring Boot and Spring Cloud. Thanks !!

  • @manonlombard2431
    @manonlombard2431 3 ปีที่แล้ว +2

    Merci, J'adore c'est super bien expliqué

  • @dhruvsinghal3263
    @dhruvsinghal3263 4 ปีที่แล้ว +1

    5:41 Changing String to Map gives error while starting server. Please check.
    Failed to bind properties under 'db.connection' to java.util.Map:
    Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map]
    Action:
    Update your application's configuration

  • @ZionREI_CN
    @ZionREI_CN 4 ปีที่แล้ว +2

    Hi Koushik, what browser extension you using to display the response as JSON/Raw Data/Headers

  • @jaytempleton4146
    @jaytempleton4146 ปีที่แล้ว

    Simply the best

  • @LOKESH6027
    @LOKESH6027 2 ปีที่แล้ว

    at 4:17 you returned dbsettings.hostport(). what if i want to return dbsetting ??It gives exception

  • @imluckyig
    @imluckyig 3 ปีที่แล้ว +1

    why are you not autowiring in the constructor?

  • @Crane_FISH
    @Crane_FISH 4 ปีที่แล้ว +2

    @Value will check automatically for type match??

  • @deveshmishra6611
    @deveshmishra6611 5 ปีที่แล้ว +1

    Nicely explained

  • @souvikadhikary8990
    @souvikadhikary8990 5 ปีที่แล้ว +3

    In DBSetting class, you changed the 'connection' datatype to 'Map' , Why? Will be automatically converted into Key-Value pairs ?

    • @kaushalmzp
      @kaushalmzp 4 ปีที่แล้ว +1

      yes, that is what. After converting type to map, my things stopped working. Server refuse to start now but with String type it is working fine.

    • @tushargameswell
      @tushargameswell 4 ปีที่แล้ว

      @@kaushalmzp You can add map properties in application properties by a different approach, like
      db.connection.username=xyz
      db.connection.password=abc

  • @sasunguyen7968
    @sasunguyen7968 6 วันที่ผ่านมา

    Thank you for the great tutorial! ❤
    I have a question
    Is it good idea to have property of a list 1000 items configured as externalize
    This file is about 100kb
    My plan is to easily update items without restarting app and no additional storage
    Thank you.

  • @NikitaKorolev-l6b
    @NikitaKorolev-l6b 13 วันที่ผ่านมา

    Hey! Just had a thought about using records for these @ConfigurationProperties instead of a POJO. Could that be a thing (considering the immutability of records)

  • @Crane_FISH
    @Crane_FISH 4 ปีที่แล้ว +3

    Hi koushik, what are endpoints actually????

    • @kaushalmzp
      @kaushalmzp 4 ปีที่แล้ว

      end point are nothing but some third party services URL to connect

  • @abeldaniel5711
    @abeldaniel5711 3 ปีที่แล้ว

    Thank you for the lesson. Can you tell me the best way, if my property values are in db, and I want to load them up onto a spring bean on app startup.

  • @SUMITKUMAR-il3ro
    @SUMITKUMAR-il3ro 5 ปีที่แล้ว +1

    Yehh Nice Explanation

  • @jnsridhar
    @jnsridhar 4 ปีที่แล้ว

    3:35 Configuration annotation may not be needed, ConfigurationProperties is enough, I think

  • @bathulanagendra4621
    @bathulanagendra4621 5 ปีที่แล้ว +1

    Hi sir, if we change property value in properties file,do we need to restart the server in Uat or production server.

    • @kaushalmzp
      @kaushalmzp 4 ปีที่แล้ว

      yes it needs restart.

  • @iamrishigupta
    @iamrishigupta 3 ปีที่แล้ว

    How to load different property file in spring boot each request dynamically
    ??

  • @shivsharanmalage8812
    @shivsharanmalage8812 4 ปีที่แล้ว

    I am using ConfigurationProperties and I have externalized these config values. Once I change value in git I’m calling actuator refresh endpoint to get latest value. If I send request to get updated values then it is failing intermittently. My app is deployed in pcf with 4 instance. Is it something like latest config got updated in few instance that’s why it is failing intermittently?

  • @chinmaybhat7347
    @chinmaybhat7347 4 ปีที่แล้ว

    How can I set a default value to @Configuration bean member variables?

  • @RaviBedre90
    @RaviBedre90 5 ปีที่แล้ว

    Nice Explanation....can we add each others channel as a featured channel? wanted to know your thoughts...

  • @fookoboy9623
    @fookoboy9623 ปีที่แล้ว

    what you have showed i only get how to print value which is present in application.properties in browser. what you have explained it is basic of basic you missed how we gonna use multiple connection in project by using those annotation

  • @olehstepaniak2775
    @olehstepaniak2775 4 ปีที่แล้ว

    Hi, in your tutorial you had my.some and my.list.values. How we can create @ConfigurationProperties("my") class? How to resolve my.list.values?

    • @java-bro
      @java-bro 2 ปีที่แล้ว

      use @Value annotation for this variable

  • @gibranmohammadkhan6216
    @gibranmohammadkhan6216 4 ปีที่แล้ว

    I have two configurations. Let's say A & B. I want to load either one of them depending on some value in a properties file? Is it possible? Or any other way you know to load only one at a time? Thanks

    • @iamrishigupta
      @iamrishigupta 3 ปีที่แล้ว +1

      Do you get the solution how to achieve this?

    • @kannatube1
      @kannatube1 2 ปีที่แล้ว

      got answer for this? if so, plz tell us

  • @Saurabhnaik
    @Saurabhnaik 4 ปีที่แล้ว

    Thank you😃

  • @derar9480
    @derar9480 4 ปีที่แล้ว

    Why you used @Configuration instead of @ component to create a bean?

    • @konstantindobrinskiy9740
      @konstantindobrinskiy9740 4 ปีที่แล้ว +3

      As, of Spring Boot 2.2, Spring finds and registers @ConfigurationProperties classes via classpath scanning. Therefore, there is no need to annotate such classes with @Component (and other meta-annotations like @Configuration) or even use the

  • @VCNANI
    @VCNANI 5 ปีที่แล้ว

    Hi sir,
    Pls explain why get method not accepting requestBody in spring boot.
    If I use postman data will reach to request body
    If I use resttemplate data will be empty.
    Please explain me.
    I'm facing issue in production

    • @rishikesh2111
      @rishikesh2111 5 ปีที่แล้ว

      Use Post, you should not send requestbody with get.

    • @VCNANI
      @VCNANI 5 ปีที่แล้ว

      @@rishikesh2111 that is get method, If I use post , it is working fine. Get should accept request body any option is there

    • @VCNANI
      @VCNANI 4 ปีที่แล้ว

      @Ikbel benabdessamad thanks for your reply.
      I tried that one, but it's not working.
      Get method doesn't support request body.

  • @kannatube1
    @kannatube1 2 ปีที่แล้ว

    why not use @Bean instead of @Configuration. someone plz explain the diffrerence

  • @Aditya-yn5lk
    @Aditya-yn5lk 5 ปีที่แล้ว

    Hi,
    Where can I save password?, I know it's not good to save cleartext password in property file and if I use jsypt, then I have to store password in sourcecode which is also not secure, Then where can I save it??

    • @ME-ls9de
      @ME-ls9de 4 ปีที่แล้ว

      env variable

  • @Azyro777
    @Azyro777 3 ปีที่แล้ว

    I got an error : "No converter found capable of converting from type [java.lang.String] to type [java.util.HashMap]"
    I've added @Configuration and @ConfigurationProperties("db") at DbSettings class and added @Autowired at it's private property at controller class. Anyone having the same issue?
    (btw I'm using Java 16 and Spring Boot 2.5.1

  • @vgkarthi
    @vgkarthi 5 ปีที่แล้ว

    actuator is not working for me.. any clue..using gradle
    implementation 'org.springframework.boot:spring-boot-starter-actuator'

    • @Java.Brains
      @Java.Brains  5 ปีที่แล้ว

      Have you added the property value to expose all endpoints? I cover that in the video

    • @vgkarthi
      @vgkarthi 5 ปีที่แล้ว

      @@Java.Brains yes I did : management.endpoints.web.exposure.include: "*"

  • @KyoukoEri
    @KyoukoEri 4 ปีที่แล้ว

    If I have these two files:
    - application-prod[.]properties
    - application-stage[.]properties
    I want to change or switch towards the stage/test one but both have the same db properties in them.
    Will that work? Or how can I do the switch?

    • @kaushalmzp
      @kaushalmzp 4 ปีที่แล้ว

      question is not clear Joyce. Please be clear.

  • @sahuanuj1
    @sahuanuj1 5 ปีที่แล้ว +1

    First View👍

  • @AjayKumar-fd9mv
    @AjayKumar-fd9mv 4 ปีที่แล้ว

    Thanks

  • @vg_3650
    @vg_3650 3 ปีที่แล้ว

    For me application-.yml is not working. but application-.properties works. Is there anyone who is facing the same?

  • @TheRamsfeld
    @TheRamsfeld 5 ปีที่แล้ว +1

    I love you :D

  • @ashishtripathi120
    @ashishtripathi120 2 ปีที่แล้ว

    AWSOME
    LOL

  • @jeeperspeepers8323
    @jeeperspeepers8323 5 ปีที่แล้ว

    What?

  • @ManikantaKumarGudla
    @ManikantaKumarGudla 10 หลายเดือนก่อน

    Hi,
    How to reload the properties in case of spring MVC (5.1.14 version in specific) ?