how to encrypt application.properties in spring boot - spring-boot

Spring use application.properties as the configure file, and I have created a new app which all working good exception the spring.database.password which does not meet the security requirement in my company. Is there any ways to encryt the psw? is there any example for me?

You could use jasypt to handle the encryption and then use Jasypt's Spring integration or this Jasypt Spring Boot Starter to wire it into Spring.

Related

How to Refresh Spring Boot Configuration Info with Using Spring Cloud Config

I would like to ask how to refresh spring boot configuration info with using spring cloud config. Would you please give me some advice? Many thanks.
If your spring boot application is a client of Spring Cloud Configuration Server and use itself as single point of truth in the application configuration let's say retrieve application.properties/yml from the config server, you can benefit of #RefreshScope. in this case if you do a post to the /refresh if you use spring boot 1.x or /actuator/refresh if you use spring boot 2.x all the bean that are have are annotated as #RefreshScope will be refreshed.

How we can use loglevel-management by using Spring Boot Admin?

Currently i am using logback for logging purpose , i just heard about spring boot admin but does not get an exact idea about how to implement loglevel-management by using Spring Boot Admin , please any one tell me how we can implement this .Thanks in advance
You have to expose your application by JMX bean using jolokia details
You can access log level management via JMX bean using spring boot admin client details
In case you are using spring boot admin 1.5.x and spring boot 1.5.x on your client you don't need to do anything - it should just work.

Consuming Spring cloud config using Spring REST service (non-boot rest service)

I'm just curious, is it possible to consume Spring Cloud config by a Spring REST service which is not a Spring boot application. If it is possible, where to define the properties in a Spring REST service. I meant, where should I define
spring.cloud.config.uri etc.
Or, only Spring boot applications are allowed to consume Cloud configuration?
Any thought would be appreciated. Thanks
well spring boot just bootstrap all configuration automatically . so for simple spring application you have to config it manually and define the cloud config server beans in your application configuration file . it could be pure old fashion xml files or just using java code configuration with #Configuration. you could find some samples in github

Liberty Spring Boot vs Spring Boot

What is the difference between Spring's Spring boot package and Liberty profile Spring Boot package(net.wasdev.wlp.starters.springbootweb)?
Did we get any advantage when we use net.wasdev.wlp.starters.springbootweb package with Liberty profile?
Why IBM specific Spring Boot package and what's its significance compare to conventional Spring Boot package?
net.wasdev.wlp.starters.springbootweb is essentially a sample application that demonstrates using spring boot w/ Liberty. It's not an alternative to spring boot.

how to use web.xml file into spring boot application without extend WsConfigurerAdapter?

I am using spring-boot to develop webservices, but I don't want to use WsConfigurerAdapter to define a WSDL and all, because I want to deploy my war into WAS7 and it does not support Servlet 3.0. So how would I add a web.xml configuration into my application.
Spring Boot doesn't support Servlet 2.5 out of the box, however you can use Spring Boot Legacy to get things working. Take a look at the Google App Engine sample application for an example of how to use Spring Boot Legacy and web.xml.
You may also be interested in this Spring Boot issue which is proposing to make Spring Boot Legacy an official part of Spring Boot.

Resources