Spring Tips: Configuration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I've spring fans welcome to another installment of spring tips in today's installment we're gonna talk about a topic that I really wish we had been able to address in an earlier video but for want of time and just for all this other interesting data we never just really got around to it so I'm very happy to have the opportunity to finally visit this topic namely configuration and when I say configuration but I mean is the text or values that we get from outside of application or or from outside of our Java code that inform the behavior of our Java code so in order to do that of course we're gonna go ahead and go to start spring that i/o build a new application so configuration I used on 11 I'm going to bring in the reactive web support which I don't actually need but it we'll talk about that in a bit I'm gonna bring in spring cloud vault we're gonna bring in the config server client you know there we go so we've got our different dependencies here I think I'm satisfied with that let's hit generate ueo configuration to unzip and let's get to it okay so here's our configuration class and you know comment out some of the things that we don't need just yet so for example the config involved and all that stuff goodbye don't need that and I don't actually need web flex either I just want this starter that is transitively brought in through all the spring boots spring tide dependencies which is free wood starter but because I commented out the other two spring boot starters nothing else would have brought it in for me so that's why I explicitly brought it in that way let's make sure that we've done the Maven dance so that everything is synchronized alright now this is just gonna be a thing that gets run when the application starts up okay here we go runner okay return a new application runner and there we go this can be a lambda of course good stuff now all we're gonna do is we're going to inject the value here in you know what before I get ahead of myself we'll use the environment okay the environment is the most important abstraction in all of this and yet you probably will never deal with it the environment is the thing that sources originates values from different places different things and makes them available to us as a uniform sort of dictionary keys and values that that environment object in turn delegates to property sources which are their actual things that adapt external you know things in the world to strings that we can then read in our JVM okay so one them one of these property sources knows about the special application that properties or application that llamo okay that spring boot has sort of standardized as a convention so I can say that this is gonna be a message from application properties and I'll say hello from application properties okay there we go so there's our three values and I'm just going to read that value in I'm gonna say I'm gonna log it out and in order to log it out I should probably bring in Lombok which is the compile time annotation processor good and just use it to create a logger I'm so lazy I I really should just create a field here I don't need a none buck for that but I might use it again later you'll see I might make two uses of it which case it pays for itself especially since it burns away at compile time it doesn't actually stick around in the compasseth at runtime right so there we go mom back so logger dots info message from application properties environment daaad get property quote okay good so there's our first one let's go ahead and run that and see what we get all right so we can see then it's reflected here in the output there hello from application that properties great what you may not realize is that application of properties is arbitrary you can actually name it anything you want right so one way to do that is to use spring a property called spring duck config that name okay now of course spring that config that name needs to be provided before you actually start reading in the application of properties so one way to do that is to specify it as a program argument okay so you know equals foo ok spring that config equals foo apply and now let's see this application fail okay I'm gonna start it up and it'll fail the reason it's gonna fail is because there's no food up properties okay there you go this is no right so that's not gonna work so what I want here is to rename this to food at properties food properties to refactor okay there you go it works again so if you change that value could you if you tell spring to talk to a different config file it can do that you almost never need to do that but people often ask is that possible and yes it is you can actually do that more commonly you're happy with the application about properties but you've got things that you want to be available only for certain profiles now in spring a profile is a string value that gets attached to both configuration properties and two objects and it's a way of activating based on the activation of a particular profile any given sets of configuration and objects that are attached to that profile right so I might have a Java object that I only want to run in production for example are the profiles are more for the most part they're they're completely arbitrary there's only two cases that are sort of magic than that we care about but the rest are completely arbitrary you can name them whatever you want for whatever you want right you can have a profile for development and another one for QA and staging and production and whatever you can have one that's like you know only when running against Java 8 and in this environment on Tuesdays or whatever you know it's up to you to conditionally toggle on or off these various profiles and because it's such a common use case and because it's so easy to do you can actually say export spring profiles active equals whatever you could do a program argument just like I showed you you could say spring doc profiles dot active equals foo or you know dev right you could do that but if you're using IntelliJ or spring tool suite there's actually even just a thing here you can just say death okay so now the default profile equals dev and spring boot understand that you want certain configurations available only in the dev profile so hello from dev application up properties so the dev profile is active which means that application that properties is active but it'll be overridden by values in application I've been dev right so here we go so it says hello from dev application okay you could even you can even ask him hey what happens if I have a value in in this case in actual workout you got the more specific value okay you got dev you got the version of the configuration in dev um but what happens if there are no profiles active that is to say you want the lack of a profile was actually what's interesting right and that's very common in the git clone and run use case right I would love to be able to get clone an application and just do maven space spring - boot calling run and see it working and that's a very very convenient experience for somebody and you can do that but things like test containers now and docker you can easily build a java application that just runs you just it gets the fully working thing runs by default in this case you've used the default profile okay so let's do a default profile so I'll say yeah actually I'll say this command V default properties okay hello from default okay application of property so of course in order for that to work you need to remove the profile right I'm not using any profile okay that's the point and this is this too is also more specific than application of property so it's it's it's wrist run if there's any conflict then application default wins right okay so there you go hello from application properties hello from default application of properties okay so that's that's also working so this ability to tier configuration based on properties and profiles very convenient right another thing you may want to do maybe you don't want to invent a whole new profile but you do want to have like a fallback value for something okay and this is very useful especially for doing that value based injection okay so I can use add value be careful that you're not using Lum box add value and here I'm gonna get the key okay like this and I want to provide a default value that falls back so this is very common if you want a reference of property maybe the property isn't defined but if it is if it is defined you want it so greetings from application you know greetings message okay so if it's there great default hello okay string default value so here log that info default value from application dot properties default value good so there's that and you can see what I'm doing is I'm providing the key and that'll work if it's present but if it's not I'll get the default one okay so let's try that okay hello from application I guess we can just use this again okay so run okay so I got the default value I got the I got hello from application of properties now let's go ahead and comment out this one and that means that there's nothing to find nothing is providing that configuration value okay so I get default hello instead I get the default value instead of the one I want it that's a very convenient thing and you can actually mix and match again anything that you would have other otherwise used to resolve a property can be used you know inside of this default resolution so again lots of different places to get your values I might actually want to get this right I could say let's use that right so okay default hello hello from default application probably so I'm I'm actually nesting I'm saying if this is not available kind of like a you know Elvis operator if that's not available then evaluate everything to the right of that including the nested interpolation of other configuration properties okay so very very convenient where this becomes super convenient I think is in the use of environment variables right so you can actually do that in your property files as well let's say let's say that I want to have let's say that you know we all know on on Linux it's gonna be users for - you know home or whatever right so maybe that's our home directory in a Linux or UNIX environment typically each user has a home directory same for Windows right but let's assume that the application is designed to run in a production cluster that's using Linux and so and it's always gonna be under the same user so the default default you know common Linux home equals home bootiful whatever maybe that's the user okay so that's the my custom home ok and we can assume that's what we want by default maybe ok or better yet actually let's make sure it's actually I'm it if it's Linux it's that great ok that's an that's an interesting example let's say that's not defined let's say I just want to inject that ok so I can say give me the home value ok so I can use environment variables this is another place where I can get the user home or another where I can get a property from is all the environment verbals in my machine are now available to me as configuration values as well in the same syntax right so user home from the environment variable mmm-hmm use their home run that what do we get okay so it gave me users J long so I could I could actually do some very smart things there and you can actually have very common kinds of configuration here another thing you might have done maybe you want to configure a a you know a maybe you need to configure database okay and the database you know that your node is gonna run on a machine that has an environment variable called DB host right so you could say screen dot data source dot username that's right you know URL equals JDBC host graves user sorry DB host right DB name right you can do that kind of thing so it can interpolate values inside of the configuration there that also applies to the anti orientation in your java code okay very very convenient and you can also provide default fallback so you could say okay maybe it's a maybe it's TV host otherwise default to localhost maybe its DB name but default to test right so you can actually have really really complex expressions here by using this property placeholder resolution mechanism very very convenient if you're trying to not have so many profiles you don't wanna have this Cambrian explosion of profile definitions out there okay so I've got environment rebels I've got nested configuration but default values lots of things you can do there I showed you so far a few different ways to get properties in for in from the outside of application one of them is to do program arguments we saw that already so let's see what that looks like let's suppose I wanted to override the application properties value there okay or better yet you know let's say I actually just injected value from the program argument so I'm going to say value message from program args and if it's not available I'll just return an empty string string message from program ARDS okay and say log that info message from program orgs good good okay there's this now I'm gonna run the application and it should fail but it's gonna give this empty string right let's make sure of that okay good now we go here and let me just copy and paste this for ease of production okay go here program X dash dash equals hello from program arguments okay I use a quote good it'll apply okay good okay good so you can see that works as well you can also use environment variables right so let's say I have a custom message think about that Dana source example in this case I used external variables to build the data source but maybe the whole thing is just completely up for grabs it might be you know might just be easier just to say that I have an environment verbal called spring underscore data source under URL underscore URL right so command shift you turn it into an environment variable and here I'll just pass it in okay and here it'll be JDBC PostgreSQL localhost some d be okay apply so now in my configuration I'm gonna inject the environment I'm gonna inject the spring that data source that URL which will be informed by the environment rebel spring data source URL long that info spring dot data source URL good stuff look at that huh so I can now pull in these values I can have a default I can have a default configuration here might actually just leave that there for example and then if I provide an environment rebel that'll still win it'll still override the inbuilt application our properties definition of spring data source that URL so that's what we want to want the ability to have default values to fail you know it's a great great gracefully to degrade to a known state whenever possible okay so we looked at environment verbals we looked at program arguments we looked at sort of twelve factor style configuration again if you've ever read the Roku originated twelve factor manifesto it stipulates that environment specific configurations should live guess where in the environment right that's that's very useful because that way if you move your binary from development to QA to staging you can just override things in each environment by providing environment variables that we don't have to recompile the code to get one true built one build of truth and promote that from one environment to another this supports that spring boot we makes that easy you can just provide it environment variables probably property files all that kind stuff maybe you want to have things in a configuration file but you don't want it to live inside of your jar that also is an option right so you can go here okay and maven clean package okay this might fail I don't know if I give us I don't have any environment variables I don't have any default values for a lot of these things oh it worked yeah I do have default I see I see it see I said : blank rent so that worked ok so now target and let's say echo spring that data source URL application property so I'm in the target directory I have my jar my actual jar the application jar and the property thought so cat application that properties Emacs application that properties I'm gonna launch Emacs from within a shell from within IDE my IDE hopefully the world doesn't explode yeah we're okay Davey seed Postgres QL local host or you know prod dB okay so now I can say Java - jar configuration I'm in the same directory this application that properties and there you can see spring that data source URL is equal to j bc post as prod DP so again I don't even have to in this case I have a file that is that has as much configuration as I want and it looks and works exactly like another application property it could also be application that llamo and yet I don't have to bake that into the jar and I don't know that means if I have secrets and you know credentials that I don't want to share with the lonely developers for legal reasons and all that great I can externalise that keep in this property file outside of the application code itself very very very convenient mechanism so all of that is using stuff that's built in with spring boot but you can also provide your own your own property source suppose you had a JDBC database that has its own keys and values that you want to use in your configuration you could create your property source for that as well so let's do that so static class beautiful property source extends property source of type string okay good and we need a constructor naturally and the constructor bootiful already so there's this so my default property source all its gonna do is when it's asked if name equals in your case beautiful messages okay return hello from food of all properly sourced a class that gets simple name okay otherwise return no very very simple trivial example but you can imagine that instead of hard-coding strings that you actually connect to a JDBC datastore and do something of that sort now we have to teach spring about our new custom property source the easiest way to do that is to actually plug it in before the application context Commission gets initialized so what's happening here is that spring is creating something called an application context that in turn creates the environment in which our application objects run it also creates all of the configuration loads of all the configuration which gets plugged into your application context so we need to teach Springwood about our custom property source and it would be its best to do this as early as possible if you can you should do it here but spring application that run is kind of a convenience method you don't you don't want to use that for all your applications so instead you can use a spring application builder you give it some sources which is in this case the configuration application okay and we're gonna call it run build passing args so that should be roughly equal equivalent to what we had before indeed that looks like it's equivalent as well so let's go ahead and run that and see if that still works if it works great then we're almost done ok it works so good so wait we're on the right path then you can plug in an initializer and this is where we actually teach spring we actually get to customize it application context before it's you know before it's been put into use okay so initializers okay just looking for a very attic array of initializers there's a contract and here I'm given a reference to the as yet uncreated application context I can get a reference to it and remember this is a specific special subclass of application context called configure configurable application context I can get then can get a reference to the environment normally the environment the base class is just environment but here it's a configurable environment and then from there I can get access to the property sources and then from there I can add resource right so let's see what this gives me beautiful property sources okay of our property sources dot ad first ad before so I can give it the name of another property source and add it relative to the other one if I want to or ad last let's just do ad last and here I'm gonna add new a beautiful property source the name of the profits purse is beautiful so I don't have to do anything special there alright alright pamda and you know I can probably just save myself some code here nice okay much easier to work with that okay so now let's run that and if that works then we should be able to use this key in value here at value string beautiful message thing okay let's see message from custom property source beautiful message okay there we go so we can see it says hello merge message from custom property source hello from bootiful publisher so we've now taught spring about a custom property source this is me as early as you can get it in there really another way you can do it if you want more configuration you want more flexibility you might try this I'm not guaranteeing that this is gonna work all the time but it works in this case so contribute to property sources I'm going to inject the configurable environment and I'll initialize it there I'll say trigger ball environment dot get property sources dot and last new bootiful property so again I commented out this bit here this no longer is it is in play I'm not doing it dynamically I'm doing at configuration time so after the context has been started and things are starting to wire together and that still works right but you might have some configuration that needs this value earlier on and things like that so this is you know your Y and then V okay there's no guarantee that that's gonna work but worked in this case and it might work in your application as well okay so anyway you've got now your own custom property source okay better own custom property source what we can do is read in values from any number of different places right we've got values from - the arguments from from environment variables from application that properties from application that yamo from program arguments I mean any source of all sort of different places J opt if you've ever used a up to the command line argument framework it's a separate I think it's a it's a separate project that's not maintained by spring but we support that as well so all sorts of different places that you can use to originate your configuration in spring pod we support our KS right which is another bridge for configuration from the Archaea configuration management system if using kubernetes you can use spring cloud companies in just a bit we're gonna talk about two things spring card config server and spring cloud vault both of which give you information so love to and places where you can get you can draw your configuration from but once you've got it you know you can read it from the environment or can have it injected as a value onto your into your your beans just as I've shown you here all of that it's fairly strongly stringy right lots of strings and what I really want is to have all the stuff bound to an object and then I can just do reference to the properties and that object that's exactly what configuration properties do so here I'm gonna create beautiful properties and I'm gonna create a field private string message okay so we're gonna give this a route this is a configuration properties root CP and I need spring to know about my custom properties here for now we're gonna use at data at all our constructor no rocks constructors and this is very Java beanie now thats makes being aware of it enable configuration properties dot class alright good so we've got a properties and now can log it out actually log out the values so what is the value is gonna be what we're gonna go to properties I'm going to say CP dot and you know configuration properties CP equals configuration properties so whatever just make it beautiful it's easier to see on the screen maybe so bootiful dot message is that right so message equals hello from configuration properties alright good so there's this and I want to inject that so here we're not originating the value from to another place but what we're doing with it is a little different isn't it we're actually binding it to this object and again this is how things get turned into fields on objects is the scope of a whole other video and I will put that on the white board the proverbial white board the metaphorical white board there and we'll get to it some other video but it's a huge topic in itself and we don't have the scope of the time for that here so message from configuration properties beautiful properties beautiful properties dot get message ok restart good so message from configuration properties hello from configuration properties huh not bad so we got that now as well we've got a lot of different you know we were able to get strings in and out of our springboard application with very little fanfare very quickly very easy very convenient I'm using configuration properties here this is Java bean style right times beginners and Sanders and all that kind stuff but what if using Cottman if using cotton which has data classes or a Scala with its case classes which which are you know it's preferred that you construct those things with the constructor right so in this case let's say I made this final right in which case I no longer need this I just need a single constructor that takes the arguments as the parameters and then initializes the storage associated with those parameters in the class right so that's what required artist constructor does it creates a constructor takes a single parameter in this case name as in this case message and then it says this that message equals message right so how do I tell the configuration properties mechanism to use that well I can use constructor binding ok this is a nice feature in spring boot to that too I think right so this is now after a new feature that'll still work is my point so I can run it again this is nice if you prefer your objects be more immutable and so on there you go very convenient ok so so far everything we've done very flexible we haven't had to leave spring boot and we've even gotten some ways to externalize our stuff into a separate configuration file which can move outside of the application proper but what if you want more fully featured support for those external files what if I wanted to do version control or what if I want to do secure credentials things like that for this use case there are other more suitable technologies as I mentioned spring clouds cognizes support for config maps now you can use that I mentioned spring cloud config server and spring cloud vault support so let's talk about a couple of those namely first and foremost the spring cloud config server the spring cloud can fix her but is actually a super popular project it's one of our most popular projects because even if you're building a monolith or if you're building a micro service it doesn't seem no matter people want to externalise their configuration and the config server is ready-made to do that if you've ever seen me do the cloud native java talk then you know I used to do that talk a lot years ago right it's I haven't done that that right after I haven't done that very often recently but in that talk I would spin up a custom service registry a custom config server a custom histories monitoring dashboard a custom tracing tool I mean all with just a flick of a few annotations and some and and the spring initializer so I love that we have this amazing thing called the config server I know that it's pretty easy to configure it to get it up and going so I'm gonna generate a new project I'm gonna call it config - server I'll hit generate here we are config server oops server now in order for this thing to do its work we need to parameterize it mean it's customized that we need to tell it to act as an API to provide a HTTP API that will in turn talk to a git repository and that get repository is github.com okay and we're gonna look at a repository that i've created recently greetings config repository now this configuration repository has one file that's five years old so you can see I used to use that one a lot and I've got another one here called bootiful that properties so I'm gonna get my HTTP API to talk to this version control get repository and you know the nice thing about that is I can actually once it's since it's being managed out externally my mic spring cloud config server can actually monitor that for changes it can be notified of any changes in they get repository and then update itself and then my clients can through the use of the Refresh scope in turn be updated right that's a that's a whole other thing maybe I'll do a service spring tip on just the refresh scope in the end and all that kind of stuff but for now all you need to know is I have this a git repository I want to use that so I'm going to create a config server so spring cloud config server get your I and they get your eyes but I got here okay so paste that in there I want this to run import 8888 not 8080 okay and my Java code I need an annotation to opt into being a config server so enable config server and go now my client side I want to bring in the spring cloud start a config maven we import and in order for me in order for this to work I need to tell spring boot where to find the config server so I need it's a chicken-egg problem I can't use a property to sell at which property I can't use a property to tell it where to find properties I need to have that earlier on so one way to do that is it with the environment rebels another in spring pod in particular is something called bootstrap dot properties okay bootstrap type properties it's great it's a great place to put things like the config your ISO spring cloud configure I HTTP localhost 8888 okay now that I've got my API up and running I wanted to find the configuration values in this property file called bootiful so I'm gonna give my micro service a name blue therefore okay once that's done I can then go to this I can actually ask spring to inject the message from the config server for me just like any other configuration value so first of all is a spring aware that I've reinstalled the config client let's make sure it is we import okay good and now my code I'm gonna just inject that like any other variable so value string config server okay value from config server so long type info message from the spring cloud config server and good let's see if that works I had trouble with this before sometimes maven and IntelliJ get confused so I might have to restart the IDE who knows hey a network to first try it look at that love it so message from the spring cloud config server is what I got here right um I could go a little bit further I could use the Refresh clip like I said that's one of the really interesting opportunities here you can actually change the configuration in the git repository and then publish an event in the application context that triggers a refresh of the configuration so that it would see so that in beam that was annotated with refresh scope like so on the receipt of such an event would then be recreated so you actually get the new value from the config server that's very very useful for you know if you have a is you know status notification so you want to disable certain things or you know what are feature flags whatever you want to do lots of use cases there but it's a little bit more than I want to get into into this in this video now the config server as I have it configured is not secure this is a wide-open git repository it's public you can act you can get access to it I'm not even signed in so clearly wide open not very secure you you're gonna want to at a minimum lockdown the communication from the spring cloud config client to the config server and then lock down the communication from the config server to the git repository okay so there's two hops there they can both be secured with using password-based authentication or ssh and so on there's lots of different options there you can and should it use SSL etc right lots of different options to keep this secure end to end as possible if you do a if you do if you want to it can even do encrypted values in the spring cloud can fixer so you can actually have a hashed encrypted value in your property file that gets decrypted when you inject it into your Java process but never before not over the wire not resident in the files so you have security at rest right you have credentials on the file system but they're encrypted and there's it's a one-way encryption right so very very convenient or it can be to it right obviously but very very convenient to have that that's a really really a lot more configuration that could also be a whole other video if you're using carpentry right particular the the PAS runtime that that FEMA provides the sort of fully souped-up version of Cloud Foundry that uh that we provide that has a cloud there's a spring cloud config server instance that's fully secured and so on just ready to use but you can do that in the open source as well as err spring cloud has a config server you can use as well so lots of different ways to get a more secure environment for configuration or you can just do it yourself it's not hard there's documentation we put it out there etc I'm just not gonna do it this video if you want security however you might want you might already be using something called Ashlee Corp vault now vault is a very convenient tool for secure credentials okay so it's a storage mechanism it's a database for secure values and the server itself is super secure and cryptographically secure and you know loved been owned by security experts worldwide think of it like LastPass or one password but for the enterprise right for enterprise applications it can do things like password rotation and it can integrate with also some other things too you know to do persistence and so on but just a very very useful database that's optimized for storing secrets okay hence the name vault so we have a project called spring cloud vault you can easily add that into application as well so let's do that now here and I'll go back to this build I'll add spring cloud vault to the classpath okay so now I've got that there now let's to move and re-import okay and in order for this to work of course you're going to need to specify first of all a few things about vault and particularly gonna need to tell it where the spring cloud can find vault okay so we need to specify two properties and this is also stuff that you put in either the environment variables or the bootstrap type properties right so one thing I'm gonna put there is spring cloud vault token and I've got I'm gonna have an environment variable called vault token okay so I'm gonna dereference that the other thing I'm gonna do is spring cloud config die I've already got that donut I want the scheme right so I'm not doing the most secure version of vault either so it'll just be HTTP all right and that's it that's the two bits I need there again you should be using HTTPS there's a lot a lot of stuff that goes into setting up vault in a secure way but it can be done that's the whole point people you know in production you're definitely gonna want to do that a lot of different time providers provide secured hardened versions of vault and the box you can just run those different implementations as well but for my purposes I've got it installed I bet it running I could just download it it's just a go binary there's one binary there's no kit there's nothing else just a little binary so I just did brew install vault but you can just do what you want then you need to run it okay so this is where we actually have to run it and configure it so I've got some configuration here I'll just copy and paste all that and paste that in a file okay there we go so you'll say what I'm gonna do is I'm going to tell the applications start up on port 8200 I'm gonna tell it to use a default token now normally when you run vault it'll give you a token if you don't actually specify one but here I'm just gonna give it a token and start it up so let's do that here in this node okay so it's up and running now and another shell I'm gonna configure it and what I'm going to configure is I'm gonna tell it a bolt I want to put a secret inside of your inside of the vault under the bucket if you will called bootiful and I want the key to be named a message from vault server and I want the value to be hello spring cloud vault okay so again in order to do in order to interact with the vault you need to have that vault token you know I need to also specify that when I connect my spring convocation to volt so let's do this here good there you go so I've written one value two volt it's ready to use now for my Java code and we need to specify that environmental okay so vault token equals that some now environment variables vault token good so there we go well token pie okay now we want to change our code to use that value from the vault server so bulb server value from vault server just read screen cloud vault server ready already let's see if that works huh so give it a go and to make sure that maven appreciates which just happened here that we've we incorporated vault okay and go okeydoke there we go there's the value from the spring cloud vault server now that's encrypted that's super secure you know it's for it's the Fort Knox of passwords and obviously you could use that to store your spring underscore data source underscore URL or you could just say you can just say spring that data source that URL equals and then source the value from vault and notice that all the other stuff still works as well so the config server works the the local property files all the other stuff that we looked at still work so you can plug in you can mix and match these things they can play well together and they can reference properties from each other all that works out of the box one common question is well why couldn't I just run spring cloud config server and have it use the get backed storage repository for 90% of my configuration and then use vault for my sequence that kind of thing and you can do that that's actually a possible possibility you can actually have a back-end that uses vault as well lots of different opportunities there I find that this is just fine and from the perspective of my code nothing changes who cares whether it talks to a config server and then makes another hop to vault or if it just goes straight to the vault the from the perspective of my code it doesn't matter whether this is specify if it has an environment variable as a property as a dash T argument or a program argument or whatever it just works and that's at the end of the day what I want so now we've looked at a number of ways to make our applications more flexible more robust we looked at some other things like binding we just touched on that very very briefly on configuration properties and binding we ever so briefly touched on things like profiles but I these are again these two things could in an inn of their own and of themselves require a whole other video ditto for spring click config server ditto for spring bolts but what I hope you can appreciate is that if you understand the basics of the machinery then it all just sort of works right I don't I don't have to you know you can see that I don't even have any imports in my code here for any of these other types right here we go right it's just Spring Framework and spring boot there's no even I think I even have spring cloud I don't even I don't even have any generic I don't have any spring cloud types here at all so it just works right I don't know that I'm dealing with spring context I hope you learned something from this my friend I hope you got something out of it as always thank you so much for watching you
Info
Channel: SpringDeveloper
Views: 24,492
Rating: 4.9211268 out of 5
Keywords: Web Development (Interest), spring, pivotal, Web Application (Industry) Web Application Framework (Software Genre), Java (Programming Language), Spring Framework, Software Developer (Project Role), Java (Software), Weblogic, IBM WebSphere Application Server (Software), IBM WebSphere (Software), WildFly (Software), JBoss (Venture Funded Company), cloud foundry, spring boot, spring cloud, hashicorp vault, configuration
Id: PsNNGuLi0ns
Channel Id: undefined
Length: 48min 30sec (2910 seconds)
Published: Thu Apr 23 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.