添加eureka注册中心支持

This commit is contained in:
macro
2019-10-17 16:36:05 +08:00
parent feff3937ac
commit 47eaa3a5af
39 changed files with 192 additions and 1150 deletions

View File

@@ -2,7 +2,9 @@ package com.macro.mall.portal;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@SpringBootApplication
public class MallPortalApplication {

View File

@@ -1,6 +1,3 @@
server:
port: 8085
spring:
datasource:
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
@@ -15,13 +12,11 @@ spring:
stat-view-servlet: #访问监控网页的登录用户名和密码
login-username: druid
login-password: druid
data:
mongodb:
host: localhost
port: 27017
database: mall-port
redis:
host: localhost # Redis服务器地址
database: 0 # Redis数据库索引默认为0
@@ -34,7 +29,6 @@ spring:
max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
timeout: 3000ms # 连接超时时间(毫秒)
rabbitmq:
host: localhost
port: 5672
@@ -42,11 +36,16 @@ spring:
username: mall
password: mall
publisher-confirms: true #如果对异步消息需要回调必须设置为true
# 日志配置
logging:
level:
org.springframework.data.mongodb.core: debug
com.macro.mall.mapper: debug
com.macro.mall.portal.dao: debug
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8001/eureka/

View File

@@ -5,7 +5,6 @@ server:
key-alias: tomcat
key-store-password: 123456
key-store-type: PKCS12
spring:
datasource:
url: jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
@@ -20,13 +19,11 @@ spring:
stat-view-servlet: #访问监控网页的登录用户名和密码
login-username: druid
login-password: druid
data:
mongodb:
host: localhost
port: 27017
database: mall-port
redis:
host: localhost # Redis服务器地址
database: 0 # Redis数据库索引默认为0
@@ -39,7 +36,6 @@ spring:
max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
timeout: 3000ms # 连接超时时间(毫秒)
rabbitmq:
host: localhost
port: 5672
@@ -47,7 +43,6 @@ spring:
username: mall
password: mall
publisher-confirms: true #如果对异步消息需要回调必须设置为true
# 日志配置
logging:
level:

View File

@@ -1,6 +1,3 @@
server:
port: 8085
spring:
datasource:
url: jdbc:mysql://db:3306/mall?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
@@ -15,13 +12,11 @@ spring:
stat-view-servlet: #访问监控网页的登录用户名和密码
login-username: druid
login-password: druid
data:
mongodb:
host: mongo
port: 27017
database: mall-port
redis:
host: redis # Redis服务器地址
database: 0 # Redis数据库索引默认为0
@@ -34,7 +29,6 @@ spring:
max-idle: 8 # 连接池中的最大空闲连接
min-idle: 0 # 连接池中的最小空闲连接
timeout: 0ms # 连接超时时间(毫秒)
rabbitmq:
host: rabbit
port: 5672

View File

@@ -1,15 +1,16 @@
spring:
profiles:
active: dev #默认为开发环境
application:
name: mall-portal
server:
port: 8085
mybatis:
mapper-locations:
- classpath:dao/*.xml
- classpath*:com/**/mapper/*.xml
http:
port: 8085 # http服务端口
# 自定义redis key
redis:
key:
@@ -18,7 +19,6 @@ redis:
orderId: "portal:orderId:"
expire:
authCode: 90 # 验证码超期时间
# 消息队列定义
rabbitmq:
queue: