setting liquibase.changelogSchemaName property in spring boot - spring-boot

I am facing issue while setting the changelogSchemaName for liquibase in spring boot.
I am setting it like below -
spring.datasource.datsourcename.liquibase.changelogSchemaName =
But it seems spring boot is not reading this property.
How can this property be set. My problem is I want to use separate schema for changelog tables which i s different from actual schema.

You can use
spring.liquibase.liquibase-schema=
in your application.properties file for the springboot app.

Related

It is possible to change the name of the DATABASECHANGELOGLOCK table in Liquibase?

It is possible to change the name of the DATABASECHANGELOGLOCK table in Liquibase?
I hoped that it could be in a application.yml file, but I did not find such a property in the documentation:
https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
You can change the value of Liquibase's 'log lock' table name by passing a JVM system property named liquibase.databaseChangeLogLockTableName. For example:
-Dliquibase.databaseChangeLogLockTableName=MY_LOG_LOCK_TABLE_NAME
Spring Boot's integration with Liquibase does not support this property, so you cannot define this as a Spring property and have Spring Boot propagate it to Liquibase. The Liquibase properties which Spring Boot does suport are listed here but you have already spotted these. Until Spring Boot does support propagating this property I think you'll have to supply it via the command line.
FWIW, the Maven plugin for Liquibase does support this via the optional parameter: databaseChangeLogLockTableName. More details in the docs.

Spring Boot Runtime Property Changes After Deploying Start of Application

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.

Spring boot datasource specific properties for embedded jetty server

I have spring boot application and it's basically a gradle project, so, I have below dependency added in my gradle file:
org.springframework.boot:spring-boot-gradle-plugin:1.5.1.RELEASE
Application gets deployed in embedded jetty server. I have following set of properties in application.properties for db connection polling:
spring.datasource.driver-class-name
spring.datasource.max-active
spring.datasource.max-idle
spring.datasource.min-idle
spring.datasource.validation-query
spring.datasource.name
I was referring to below two links:
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.4-Configuration-Changelog
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.5-Configuration-Changelog
I came to know that some of the datasource properties which used in application.properties file in my application are removed starting sprint boot version 1.4 but issue they haven't mentioned what are the new properties to use. Like for tomcat server they have provided all set of properties but not for jetty server. I am facing some db related errors like 'too many connections' after my application run for sometime, my assumption is that datasource props I am currently using are not correct and should be replaced with correct values, but unfortunately I am unable to find correct property names.
Jetty doesn't have its own Pooling DataSource implementation. You can include HikariCP in your project and customise using the spring.datasource.hikari.* properties. With each property matching the bean properties that can be set on Hikari's datasource implementation.

Spring Boot JPA with not a well known database

I am trying to write Spring Boot application to connect to a Teiid database, I want to use JPA layer on it. I have configured the JDBC Data Source, but since this not well-known database in Spring JPA libraries do not autodetect this source. I have manually setup "spring.jpa.*" properties too. I do have a Hibernate dialect for this database, and it is on the classpath.
So, how does one need to configure JPA layer for a not well-known database in Spring Boot? Thank you for your time.
Ramesh..
This is fairly well defined in the Spring Boot documentation.
You can set this explicitly in the application.properties file
spring.datasource.url=jdbc:mysql://localhost/test
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring boot application.yml properties change at runtime

In a spring boot application, I am able to bind properties from application.yml to the bean fields using #ConfigurationProperties annotation.
Is it possible to update these properties in application.yml at runtime and get them reflected in the bean? If yes. How to do this?
In the past, I've gotten this working using ReloadableResourceBundleMessageSource
Spring Cloud Config does that and more. In particular, check the sample application.

Resources