concept property in category spring

This is an excerpt from Manning's book Spring Microservices in Action, 2E.
The important parameter in the configuration entry is the search-locations attribute. This attribute provides a comma separated list of the directories for each application that’s going to have properties managed by the configuration server. In the previous example we used the filesystem location, but we can also indicate a specific classpath to look for our configuration data. The following code will show you how.
Listing 10.8 Mapping the licensing service to a message topic in Kafka
#Rest of properties removed for conciseness spring.cloud.stream.bindings.input.destination=orgChangeTopic #A spring.cloud.stream.bindings.input.content-type=application/json spring.cloud.stream.bindings.input.group= licensingGroup #B spring.cloud.stream.kafka.binder.zkNodes= localhost spring.cloud.stream.kafka.binder.brokers=localhost

This is an excerpt from Manning's book Spring Microservices in Action.
The important parameter in the configuration entry is the searchLocations attribute. This attribute provides a comma separated list of the directories for each application that’s going to have properties managed by the configuration server. In the previous example, you only have the licensing service configured.
You’re now ready to begin encrypting properties for use in Spring Cloud Config. You’ll encrypt the licensing services Postgres database password you’ve been using to access EagleEye data. This property, called spring.datasource.password, is currently set as plain text to be the value p0stgr@s.

This is an excerpt from Manning's book Spring Boot in Action.
This demonstrates that the application.properties file comes in handy for fine-grained configuration of the stuff that Spring Boot automatically configures. But you can also use it to specify properties used by application code. We’ll look at several examples of both uses of application.properties in chapter 3.
It’s also worth noting that Spring Boot’s property resolver is clever enough to treat camel-cased properties as interchangeable with similarly named properties with hyphens or underscores. In other words, a property named amazon.associateId is equivalent to both amazon.associate_id and amazon.associate-id. Feel free to use the naming convention that suits you best.
When dealing with application security, you’ll almost certainly want to take full charge of the configuration. But it would be a shame to give up on auto-configuration just to tweak a small detail such as a server port number or a logging level. If you need to set a database URL, wouldn’t it be easier to set a property somewhere than to completely declare a data source bean?

This is an excerpt from Manning's book Spring Dynamic Modules in Action.
Listing 2.3. Accessing properties using the BundleContext interface
String containerName = bundleContext.getProperty(Constants.FRAMEWORK_VENDOR); String containerVersion = bundleContext.getProperty(Constants.FRAMEWORK_VERSION); String usedLanguage = bundleContext.getProperty(Constants.FRAMEWORK_LANGUAGE); String osName = bundleContext.getProperty(Constants.FRAMEWORK_OS_NAME); String osVersion = bundleContext.getProperty(Constants.FRAMEWORK_OS_VERSION);
Listing 2.3. Accessing properties using the BundleContext interface
String containerName = bundleContext.getProperty(Constants.FRAMEWORK_VENDOR); String containerVersion = bundleContext.getProperty(Constants.FRAMEWORK_VERSION); String usedLanguage = bundleContext.getProperty(Constants.FRAMEWORK_LANGUAGE); String osName = bundleContext.getProperty(Constants.FRAMEWORK_OS_NAME); String osVersion = bundleContext.getProperty(Constants.FRAMEWORK_OS_VERSION);Note that if the key searched for isn’t found in the OSGi container’s properties, it’s then searched for in the JVM’s system properties.
The Configuration instance for the identifier data.source.conf is first retrieved using the getConfiguration method of the Configuration Admin Service. On this Configuration instance, the properties are gotten with the getProperties method. If properties are null, they can eventually be initialized to an empty map by using the update method of the Configuration instance.
As you can see, properties for a given configuration identifier correspond to a map that can be updated. When it’s created, this map is null, and you need to initialize it. You can then either use this map or specify a new one. In either case, the update method is used to save updates to configuration properties. The Configuration class also allows you to delete configuration properties by using its delete method.
Listing 11.3 shows how to set properties for a configuration identifier.
Spring provides support for configuring properties from different sources through the properties tag of its util XML namespace. Spring DM similarly allows you to configure properties stored in the Configuration Admin Service by using its osgix XML namespace.