Bladeren bron

把push加入到SpringCloud中

wang-hai-cheng 5 jaren geleden
bovenliggende
commit
1dd95bfdc4

+ 4 - 1
lift-push/pom.xml

@@ -35,7 +35,10 @@
             <groupId>cn.com.xwy</groupId>
             <artifactId>xwy-spring-boot</artifactId>
         </dependency>
-
+<!--        <dependency>-->
+<!--            <groupId>cn.com.xwy</groupId>-->
+<!--            <artifactId>xwy-cloud-dependencies</artifactId>-->
+<!--        </dependency>-->
     </dependencies>
 
     <build>

+ 2 - 0
lift-push/src/main/java/cn/com/ty/lift/push/PushApplication.java

@@ -3,6 +3,7 @@ package cn.com.ty.lift.push;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
 import org.springframework.jms.annotation.EnableJms;
 import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
@@ -14,6 +15,7 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
  * @since 2020/4/13
  */
 @EnableJms
+@EnableFeignClients
 @MapperScan("cn.com.ty.**.mapper")
 @SpringBootApplication
 @EnableRedisHttpSession

+ 24 - 0
lift-push/src/main/resources/bootstrap.yml

@@ -0,0 +1,24 @@
+spring:
+  cloud:
+    config:
+      fail-fast: true
+      discovery:
+        service-id: lift-config-server
+        enabled: true
+      name: portal
+      profile: ${spring.profiles.active}
+      failFast: true
+      retry:
+        multipliter: 1000
+        initial-interval: 1.2
+        max-interval: 2000
+        max-attempts: 6
+eureka:
+  instance:
+    prefer-ip-address: true
+    lease-renewal-interval-in-seconds: 5
+    lease-expiration-duration-in-seconds: 20
+  client:
+    service-url:
+      defaultZone: http://172.16.24.142:10225/eureka/
+