Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable spring-cloud config server for dev properties

I integrate spring cloud in my spring app. It works fine. But I have 3 properties files : application.properties

server.port 9101

spring.profiles.active=@env@
logging.level.org.springframework.data=debug
logging.level.=error

application-dev.properties

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 
spring.jpa.hibernate.use-new-id-generator-mappings=true

logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

#TRACE DEBUG or INFO
logging.level.org.hibernate.type=INFO
spring.application.name=microservice-payment
spring.cloud.config.enabled = false

spring.jpa.properties.hibernate.type=trace 
spring.datasource.url=jdbc:postgresql://localhost:5432/gara-mpayment
spring.datasource.username=garauser
spring.datasource.password=garauser
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.initialization-mode=always
server.servlet.session.timeout=10s


#RabbitMq configuration
rabbitmq.queueName=mpayment.queue
rabbitmq.exchangeName=mpayment-exchange
rabbitmq.routingKey=mpayment.routingkey

and applictaion-int.properties

spring.cloud.config.server.git.uri=my-url
spring.cloud.config.server.git.username=username
spring.cloud.config.server.git.password=pwd

I could I disable spring cloud for dev profile in order to use the local content of application-dev.properties and activate only for applictaion-int.properties ?

I tried spring.cloud.config.enabled=false spring.cloud.bootstrap.enabled=false without success.

like image 449
Teddy Kossoko Avatar asked Oct 16 '25 03:10

Teddy Kossoko


1 Answers

You should make a bootstrap.yml or properties file and add spring.cloud.config.enable=false

or set a environment variable and disable the spring cloud

https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html

Refer the above link for the error you mentioned Invalid config server configuration. Action: If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration

like image 77
Zakir Hussain Avatar answered Oct 18 '25 19:10

Zakir Hussain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!