I want to use ObjectDB in my Spring Boot application. How should I configure the application.yml file?
I don't want to add persistence.xml into my application. Is that possible?
You can follow this tutorial:
http://spring.io/guides/gs/accessing-data-jpa/
with adjustments to ObjectDB, as explained on this forum thread:
http://www.objectdb.com/database/forum/860
Related
Is it possible to have spring integration xml configuration and spring boot java annotation configuration at the same time? Can you please refer with an example on this?
What is the best practice for this?
Thanks
As Marten pointed out it is fully fine to combine Spring Boot with an XML configuration. See Spring Boot docs: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using.configuration-classes.importing-xml-configuration
If you absolutely must use XML based configuration, we recommend that you still start with a #Configuration class. You can then use an #ImportResource annotation to load XML configuration files.
And here is the sample: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-xml/src/test/java/smoketest/xml/SampleSpringXmlPlaceholderBeanDefinitionTests.java
I have done the POC in Spring Boot application. But our project is running on legacy Spring MVC.
The problem I am facing while converting Spring Boot project to Spring MVC, to read application.properties file.
The content of the Spring Boot application.properties file is as below
okta.oauth2.issuer=https://dev-3038103.okta.com/oauth2/bus3zhc6ayn7hfzQN5d6
resourceServer.url=http://localhost:8082
okta.oauth2.clientId={client-id}
okta.oauth2.clientSecret={secret-id}
okta.oauth2.scopes=openid,profile
server.port=8080
Can anyone please tell me how to handle?
There are many ways to achieve this,
Using PropertyPlaceholderConfigurer
Using PropertySource
Using ResourceBundleMessageSource
Using PropertiesFactoryBean
this is like a go to source.
Register PropertyPlaceholderConfigurer bean-
<context:property-placeholder location="classpath:path/filename.properties"/>
i am providing the implementation with first method however you can very easily about the rest, follow any one
How to pass configuration through yaml file to a running spring boot application so that there is no need of rebuilding the application and changes are reflected while the application is runnig?
I think this can help you:
How to hot-reload properties in Java EE and Spring Boot?
Take a look at Spring Boot Cloud Config. It allows you to manage your config files centralized and has the ability to push new configurations to the connected applications.
Using Spring Boot 2.1.2 Actuator. I have Redis in my classpath. Actuator is automatically enabling RedisReactiveHealthIndicator. I don't want that. My app is not reactive. I want RedisHealthIndicator, but the reactive one is replacing it.
Is there a way to stop auto-enabling of reactive health indicators?
management.health.redis.enabled = false
Add this to your application.properties file.
Hope this helps ;)
Than try this
#EnableAutoConfiguration(exclude={RedisReactiveHealthIndicator.class})
I came across a requirement of switch on/off case in Spring Boot Application. We have a notification service implemented which is working on property :
notifyall = true in application.properties file.
Now I want to stop the notification services by specifying notifyall = false in application.properties file without any downtime.
Is it possible in Spring Boot Application?
If yes, then any step wise approach or relevant tutorial will be of great help.
Thanks
Use spring boot actuators.
Please go through the following link: https://projects.spring.io/spring-cloud/spring-cloud.html#_environment_changes
it mentions #ConfigurationProperties with prefix; any change in the configuration will be loaded automatically.