Spring Prevention Boot Launch Failure with couchbase Connection Failure

Using a combination of Spring Boot 1.4.1.Release and Spring Data Couchbase 2.1.3.RELEASE, is there a way to prevent the application from crashing if it cannot connect to couchbase?

Current behavior . The application cannot connect to couchbase at startup and exit.

Purpose : The application will continue to work even if it cannot connect to Couchbase, use the timeout configurations in CouchbaseEnvironment, and constantly try to connect in the background.

In Spring Boot, we can configure Spring JDBC to ignore startup crashes with spring.datasource.continue-on-error=true . Is there something similar in conjunction with trying to fail again in Spring Data Couchbase?

+6
source share
1 answer

You can configure CouchbaseEnvironment by overriding getCouchbaseEnvironment with JavaConfig and try to increase the connection timeout. Is there a specific connection failure that you are working on?

There is no continue-on-error property for spring -data-couchbase. This property is available in Spring Boot for relational JDBC, and it is useful to ignore initialization of failures, such as the inability to create tables and loading into data sources using scripts.

+1
source

Source: https://habr.com/ru/post/1012191/


All Articles