04. application.properties file and application.yml file

application.properties file and application.yml file 



application.properties file and application.yml file

All configuration related to spring boot application are done here.Bellow, I am showing some example for that.

application.properties


spring.mvc.view.prefix= /view/
spring.mvc.view.suffix=.jsp

# ----------- SQL - INMEMORY DATA BASE CONFIGURATIONS | H2 -----------------
spring.h2.console.enabled=true
spring.datasource.platform=h2
spring.datasource.url=jdbc:h2:mem:testdb

# ----------- SQL - DATA BASE CONFIGURATIONS -----------------

spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/springbootjpajwtsecuritydb
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.MySQLDialect
server.port=8082

# ----------- MONGO - DATA BASE CONFIGURATIONS -----------------
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=springbootmongo

# ----------- SECURIRY CONFIGURATIONS -----------------
spring.security.user.name=lahiru
spring.security.user.password=abc123
spring.security.user.roles=USER


#------------------------------------------------------------
# ----------- SPRGING BOOT | MICROSERVICES -----------------

# ----------- 01.EUREKA SERVER ----------------------------
spring.application.name = eureka-service
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false

# ----------- 01.EUREKA SERVER ZUUL PROXY(API) --------------
zuul.routes.products.path = /api/biller_cat_microservice/**
zuul.routes.products.url = http://localhost:8081

# ----------- 01.EUREKA CLIENT -----------------------------
spring.application.name=category-info
server.port=8082


application.yml



# ----------- 01.EUREKA SERVER ----------------------------
spring:
application:
name: eureka-service

server:
port: 8761

eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0

zuul:
routes:
category-biller-info:
path: /api/biller_cat_microservice/**
url: http://localhost:8081
biller-info:
path: /api/biller_microservice/**
url: http://localhost:8083

# ----------- 01.EUREKA CLIENT ----------------------------
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8761/eureka/
instance:
#hostname: localhost
preferIpAddress: true

Comments

Popular posts from this blog

09.Data Binding.

Database - Topics

02. Spring – Creating spring project clone it with GIT step by step.