先给eureka客户端配置:
#注册中心地址
eureka.client.service-url.defaultZone=http://localhost:9999/eureka/
#服务过期时间配置,超过这个时间没有接收到心跳,服务端就会将这个实例剔除
eureka.instance.lease-expiration-duration-in-seconds=90
#服务刷新时间配置,每隔这个时间会主动心跳一次
eureka.instance.lease-renewal-interval-in-seconds=30
再给服务端配置:
#本机端口
server.port=9999
spring.application.name=order_moniter
spring.profiles.active=dev
#是否向注册中心注册自己
eureka.client.register-with-eureka=false
#是否从注册中心查询服务
eureka.client.fetch-registry=false
#关闭自我保护
eureka.server.enable-self-preservation=false
#服务端每隔1分钟刷新服务列表,将无效服务剔除
eureka.server.eviction-interval-timer-in-ms=60000
#邮件
spring.mail.host=smtp.163.com
[email protected]
spring.mail.password=wlf123456
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.starttls.required=true
spring.mail.properties.mail.starttls.enable=true
spring.mail.default-encoding=UTF-8
mail.from=${spring.mail.username}
[email protected];[email protected]
接着给eureka服务端加上服务下线监听:
import com.wlf.monitor.order_monitor.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.eureka.server.event.EurekaInstanceCanceledEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
@Component
public class EurekaListener {
private final static SimpleDateFormat SF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Autowired
MailService mailService;
@EventListener
public void listen(EurekaInstanceCanceledEvent event) {
StringBuilder sb = new StringBuilder();
sb.append("服务ID=");
sb.append(event.getServerId());
sb.append(System.getProperty("line.seperator", "\n"));
sb.append("应用名=");
sb.append(event.getAppName());
sb.append(System.getProperty("line.seperator", "\n"));
sb.append("时间=");
sb.append(SF.format(event.getTimestamp()));
mailService.sendSimpleMail("火烧眉毛!!!你的服务挂了,快来救火~~~", sb.toString());
}
}
MailService类详见springboot群发邮件问题实例 。
好了,现在分别启动eureka服务端和客户端,然后把客户端停掉,观察服务端是否发送邮件:
服务端日志:
2020-01-03 17:38:37.349 INFO 142432 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-01-03 17:38:38.572 INFO 142432 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2020-01-03 17:38:38.634 INFO 142432 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2020-01-03 17:38:38.635 INFO 142432 --- [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2020-01-03 17:38:38.648 INFO 142432 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1578044318645 with initial instances count: 0
2020-01-03 17:38:38.719 INFO 142432 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2020-01-03 17:38:38.728 INFO 142432 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:9999/eureka/]
2020-01-03 17:38:38.988 INFO 142432 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2020-01-03 17:38:38.988 INFO 142432 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2020-01-03 17:38:38.988 INFO 142432 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2020-01-03 17:38:38.989 INFO 142432 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2020-01-03 17:38:39.184 INFO 142432 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Replica node URL: http://localhost:9999/eureka/
2020-01-03 17:38:39.197 INFO 142432 --- [ main] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2020-01-03 17:38:39.198 INFO 142432 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initialized
2020-01-03 17:38:39.218 INFO 142432 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-01-03 17:38:39.353 INFO 142432 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application ORDER_MONITER with eureka with status UP
2020-01-03 17:38:39.365 INFO 142432 --- [ Thread-16] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..
2020-01-03 17:38:39.367 INFO 142432 --- [ Thread-16] o.s.c.n.e.server.EurekaServerBootstrap : Eureka data center value eureka.datacenter is not set, defaulting to default
2020-01-03 17:38:39.367 INFO 142432 --- [ Thread-16] o.s.c.n.e.server.EurekaServerBootstrap : Eureka environment value eureka.environment is not set, defaulting to test
2020-01-03 17:38:39.385 INFO 142432 --- [ Thread-16] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false
2020-01-03 17:38:39.387 INFO 142432 --- [ Thread-16] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context
2020-01-03 17:38:39.387 INFO 142432 --- [ Thread-16] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2020-01-03 17:38:39.387 INFO 142432 --- [ Thread-16] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2020-01-03 17:38:39.387 INFO 142432 --- [ Thread-16] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2020-01-03 17:38:39.398 INFO 142432 --- [ Thread-16] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2020-01-03 17:38:39.468 INFO 142432 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9999 (http) with context path ''
2020-01-03 17:38:39.470 INFO 142432 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 9999
2020-01-03 17:38:39.472 INFO 142432 --- [ main] c.w.m.o.OrderMonitorApplication : Started OrderMonitorApplication in 12.772 seconds (JVM running for 15.76)
2020-01-03 17:38:40.937 INFO 142432 --- [)-10.73.166.158] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-01-03 17:38:40.938 INFO 142432 --- [)-10.73.166.158] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-01-03 17:38:40.950 INFO 142432 --- [)-10.73.166.158] o.s.web.servlet.DispatcherServlet : Completed initialization in 12 ms
2020-01-03 17:39:13.801 INFO 142432 --- [nio-9999-exec-2] c.n.e.registry.AbstractInstanceRegistry : Registered instance ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 with status UP (replication=false)
2020-01-03 17:39:14.461 INFO 142432 --- [nio-9999-exec-3] c.n.e.registry.AbstractInstanceRegistry : Registered instance ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 with status UP (replication=true)
2020-01-03 17:39:39.389 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:40:39.389 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:41:39.395 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:42:39.390 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:43:39.391 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:44:39.391 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:45:39.392 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:45:39.399 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Evicting 1 items (expired=1, evictionLimit=1)
2020-01-03 17:45:39.400 WARN 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : DS: Registry: expired lease for ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988
2020-01-03 17:45:41.401 INFO 142432 --- [a-EvictionTimer] c.w.m.order_monitor.service.MailService : 邮件已经发送。
2020-01-03 17:45:41.403 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 (replication=false)
2020-01-03 17:46:39.393 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 1ms
2020-01-03 17:47:39.428 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 34ms
2020-01-03 17:48:39.428 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
2020-01-03 17:49:39.429 INFO 142432 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms
客户端日志:
2020-01-03 17:39:13.694 |-INFO [main] org.apache.coyote.http11.Http11NioProtocol [173] -| Starting ProtocolHandler ["http-nio-9988"]
2020-01-03 17:39:13.700 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "183[\r][\n]"
2020-01-03 17:39:13.700 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [87] -| >> "{"instance":{"instanceId":"wulf00.home.langchao.com:order_prize:9988","hostName":"wulf00.home.langchao.com","app":"ORDER_PRIZE","ipAddr":"10.73.166.158","status":"UP","overriddenStatus":"UNKNOWN","port":{"$":9988,"@enabled":"true"},"securePort":{"$":443,"@enabled":"false"},"countryId":1,"dataCenterInfo":{"@class":"com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo","name":"MyOwn"}"
2020-01-03 17:39:13.700 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:13.740 |-INFO [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer [202] -| Tomcat started on port(s): 9988 (http) with context path ''
2020-01-03 17:39:13.744 |-INFO [main] org.springframework.cloud.netflix.eureka.serviceregistry.EurekaAutoServiceRegistration [141] -| Updating port to 9988
2020-01-03 17:39:13.754 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "9d[\r][\n]"
2020-01-03 17:39:13.754 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [87] -| >> ","leaseInfo":{"renewalIntervalInSecs":30,"durationInSecs":90,"registrationTimestamp":0,"lastRenewalTimestamp":0,"evictionTimestamp":0,"serviceUpTimestamp":0}"
2020-01-03 17:39:13.754 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:13.765 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "26[\r][\n]"
2020-01-03 17:39:13.766 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [87] -| >> ","metadata":{"management.port":"9988"}"
2020-01-03 17:39:13.766 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:13.750 |-INFO [main] com.wlf.order.prize.PrizeApplication [59] -| Started PrizeApplication in 18.352 seconds (JVM running for 20.756)
2020-01-03 17:39:13.782 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "175[\r][\n]"
2020-01-03 17:39:13.783 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [87] -| >> ","homePageUrl":"http://wulf00.home.langchao.com:9988/","statusPageUrl":"http://wulf00.home.langchao.com:9988/actuator/info","healthCheckUrl":"http://wulf00.home.langchao.com:9988/actuator/health","vipAddress":"order_prize","secureVipAddress":"order_prize","isCoordinatingDiscoveryServer":"false","lastUpdatedTimestamp":"1578044351076","lastDirtyTimestamp":"1578044353660"}}"
2020-01-03 17:39:13.783 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:13.783 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "0[\r][\n]"
2020-01-03 17:39:13.784 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:13.805 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| << "HTTP/1.1 204 [\r][\n]"
2020-01-03 17:39:13.805 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| << "Content-Type: application/json[\r][\n]"
2020-01-03 17:39:13.805 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| << "Date: Fri, 03 Jan 2020 09:39:13 GMT[\r][\n]"
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.wire [73] -| << "[\r][\n]"
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.impl.conn.DefaultClientConnection [259] -| Receiving response: HTTP/1.1 204
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.headers [262] -| << HTTP/1.1 204
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.headers [265] -| << Content-Type: application/json
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.headers [265] -| << Date: Fri, 03 Jan 2020 09:39:13 GMT
2020-01-03 17:39:13.806 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] org.apache.http.impl.client.DefaultHttpClient [504] -| Connection can be kept alive indefinitely
2020-01-03 17:39:13.807 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.MonitoredConnectionManager [286] -| Released connection is reusable.
2020-01-03 17:39:13.807 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.NamedConnectionPool [431] -| Releasing connection [{}->http://localhost:9999][null]
2020-01-03 17:39:13.807 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.NamedConnectionPool [457] -| Pooling connection [{}->http://localhost:9999][null]; keep alive indefinitely
2020-01-03 17:39:13.807 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.NamedConnectionPool [678] -| Notifying no-one, there are no waiting threads
2020-01-03 17:39:13.808 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [60] -| Jersey HTTP POST http://localhost:9999/eureka//apps/ORDER_PRIZE with instance wulf00.home.langchao.com:order_prize:9988; statusCode=204
2020-01-03 17:39:13.808 |-DEBUG [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient [121] -| Pinning to endpoint null
2020-01-03 17:39:13.808 |-INFO [DiscoveryClient-InstanceInfoReplicator-0] com.netflix.discovery.DiscoveryClient [835] -| DiscoveryClient_ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 - registration status: 204
2020-01-03 17:39:42.521 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.MonitoredConnectionManager [332] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:39:42.521 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.NamedConnectionPool [720] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:39:43.643 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [958] -| Disable delta property : false
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [959] -| Single vip registry refresh property : null
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [960] -| Force full registry fetch : false
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [961] -| Application is null : false
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [962] -| Registered Applications size is zero : true
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [964] -| Application version is -1: false
2020-01-03 17:39:43.644 |-INFO [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1047] -| Getting all instance registry info from the eureka server
2020-01-03 17:39:43.645 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:39:43.645 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [347] -| [{}->http://localhost:9999] total kept alive: 1, total issued: 0, total allocated: 1 out of 200
2020-01-03 17:39:43.645 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [496] -| Getting free connection [{}->http://localhost:9999][null]
2020-01-03 17:39:43.646 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [426] -| Stale connection check
2020-01-03 17:39:43.648 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestAddCookies [123] -| CookieSpec selected: default
2020-01-03 17:39:43.648 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestAuthCache [77] -| Auth cache not set in the context
2020-01-03 17:39:43.648 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestTargetAuthentication [80] -| Target auth state: UNCHALLENGED
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestProxyAuthentication [89] -| Proxy auth state: UNCHALLENGED
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [677] -| Attempt 1 to execute request
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [347] -| [{}->http://localhost:9999] total kept alive: 0, total issued: 1, total allocated: 1 out of 200
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [274] -| Sending request: GET /eureka/apps/ HTTP/1.1
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [522] -| No free connections [{}->http://localhost:9999][null]
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [366] -| Available capacity: 49 out of 50 [{}->http://localhost:9999][null]
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "GET /eureka/apps/ HTTP/1.1[\r][\n]"
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [548] -| Creating new connection [{}->http://localhost:9999]
2020-01-03 17:39:43.649 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Accept: application/json[\r][\n]"
2020-01-03 17:39:43.650 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2020-01-03 17:39:43.650 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2020-01-03 17:39:43.650 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Id: 10.73.166.158[\r][\n]"
2020-01-03 17:39:43.650 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Accept-Encoding: gzip[\r][\n]"
2020-01-03 17:39:43.650 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Host: localhost:9999[\r][\n]"
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Connection: Keep-Alive[\r][\n]"
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "User-Agent: Java-EurekaClient/v1.9.8[\r][\n]"
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [278] -| >> GET /eureka/apps/ HTTP/1.1
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.conn.DefaultClientConnectionOperator [177] -| Connecting to localhost:9999
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Accept: application/json
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Name: DefaultClient
2020-01-03 17:39:43.651 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Version: 1.4
2020-01-03 17:39:43.652 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Id: 10.73.166.158
2020-01-03 17:39:43.652 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Accept-Encoding: gzip
2020-01-03 17:39:43.652 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Host: localhost:9999
2020-01-03 17:39:43.652 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Connection: Keep-Alive
2020-01-03 17:39:43.652 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> User-Agent: Java-EurekaClient/v1.9.8
2020-01-03 17:39:43.653 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestAddCookies [123] -| CookieSpec selected: default
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestAuthCache [77] -| Auth cache not set in the context
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestTargetAuthentication [80] -| Target auth state: UNCHALLENGED
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestProxyAuthentication [89] -| Proxy auth state: UNCHALLENGED
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.client.DefaultHttpClient [677] -| Attempt 1 to execute request
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [274] -| Sending request: PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1
2020-01-03 17:39:43.654 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "HTTP/1.1 200 [\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Encoding: gzip[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Id: 10.73.166.158[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Type: application/json[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Accept-Encoding: gzip[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Length: 539[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Content-Length: 0[\r][\n]"
2020-01-03 17:39:43.655 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Date: Fri, 03 Jan 2020 09:39:43 GMT[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Host: localhost:9999[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [259] -| Receiving response: HTTP/1.1 200
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Connection: Keep-Alive[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [262] -| << HTTP/1.1 200
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "User-Agent: Java-EurekaClient/v1.9.8[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Encoding: gzip
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [278] -| >> PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Type: application/json
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Name: DefaultClient
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Length: 539
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Version: 1.4
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Date: Fri, 03 Jan 2020 09:39:43 GMT
2020-01-03 17:39:43.656 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Id: 10.73.166.158
2020-01-03 17:39:43.657 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [504] -| Connection can be kept alive indefinitely
2020-01-03 17:39:43.657 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Accept-Encoding: gzip
2020-01-03 17:39:43.657 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Content-Length: 0
2020-01-03 17:39:43.657 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Host: localhost:9999
2020-01-03 17:40:12.524 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.MonitoredConnectionManager [332] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:40:12.524 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.NamedConnectionPool [720] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:40:13.675 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:40:13.675 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [347] -| [{}->http://localhost:9999] total kept alive: 2, total issued: 0, total allocated: 2 out of 200
2020-01-03 17:40:13.675 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [496] -| Getting free connection [{}->http://localhost:9999][null]
2020-01-03 17:40:13.676 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.client.DefaultHttpClient [426] -| Stale connection check
2020-01-03 17:40:13.678 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestAddCookies [123] -| CookieSpec selected: default
2020-01-03 17:40:13.678 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestAuthCache [77] -| Auth cache not set in the context
2020-01-03 17:40:13.678 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestTargetAuthentication [80] -| Target auth state: UNCHALLENGED
2020-01-03 17:40:13.678 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.client.protocol.RequestProxyAuthentication [89] -| Proxy auth state: UNCHALLENGED
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.client.DefaultHttpClient [677] -| Attempt 1 to execute request
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [274] -| Sending request: PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1[\r][\n]"
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Id: 10.73.166.158[\r][\n]"
2020-01-03 17:40:13.679 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Accept-Encoding: gzip[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Content-Length: 0[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Host: localhost:9999[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "Connection: Keep-Alive[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "User-Agent: Java-EurekaClient/v1.9.8[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [278] -| >> PUT /eureka/apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988?status=UP&lastDirtyTimestamp=1578044353660 HTTP/1.1
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Name: DefaultClient
2020-01-03 17:40:13.680 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Version: 1.4
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Id: 10.73.166.158
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Accept-Encoding: gzip
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Content-Length: 0
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Host: localhost:9999
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> Connection: Keep-Alive
2020-01-03 17:40:13.681 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [281] -| >> User-Agent: Java-EurekaClient/v1.9.8
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| << "HTTP/1.1 200 [\r][\n]"
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| << "Content-Type: application/xml[\r][\n]"
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| << "Content-Length: 0[\r][\n]"
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| << "Date: Fri, 03 Jan 2020 09:40:13 GMT[\r][\n]"
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.wire [73] -| << "[\r][\n]"
2020-01-03 17:40:13.685 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [259] -| Receiving response: HTTP/1.1 200
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [262] -| << HTTP/1.1 200
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [265] -| << Content-Type: application/xml
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [265] -| << Content-Length: 0
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.headers [265] -| << Date: Fri, 03 Jan 2020 09:40:13 GMT
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] org.apache.http.impl.client.DefaultHttpClient [504] -| Connection can be kept alive indefinitely
2020-01-03 17:40:13.686 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [286] -| Released connection is reusable.
2020-01-03 17:40:13.687 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [431] -| Releasing connection [{}->http://localhost:9999][null]
2020-01-03 17:40:13.687 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [457] -| Pooling connection [{}->http://localhost:9999][null]; keep alive indefinitely
2020-01-03 17:40:13.687 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [678] -| Notifying no-one, there are no waiting threads
2020-01-03 17:40:13.687 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [110] -| Jersey HTTP PUT http://localhost:9999/eureka//apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988; statusCode=200
2020-01-03 17:40:13.687 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient [847] -| DiscoveryClient_ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 - Heartbeat status: 200
2020-01-03 17:40:13.716 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:40:13.716 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [347] -| [{}->http://localhost:9999] total kept alive: 2, total issued: 0, total allocated: 2 out of 200
2020-01-03 17:40:13.716 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [496] -| Getting free connection [{}->http://localhost:9999][null]
2020-01-03 17:40:13.717 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [426] -| Stale connection check
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestAddCookies [123] -| CookieSpec selected: default
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestAuthCache [77] -| Auth cache not set in the context
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestTargetAuthentication [80] -| Target auth state: UNCHALLENGED
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.client.protocol.RequestProxyAuthentication [89] -| Proxy auth state: UNCHALLENGED
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [677] -| Attempt 1 to execute request
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [274] -| Sending request: GET /eureka/apps/delta HTTP/1.1
2020-01-03 17:40:13.719 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "GET /eureka/apps/delta HTTP/1.1[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Accept: application/json[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Name: DefaultClient[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Version: 1.4[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "DiscoveryIdentity-Id: 10.73.166.158[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Accept-Encoding: gzip[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Host: localhost:9999[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "Connection: Keep-Alive[\r][\n]"
2020-01-03 17:40:13.720 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "User-Agent: Java-EurekaClient/v1.9.8[\r][\n]"
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| >> "[\r][\n]"
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [278] -| >> GET /eureka/apps/delta HTTP/1.1
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Accept: application/json
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Name: DefaultClient
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Version: 1.4
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> DiscoveryIdentity-Id: 10.73.166.158
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Accept-Encoding: gzip
2020-01-03 17:40:13.721 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Host: localhost:9999
2020-01-03 17:40:13.722 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> Connection: Keep-Alive
2020-01-03 17:40:13.722 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [281] -| >> User-Agent: Java-EurekaClient/v1.9.8
2020-01-03 17:40:13.725 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "HTTP/1.1 200 [\r][\n]"
2020-01-03 17:40:13.725 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Encoding: gzip[\r][\n]"
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Type: application/json[\r][\n]"
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Content-Length: 545[\r][\n]"
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "Date: Fri, 03 Jan 2020 09:40:13 GMT[\r][\n]"
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "[\r][\n]"
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.conn.DefaultClientConnection [259] -| Receiving response: HTTP/1.1 200
2020-01-03 17:40:13.726 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [262] -| << HTTP/1.1 200
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Encoding: gzip
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Type: application/json
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Content-Length: 545
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.headers [265] -| << Date: Fri, 03 Jan 2020 09:40:13 GMT
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.impl.client.DefaultHttpClient [504] -| Connection can be kept alive indefinitely
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "[0x1f][0x8b][0x8][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x9d]SM[0x8f][0xda]0[0x10][0xfd]/[0xd6][0x1e]QH[0x14]>s[0xda][0x15][0xe1][0x80][0xaa][0x2][0x82][0xd2]J[0xad][0xaa]h[0xea][0xc][0xc4][0xaa]cG[0xb6][0x3][0xa5]+[0xfe]{[0xc7]IC[0x97][0xee]rh[0x95]C[0xe2][0x99]7[0xcf]3o^[0x9e][0x19]T[0x95][0x14][0x1c][0x9c][0xd0][0xca][0xb2][0xe4][0x99][0x1d][0xd1]X[0xff][0x9d]e9J[0x7],a[0x11][0xeb]y[0x14]E[\n]"
2020-01-03 17:40:13.727 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "[0xb0][0x5][0xd7]9Rp[0xb7][0xce][0xa2][0xac]Mt[0xe5],[0xf9][0xf2][0xcc][0x14][0x94]>[0xbd][0xda][0xa4][0xf3]M[0xb6][0xde],>[0xcf][0x9]$[0x94]u[0xa0]86[0x88][0xee][0xb0][0xc8][0x9]w[0xaa][0xe5]>[0xc][0x83]B[0x97][0x18]HP[0x7]^[0x80][0xe][0xb8].[0x13]mr4Ye[0xc4]OL[0xa6][0xd3][0xc9][0x84]X[\n]"
2020-01-03 17:40:13.728 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [73] -| << "m[0xdd][0xb2][0xa5][0xbf]W[0xd6]6[0xf4][0xfa][0xfe][0xea])[0xcf][0x8d][0x1f]%[0xc][0xc6]q[0x10][0x8d]FA4[0xf4][0x94][0xd4][0x89][0xab]m3[0xe][0x9d]4[0xcd]nD[0x9e][0xa3][0xda]^[0xe3][0xcb]w[0xcb][0xd5][0xa7]%%+m[0x9c][0xd7][0xe7][0x81]5[0xfd][0xf4][0xd8]#*[0xf8]&[0xd1]O[0xe1]L[0x8d][0xec]Bt[0xc8]k[0x83][0xeb]?[0xc8][0xc1] [0xbe][0x1][0xee]A[0xda][0x6][0xc9]u[0xad][0x9c]9{[\r][0xa2][0x1e][0xcb][0xc1][0xc1][0xc][0x95]C[0xb3]P{[0xed]k[0x1f][0xb9][0x4][0xeb][0x1b][0xa0][0xa1][0x2][0x85]n/[0xc5][0x8f][0x80]F[0x13][0x94][0xf][0x16][0x9d][0x82]txHq[0xf][0xb5]t[0xe9]-E[0xaf][[0xc4][0xfb][0xf3][0xea][0xa4][0xfc][0x8d][0x12][0xc1]bGoP[0xe1][0x9][0xe4][0xc2][0xe3][0x8f][0xfe][0xbd]EN[0xb7][0xc5]![0xf5]R[0x9b]f[0x9b]]lJ1[0x83][0x7]a][0x1b][0xff] J[0xa4][0xeb]KR9[0x1a][0x8e]'![0x8d]8[0x1c][0xc]F[0x84][0xa2][0x8e][0xdd][0xa6]%~[\r][0x1a][0x86][0xf1]hBb[0xe0]Q[0xf0][0xbf]hB/[0x9c][0xa1]8[0xee][0xaa][0xb7][0xd8][0xe3][0xf1]4[0xa4][0x1]Jt[0xe0][0x85][0xf2][0xfd][0x97][0xa0][0xe0][0x80]%[0xcd][0x1b][0xb4]{a[0x8d]G.[0xde]$%[0xae])[0xb7]3[0x92][0xa2][0x85]sU[0xd2][0xef][0xdf]u[0x99][0xaf][0xea]_}[0xf0][0x8f]u[0xc0]][\r]N[0x9b][0xbe]h[0x15]/[0x10][0xa4]+f[0x5][0xf2][0xef][0xff][0xc3][0xd2][0x96][0x13][0xcf][0xb1][0xb5]+6[0xfb][0xf1][0x1f][0xb0][0xce]`[0x1f][0xef][0x3][0x84][0x9d]i[0x8a][0x8]E[0xbb]R[0x87]TX[0xee]M}[0xde][0x92][0xbe]h[0xae][0x6]lw[0xb5][0xab]HN[0xcc]_H[0xce]n6[0xfa][0x1b][0x96][\n]"
2020-01-03 17:40:13.728 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] org.apache.http.wire [87] -| << "[0xe3][0xce]o[0x82][0xe2]Q[0x3][0x82]v[0xa1][0xe7][0xca][0xfb][0xed])M[0xe7])[0xbb]|[0xa5][0xe7][0xf2][0xb][0xa9][0xf1]}[0xcc]][0x4][0x0][0x0]"
2020-01-03 17:40:13.729 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [286] -| Released connection is reusable.
2020-01-03 17:40:13.729 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [431] -| Releasing connection [{}->http://localhost:9999][null]
2020-01-03 17:40:13.729 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [457] -| Pooling connection [{}->http://localhost:9999][null]; keep alive indefinitely
2020-01-03 17:40:13.729 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.NamedConnectionPool [678] -| Notifying no-one, there are no waiting threads
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.util.DeserializerStringCache [122] -| clearing global-level cache with size 1
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.util.DeserializerStringCache [126] -| clearing app-level serialization cache with size 9
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [206] -| Jersey HTTP GET http://localhost:9999/eureka//apps/delta?; statusCode=200
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1095] -| Got delta update with apps hashcode UP_1_
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1208] -| Added instance wulf00.home.langchao.com:order_prize:9988 to the existing apps in region null
2020-01-03 17:40:13.730 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1235] -| The total number of instances fetched by the delta processor : 1
2020-01-03 17:40:13.731 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1126] -| The total number of all instances in the client now is 1
2020-01-03 17:40:13.731 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1497] -| Completed cache refresh task for discovery. All Apps hash code is Local region apps hashcode: UP_1_, is fetching remote regions? false
2020-01-03 17:40:34.856 |-DEBUG [HikariPool-1 housekeeper] com.zaxxer.hikari.pool.HikariPool [411] -| HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
2020-01-03 17:40:42.526 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.MonitoredConnectionManager [332] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:40:42.526 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.NamedConnectionPool [720] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:40:43.688 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:40:43.700 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [110] -| Jersey HTTP PUT http://localhost:9999/eureka//apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988; statusCode=200
2020-01-03 17:40:43.700 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient [847] -| DiscoveryClient_ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 - Heartbeat status: 200
2020-01-03 17:40:43.732 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:41:12.527 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.MonitoredConnectionManager [332] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:41:12.527 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.NamedConnectionPool [720] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:41:13.703 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:41:13.760 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [206] -| Jersey HTTP GET http://localhost:9999/eureka//apps/delta?; statusCode=200
2020-01-03 17:41:13.760 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1095] -| Got delta update with apps hashcode UP_1_
2020-01-03 17:41:42.529 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.MonitoredConnectionManager [332] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:41:42.529 |-DEBUG [Eureka-JerseyClient-Conn-Cleaner2] com.netflix.discovery.shared.NamedConnectionPool [720] -| Closing connections idle longer than 30000 SECONDS
2020-01-03 17:41:43.715 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
2020-01-03 17:41:43.727 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient [110] -| Jersey HTTP PUT http://localhost:9999/eureka//apps/ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988; statusCode=200
2020-01-03 17:41:43.727 |-DEBUG [DiscoveryClient-HeartbeatExecutor-0] com.netflix.discovery.DiscoveryClient [847] -| DiscoveryClient_ORDER_PRIZE/wulf00.home.langchao.com:order_prize:9988 - Heartbeat status: 200
2020-01-03 17:41:43.762 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.shared.MonitoredConnectionManager [240] -| Get connection: {}->http://localhost:9999, timeout = 5000
http://localhost:9999/eureka//apps/delta?; statusCode=200
2020-01-03 17:41:43.775 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1095] -| Got delta update with apps hashcode UP_1_
2020-01-03 17:41:43.775 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1208] -| Added instance wulf00.home.langchao.com:order_prize:9988 to the existing apps in region null
2020-01-03 17:41:43.775 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1235] -| The total number of instances fetched by the delta processor : 1
2020-01-03 17:41:43.775 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1126] -| The total number of all instances in the client now is 1
2020-01-03 17:41:43.775 |-DEBUG [DiscoveryClient-CacheRefreshExecutor-0] com.netflix.discovery.DiscoveryClient [1497] -| Completed cache refresh task for discovery. All Apps hash code is Local region apps hashcode: UP_1_, is fetching remote regions? false
2020-01-03 17:42:04.866 |-DEBUG [HikariPool-1 housekeeper] com.zaxxer.hikari.pool.HikariPool [411] -| HikariPool-1 - Pool stats (total=10, active=0, idle=10, waiting=0)
Process finished with exit code -1
客户端日志太多,删掉了一些,按eureka客户端的配置,客户端每30秒发送一次心跳,在续租时间90秒过了之后仍未收到心跳则认为服务实例下线,服务端每隔一分钟刷新服务实例,发现实例被移除则发送邮件通知相关人。
但现在有个问题:邮件会重复发送。我们不希望被垃圾邮件骚扰,重构下监听类:
@Slf4j
@Component
public class EurekaListener {
private final static SimpleDateFormat SF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private final static Set services = new HashSet<>();
@Autowired
MailService mailService;
@EventListener
public void listen(EurekaInstanceCanceledEvent event) throws InterruptedException {
String serviceId = event.getServerId();
String appName = event.getAppName();
// 已经下线的服务,我们不需要重复发送邮件,外层拦截
if (services.contains(serviceId + appName)) {
log.warn("[Out] This serviceId has canceled, serviceId : {}, appName : {}", serviceId, appName);
return;
}
synchronized (this) {
// 已经下线的服务,我们不需要重复发送邮件,内层拦截
if (services.contains(serviceId + appName)) {
log.warn("[In] This serviceId has canceled, serviceId : {}, appName : {}", serviceId, appName);
return;
}
// 首次下线,添加发送邮件标志
services.add(serviceId + appName);
// 生成邮件内容邮件
StringBuilder sb = new StringBuilder();
sb.append("服务ID=");
sb.append(serviceId);
sb.append(System.getProperty("line.seperator", "\n"));
sb.append("应用名=");
sb.append(appName);
sb.append(System.getProperty("line.seperator", "\n"));
sb.append("时间=");
sb.append(SF.format(event.getTimestamp()));
mailService.sendSimpleMail("火烧眉毛!!!你的服务挂了,快来救火~~~", sb.toString());
}
}
@EventListener
public void listen(EurekaInstanceRegisteredEvent event) {
String serviceId = event.getInstanceInfo().getInstanceId();
String appName = event.getInstanceInfo().getAppName();
// 服务重启恢复后,删掉发送邮件标志
if (event.getInstanceInfo().getStatus().equals(InstanceInfo.InstanceStatus.UP) &&
services.contains(serviceId + appName)) {
log.warn("register service again, services'size : {}, delete serviceKey : {}",
services.size(), serviceId + appName);
services.remove(serviceId + appName);
}
}
}
重新测试,启动服务端和客户端后,杀死客户端,再启动客户端再杀死,看看服务端的日志: