Spring Cloud Pit Record

Source: Internet
Author: User

1. When you take Config-server as the center of the profile, remember not to have a service named "producer", estimated producer is a keyword in spring cloud.


2. Assume: There is a service Service0, its context-path is/service/0. There is a service with Zuul as reverse proxy, which is equipped with SERVICE0 routes, Service0:/service/0/**. At this point, if you want to access reverse via the SERVICE0 proxy, you need to enter/ service/0/service/0.


3. Thread pool Reject policy exception:

Java.util.concurrent.RejectedExecutionException:Task Java.util.concurrent.futuretask@427829d8 rejected from java.util.concurrent.threadpoolexecutor@5f0345ff[terminated, pool size = 0, Active threads = 0, queued tasks = 0, complete D tasks = 0] at java.util.concurrent.threadpoolexecutor$abortpolicy.rejectedexecution (threadpoolexecutor.java:2048) ~[NA:1.7.0_79] at Java.util.concurrent.ThreadPoolExecutor.reject (threadpoolexecutor.java:821) [na:1.7.0_79] at Java.util.concurrent.ThreadPoolExecutor.execute (threadpoolexecutor.java:1372) [na:1.7.0_79] at Java.util.concurrent.AbstractExecutorService.submit (abstractexecutorservice.java:110) ~[na:1.7.0_79] at Com.netflix.discovery.TimedSupervisorTask.run (timedsupervisortask.java:62) ~[eureka-client-1.4.11.jar:1.4.11] at Java.util.concurrent.executors$runnableadapter.call (executors.java:471) [na:1.7.0_79] at Java.util.concurrent.FutureTask.run (futuretask.java:262) [na:1.7.0_79] at Java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$201 (scheduledthreadpoolexecutor.java:178) [na:1.7.0_79] at Java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run (scheduledthreadpoolexecutor.java:292) [na:1.7.0_79] at Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145) [na:1.7.0_79] at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) [na:1.7.0_79] at Java.lang.Thread.run (thread.java:745) [na:1.7.0_79]


People who understand the Java thread pool principle should know that there are 2 possible scenarios for this exception:

1. Shutdown the thread pool, unable to receive new tasks

2. The thread pool is saturated, and the new task is rejected based on the settings, or the default deny policy.



From "Com.netflix.discovery.TimedSupervisorTask" can be seen, is a service discovery of the scheduled task.

After Google,stackoverflow, there is no better explanation.

Then, on GitHub Spring-cloud-netflix's issue, you see a response like this:


The Big Brother said: No one has yet shown that this anomaly will have a negative impact on the application.

Therefore, there is no good solution for the time being.


4. Configuration center repo already has a configuration file for service A, but the configuration file cannot be found when service a starts:

In the case of Git repo, you need git add service a.yml commit to access it.


5.healthcheck:spring Cloud CAMDEN.SR6, if the configuration

Eureka:
  Client:
    healthcheck:
      enabled:true
and add actuator dependency, it will cause the service to be down in the Eureka State.


6, Service lease configuration:

Eureka:
   instance:
     2 #续约间隔
     4 #租约寿命
7. When using the configuration center, you must distinguish between hump naming and underline naming:
If your service A, in the Configuration center configuration file, there is a configuration:
Eureka:
   instance:
     ${eureka.instance.ip-address}:${server.port}

In this case, the local configuration file for service A is:

Eureka:
   instance:
    
At this point, after the program is started, in the registry, you will see that the status of service A is:
${eureka.instance.ip-address}:${server.port}
Solution: Change the name of the underlined uniform to hump.
8.Debug source when found that if the DALSTON.SR1 version and use Eureka as the registry, the Ribbon default serverlist use is Eurekaribbonclientconfiguration.ribbonserverlist, not ribbonclientconfiguration.ribbonserverlist.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.