diff --git a/common/pom.xml b/common/pom.xml new file mode 100644 index 0000000..ea5bec2 --- /dev/null +++ b/common/pom.xml @@ -0,0 +1,38 @@ + + + demo-microservices + dev.nano + 1.0-SNAPSHOT + + + 4.0.0 + common + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + io.micrometer + micrometer-tracing-bridge-brave + + + io.zipkin.reporter2 + zipkin-reporter-brave + + + org.springframework.boot + spring-boot-starter-actuator + + + diff --git a/common/src/main/resources/shared-application-default.yml b/common/src/main/resources/shared-application-default.yml new file mode 100644 index 0000000..10ca828 --- /dev/null +++ b/common/src/main/resources/shared-application-default.yml @@ -0,0 +1,47 @@ +management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://localhost:9411/api/v2/spans + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: always + +spring: + datasource: + url: jdbc:postgresql://localhost:5432/${spring.application.name} + username: postgres + password: password + jpa: + hibernate: + ddl-auto: create-drop + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + format_sql: true + show-sql: true + open-in-view: false + rabbitmq: + addresses: localhost:5672 + +eureka: + client: + service-url: + defaultZone: http://localhost:8761/eureka + fetch-registry: true + register-with-eureka: true + +logging: + pattern: + correlation: "[${spring.application.name:},%X{traceId:-},%X{spanId:-}]" + level: "%5p ${logging.pattern.correlation} %c{1.} : %m%n" diff --git a/common/src/main/resources/shared-application-docker.yml b/common/src/main/resources/shared-application-docker.yml new file mode 100644 index 0000000..f3e2ed8 --- /dev/null +++ b/common/src/main/resources/shared-application-docker.yml @@ -0,0 +1,17 @@ +management: + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans + +spring: + datasource: + url: jdbc:postgresql://postgres:5432/${spring.application.name} + username: miliariadnane + password: password + rabbitmq: + addresses: rabbitmq:5672 + +eureka: + client: + service-url: + defaultZone: http://eureka-server:8761/eureka diff --git a/common/src/main/resources/shared-application-eks.yml b/common/src/main/resources/shared-application-eks.yml new file mode 100644 index 0000000..119d041 --- /dev/null +++ b/common/src/main/resources/shared-application-eks.yml @@ -0,0 +1,16 @@ +management: + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans + +spring: + datasource: + url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/${spring.application.name} + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + rabbitmq: + addresses: rabbitmq:5672 + jpa: + hibernate: + ddl-auto: update + diff --git a/common/src/main/resources/shared-application-kube.yml b/common/src/main/resources/shared-application-kube.yml new file mode 100644 index 0000000..2ae0e93 --- /dev/null +++ b/common/src/main/resources/shared-application-kube.yml @@ -0,0 +1,18 @@ +management: + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans + +spring: + datasource: + url: jdbc:postgresql://postgres:5432/${spring.application.name} + username: miliariadnane + password: password + rabbitmq: + addresses: rabbitmq:5672 + +eureka: + client: + service-url: + defaultZone: http://eureka-server:8761/eureka + enabled: false diff --git a/customer/pom.xml b/customer/pom.xml index 11687e6..5fa3464 100644 --- a/customer/pom.xml +++ b/customer/pom.xml @@ -59,6 +59,11 @@ spring-boot-starter-test test + + dev.nano + common + ${project.version} + dev.nano amqp diff --git a/customer/src/main/resources/application-docker.yml b/customer/src/main/resources/application-docker.yml deleted file mode 100644 index 34705a3..0000000 --- a/customer/src/main/resources/application-docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -#Server -server: - port: 8001 - servlet: - context-path: /customer - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: customer - datasource: - url: jdbc:postgresql://postgres:5432/customer - username: miliariadnane - password: password - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - diff --git a/customer/src/main/resources/application-eks.yml b/customer/src/main/resources/application-eks.yml deleted file mode 100644 index e63f8ba..0000000 --- a/customer/src/main/resources/application-eks.yml +++ /dev/null @@ -1,37 +0,0 @@ -#Server -server: - port: 8001 - servlet: - context-path: /customer - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: customer - datasource: - url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/customer - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: update - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true - diff --git a/customer/src/main/resources/application-kube.yml b/customer/src/main/resources/application-kube.yml deleted file mode 100644 index 960fb2f..0000000 --- a/customer/src/main/resources/application-kube.yml +++ /dev/null @@ -1,45 +0,0 @@ -#Server -server: - port: 8001 - servlet: - context-path: /customer - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: customer - datasource: - url: jdbc:postgresql://postgres:5432/customer - username: miliariadnane - password: password - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - enabled: false - diff --git a/customer/src/main/resources/application.yml b/customer/src/main/resources/application.yml index 4cddd28..206ff73 100644 --- a/customer/src/main/resources/application.yml +++ b/customer/src/main/resources/application.yml @@ -1,48 +1,12 @@ -#Server server: port: 8001 servlet: context-path: /customer error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring + include-message: always + spring: application: name: customer - datasource: - url: jdbc:postgresql://localhost:5432/customer - username: postgres - password: password - zipkin: - base-url: http://localhost:9411 - rabbitmq: - addresses: localhost:5672 # not http, because is a message queue protocol - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - fetch-registry: true - register-with-eureka: true -logging: - pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" - + config: + import: classpath:shared-application-${spring.profiles.active}.yml diff --git a/eureka-server/src/main/resources/application-docker.yml b/eureka-server/src/main/resources/application-docker.yml index 24dd574..8adc785 100644 --- a/eureka-server/src/main/resources/application-docker.yml +++ b/eureka-server/src/main/resources/application-docker.yml @@ -1,14 +1,24 @@ #Server server: port: 8761 + #Spring spring: application: name: eureka-server - zipkin: - baseUrl: http://zipkin:9411 + #Management management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans endpoints: web: exposure: @@ -16,6 +26,7 @@ management: endpoint: health: show-details: always + #Eureka-Server eureka: client: diff --git a/eureka-server/src/main/resources/application.yml b/eureka-server/src/main/resources/application.yml index d7bfa3e..d31bbf8 100644 --- a/eureka-server/src/main/resources/application.yml +++ b/eureka-server/src/main/resources/application.yml @@ -1,14 +1,24 @@ #Server server: port: 8761 + #Spring spring: application: name: eureka-server - zipkin: - base-url: http://localhost:9411 + #Management management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://localhost:9411/api/v2/spans endpoints: web: exposure: @@ -16,12 +26,15 @@ management: endpoint: health: show-details: always + #Eureka-Server eureka: client: fetch-registry: false register-with-eureka: false + +#Logging logging: pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" + correlation: "[${spring.application.name:},%X{traceId:-},%X{spanId:-}]" + level: "%5p ${logging.pattern.correlation} %c{1.} : %m%n" diff --git a/notification/pom.xml b/notification/pom.xml index 98e8f07..c09aad6 100644 --- a/notification/pom.xml +++ b/notification/pom.xml @@ -64,6 +64,11 @@ aws-java-sdk 1.12.276 + + dev.nano + common + ${project.version} + dev.nano amqp diff --git a/notification/src/main/resources/application-docker.yml b/notification/src/main/resources/application-docker.yml index 23591bd..ea70502 100644 --- a/notification/src/main/resources/application-docker.yml +++ b/notification/src/main/resources/application-docker.yml @@ -5,8 +5,19 @@ server: context-path: /notification error: include-message: always + #Management management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans endpoints: web: exposure: @@ -14,6 +25,7 @@ management: endpoint: health: show-details: always + #Spring spring: application: @@ -22,8 +34,6 @@ spring: url: jdbc:postgresql://postgres:5432/notification username: miliariadnane password: password - zipkin: - baseUrl: http://zipkin:9411 rabbitmq: addresses: rabbitmq:5672 jpa: @@ -34,6 +44,7 @@ spring: dialect: org.hibernate.dialect.PostgreSQLDialect format_sql: true show-sql: true + #Eureka-Client eureka: client: @@ -41,6 +52,7 @@ eureka: defaultZone: http://eureka-server:8761/eureka fetch-registry: true register-with-eureka: true + #RabbitMQ rabbitmq: exchange: diff --git a/notification/src/main/resources/application-eks.yml b/notification/src/main/resources/application-eks.yml index 914d02e..b259307 100644 --- a/notification/src/main/resources/application-eks.yml +++ b/notification/src/main/resources/application-eks.yml @@ -5,8 +5,19 @@ server: context-path: /notification error: include-message: always + #Management management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans endpoints: web: exposure: @@ -14,6 +25,7 @@ management: endpoint: health: show-details: always + #Spring spring: application: @@ -22,8 +34,6 @@ spring: url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/notification username: ${DB_USERNAME} password: ${DB_PASSWORD} - zipkin: - baseUrl: http://zipkin:9411 rabbitmq: addresses: rabbitmq:5672 jpa: @@ -34,6 +44,7 @@ spring: dialect: org.hibernate.dialect.PostgreSQLDialect format_sql: true show-sql: true + #RabbitMQ rabbitmq: exchange: diff --git a/notification/src/main/resources/application-kube.yml b/notification/src/main/resources/application-kube.yml index 2bfe9bb..de05eee 100644 --- a/notification/src/main/resources/application-kube.yml +++ b/notification/src/main/resources/application-kube.yml @@ -5,8 +5,19 @@ server: context-path: /notification error: include-message: always + #Management management: + observations: + key-values: + application: ${spring.application.name} + tracing: + sampling: + probability: 1.0 + enabled: true + zipkin: + tracing: + endpoint: http://zipkin:9411/api/v2/spans endpoints: web: exposure: @@ -14,6 +25,7 @@ management: endpoint: health: show-details: always + #Spring spring: application: @@ -34,6 +46,7 @@ spring: dialect: org.hibernate.dialect.PostgreSQLDialect format_sql: true show-sql: true + #Eureka-Client eureka: client: @@ -42,6 +55,7 @@ eureka: fetch-registry: true register-with-eureka: true enabled: false + #RabbitMQ rabbitmq: exchange: diff --git a/notification/src/main/resources/application.yml b/notification/src/main/resources/application.yml index 0a52e0d..11f650b 100644 --- a/notification/src/main/resources/application.yml +++ b/notification/src/main/resources/application.yml @@ -1,46 +1,17 @@ -#Server server: port: 8004 servlet: context-path: /notification error: include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring + spring: application: name: notification - datasource: - url: jdbc:postgresql://localhost:5432/notification - username: postgres - password: password - zipkin: - baseUrl: http://localhost:9411 - rabbitmq: - addresses: localhost:5672 # not http, because is a message queue protocol - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - fetch-registry: true - register-with-eureka: true + config: + import: + - classpath:shared-application-${spring.profiles.active}.yml + #RabbitMQ rabbitmq: exchange: @@ -49,7 +20,3 @@ rabbitmq: notification: notification.queue routing-key: internal-notification: internal.notification.routing-key -logging: - pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" # how to bind the queue to the exchange diff --git a/order/pom.xml b/order/pom.xml index 02e8b17..c028fcc 100644 --- a/order/pom.xml +++ b/order/pom.xml @@ -54,6 +54,11 @@ io.micrometer micrometer-registry-prometheus + + dev.nano + common + ${project.version} + dev.nano feign-clients diff --git a/order/src/main/resources/application-docker.yml b/order/src/main/resources/application-docker.yml deleted file mode 100644 index 075c201..0000000 --- a/order/src/main/resources/application-docker.yml +++ /dev/null @@ -1,43 +0,0 @@ -#Spring -server: - port: 8003 - servlet: - context-path: /order - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: order - datasource: - url: jdbc:postgresql://postgres:5432/orders - username: miliariadnane - password: password - zipkin: - baseUrl: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true diff --git a/order/src/main/resources/application-eks.yml b/order/src/main/resources/application-eks.yml deleted file mode 100644 index 9458b08..0000000 --- a/order/src/main/resources/application-eks.yml +++ /dev/null @@ -1,36 +0,0 @@ -#Spring -server: - port: 8003 - servlet: - context-path: /order - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: order - datasource: - url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/orders - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - zipkin: - baseUrl: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true diff --git a/order/src/main/resources/application-kube.yml b/order/src/main/resources/application-kube.yml deleted file mode 100644 index d147ff3..0000000 --- a/order/src/main/resources/application-kube.yml +++ /dev/null @@ -1,44 +0,0 @@ -#Spring -server: - port: 8003 - servlet: - context-path: /order - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: order - datasource: - url: jdbc:postgresql://postgres:5432/orders - username: miliariadnane - password: password - zipkin: - baseUrl: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - enabled: false diff --git a/order/src/main/resources/application.yml b/order/src/main/resources/application.yml index ab88a60..b13571e 100644 --- a/order/src/main/resources/application.yml +++ b/order/src/main/resources/application.yml @@ -1,47 +1,13 @@ -#Server server: port: 8003 servlet: context-path: /order error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring + include-message: always + spring: application: name: order - datasource: - url: jdbc:postgresql://localhost:5432/orders - username: postgres - password: password - zipkin: - base-url: http://localhost:9411 - rabbitmq: - addresses: localhost:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - fetch-registry: true - register-with-eureka: true -logging: - pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" + config: + import: + - classpath:shared-application-${spring.profiles.active}.yml diff --git a/payment/pom.xml b/payment/pom.xml index 2a38905..7208662 100644 --- a/payment/pom.xml +++ b/payment/pom.xml @@ -54,6 +54,11 @@ io.micrometer micrometer-registry-prometheus + + dev.nano + common + ${project.version} + dev.nano feign-clients diff --git a/payment/src/main/resources/application-docker.yml b/payment/src/main/resources/application-docker.yml deleted file mode 100644 index 64a0ec2..0000000 --- a/payment/src/main/resources/application-docker.yml +++ /dev/null @@ -1,44 +0,0 @@ -#Server -server: - port: 8005 - servlet: - context-path: /payment - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: payment - datasource: - url: jdbc:postgresql://postgres:5432/payment - username: miliariadnane - password: password - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - diff --git a/payment/src/main/resources/application-eks.yml b/payment/src/main/resources/application-eks.yml deleted file mode 100644 index 1646a99..0000000 --- a/payment/src/main/resources/application-eks.yml +++ /dev/null @@ -1,37 +0,0 @@ -#Server -server: - port: 8005 - servlet: - context-path: /payment - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: payment - datasource: - url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/payment - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: update - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true - diff --git a/payment/src/main/resources/application-kube.yml b/payment/src/main/resources/application-kube.yml deleted file mode 100644 index d92f56f..0000000 --- a/payment/src/main/resources/application-kube.yml +++ /dev/null @@ -1,45 +0,0 @@ -#Server -server: - port: 8005 - servlet: - context-path: /payment - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: payment - datasource: - url: jdbc:postgresql://postgres:5432/payment - username: miliariadnane - password: password - zipkin: - base-url: http://zipkin:9411 - rabbitmq: - addresses: rabbitmq:5672 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - enabled: false - diff --git a/payment/src/main/resources/application.yml b/payment/src/main/resources/application.yml index fdca7ff..77ab9d4 100644 --- a/payment/src/main/resources/application.yml +++ b/payment/src/main/resources/application.yml @@ -1,48 +1,13 @@ -#Server server: port: 8005 servlet: context-path: /payment error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring + include-message: always + spring: application: name: payment - datasource: - url: jdbc:postgresql://localhost:5432/payment - username: postgres - password: password - zipkin: - base-url: http://localhost:9411 - rabbitmq: - addresses: localhost:5672 # not http, because is a message queue protocol - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - fetch-registry: true - register-with-eureka: true -logging: - pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" - + config: + import: + - classpath:shared-application-${spring.profiles.active}.yml diff --git a/pom.xml b/pom.xml index b6856b6..38da51d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,13 +8,14 @@ 1.0-SNAPSHOT + common + eureka-server + gateway customer product order notification payment - eureka-server - gateway amqp feign-clients diff --git a/product/pom.xml b/product/pom.xml index 1c63719..d1b5e3c 100644 --- a/product/pom.xml +++ b/product/pom.xml @@ -59,6 +59,11 @@ io.micrometer micrometer-registry-prometheus + + dev.nano + common + ${project.version} + diff --git a/product/src/main/resources/application-docker.yml b/product/src/main/resources/application-docker.yml deleted file mode 100644 index 53f4ad3..0000000 --- a/product/src/main/resources/application-docker.yml +++ /dev/null @@ -1,41 +0,0 @@ -#Server -server: - port: 8002 - servlet: - context-path: /product - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: product - datasource: - url: jdbc:postgresql://postgres:5432/product - username: miliariadnane - password: password - zipkin: - baseUrl: http://zipkin:9411 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true diff --git a/product/src/main/resources/application-eks.yml b/product/src/main/resources/application-eks.yml deleted file mode 100644 index 8e50079..0000000 --- a/product/src/main/resources/application-eks.yml +++ /dev/null @@ -1,34 +0,0 @@ -#Server -server: - port: 8002 - servlet: - context-path: /product - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: product - datasource: - url: jdbc:postgresql://demo-microservices.csetxdk14qax.us-east-1.rds.amazonaws.com:5432/product - username: ${DB_USERNAME} - password: ${DB_PASSWORD} - zipkin: - baseUrl: http://zipkin:9411 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true diff --git a/product/src/main/resources/application-kube.yml b/product/src/main/resources/application-kube.yml deleted file mode 100644 index 33863e4..0000000 --- a/product/src/main/resources/application-kube.yml +++ /dev/null @@ -1,42 +0,0 @@ -#Server -server: - port: 8002 - servlet: - context-path: /product - error: - include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring -spring: - application: - name: product - datasource: - url: jdbc:postgresql://postgres:5432/product - username: miliariadnane - password: password - zipkin: - baseUrl: http://zipkin:9411 - jpa: - hibernate: - ddl-auto: create-drop - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://eureka-server:8761/eureka - fetch-registry: true - register-with-eureka: true - enabled: false diff --git a/product/src/main/resources/application.yml b/product/src/main/resources/application.yml index dfe212b..06d2046 100644 --- a/product/src/main/resources/application.yml +++ b/product/src/main/resources/application.yml @@ -1,45 +1,13 @@ -#Server server: port: 8002 servlet: context-path: /product error: include-message: always -#Management -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: always -#Spring + spring: application: name: product - datasource: - url: jdbc:postgresql://localhost:5432/product - username: postgres - password: password - zipkin: - base-url: http://localhost:9411 - jpa: - hibernate: - ddl-auto: update - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - format_sql: true - show-sql: true -#Eureka-Client -eureka: - client: - service-url: - defaultZone: http://localhost:8761/eureka - fetch-registry: true - register-with-eureka: true -logging: - pattern: - # Logging pattern containing traceId and spanId; no longer provided through Sleuth by default - level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" + config: + import: + - classpath:shared-application-${spring.profiles.active}.yml