您现在的位置是:首页 > 文章详情

[Spring cloud 一步步实现广告系统] 9. 主类和配置文件

日期:2019-07-30点击:321

搜索系统启动主类

/** * AdSearchApplication for 广告搜索服务启动类 * * @author <a href="mailto:magicianisaac@gmail.com">Isaac.Zhang | 若初</a> */ @EnableFeignClients //启动Feign 客户端,为了访问其他微服务 @EnableDiscoveryClient // 开启服务发现组件,在这里等同于 @EnableEurekaClient @EnableHystrix // 开启hystrix 断路器 @EnableCircuitBreaker // 断路器 @EnableHystrixDashboard // 开启hystrix 监控 @SpringBootApplication public class AdSearchApplication { public static void main(String[] args) { SpringApplication.run(AdSearchApplication.class, args); } }

配置文件

server: port: 7001 servlet: context-path: /ad-search #http请求的根路径(请求前缀,在handle的mapping之前,需要127.0.0.1/ad-search/XXXX) spring: application: name: mscx-ad-search jpa: show-sql: true #执行时是否打印sql语句,方便调试 hibernate: ddl-auto: none properties: hibernate.format_sql: true open-in-view: false #控制是否在懒加载时,有可能会找不到bean报错 datasource: username: root url: jdbc:mysql://127.0.0.1:3306/advertisement?useSSL=false&autoReconnect=true password: **** tomcat: max-active: 4 #最大连接数 min-idle: 2 #最小空闲连接数 initial-size: 2 #默认初始化连接数 eureka: client: service-url: defaultZone: http://server1:7777/eureka/,http://server2:8888/eureka/,http://server3:9999/eureka/ feign: hystrix: enabled: true management: endpoints: web: exposure: include: "*" adconf: mysql: host: 127.0.0.1 port: 3306 username: root password: **** binlogName: "" position: -1 kafka: topic: ad-search-mysql-data
原文链接:https://yq.aliyun.com/articles/712027
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章