草庐IT

Cloud-Run

全部标签

java - Spring Cloud Hystrix 在第一次命令调用时失败

我注意到第一个Hystrix命令总是调用我的回退,之后的调用在SpringCloudNetflix中运行良好。我应该设置什么来避免它吗?为什么会这样? 最佳答案 看起来像是基础设施初始化的副作用和超时https://groups.google.com/d/msg/hystrixoss/_jnxAyS20lA/fWo0ZAHoxt8J 关于java-SpringCloudHystrix在第一次命令调用时失败,我们在StackOverflow上找到一个类似的问题:

java - spring-boot :run and spring-boot:start有什么区别

spring-boot:run和spring-boot:start有什么区别?我看到它们都可以用作Maven目标。但是有什么区别呢? 最佳答案 spring-boot:runDescription:Runanexecutablearchiveapplication.spring-boot:startDescription:Startaspringapplication.Contrarytotherungoal,thisdoesnotblockandallowsothergoaltooperateontheapplication.Th

java - 使用 maven : run jar before tests and terminate after 进行集成测试

我有一个可运行的jar,我想在我的集成测试开始之前(在pre-integration-test上)在一个新进程中运行它,并在我的集成测试完成后让它终止(在集成后测试).我可以使用的东西之一是maven-antrun-plugin或exec-maven-plugin在pre-integration-test上启动新进程,但如何终止它?对于我想要实现的目标,也许有更好的解决方案?PS:我在Windows和Linux上构建我的项目,所以可移植性对我来说很重要。 最佳答案 您可以使用maven-process-plugin由BV开源以分别启

java - 使用spring cloud更改eureka服务器的默认端口

我得到了spring-boot应用程序、一个eureka服务器和一个eureka客户端。这是我的服务器配置server:port:8761spring:application:name:eureka-server这是我的服务器代码packagefr.maif.eurekaserver;importorg.springframework.boot.SpringApplication;importorg.springframework.boot.autoconfigure.SpringBootApplication;importorg.springframework.cloud.netfl

Java - 调用线程 : how does it route to Runnable interface's run ()? 上的启动方法

好的,我知道创建新线程并在Java中运行它的两种标准方法:在一个类中实现Runnable,定义run()方法,并将该类的一个实例传递给一个新的Thread.当调用线程实例上的start()方法时,会调用类实例的run方法。让类派生自Thread,这样它就可以覆盖方法run(),然后当一个新实例的start()方法被调用,调用被路由到覆盖的方法。在这两种方法中,基本上都会创建一个新的Thread对象并调用其启动方法。然而,在第二种方法中,调用被路由到用户定义的run()方法的机制非常清楚,(这是一个简单的运行时多态性),我不明白如何对Thread对象上的start()方法的调用被路由到实

java - HotSwaping代码到 "mvnDebug tomcat:run"

通常我使用mvnDebugtomcat:run启动tomcat。代码更改后我需要使用mvntomcat:redeploy。这是次优的,因为我通常只更改现有方法体的内容。我可以将方法的主体热交换到运行时中,然后热重新部署作为回退吗?不幸的是,我没有找到像maven-hotswap-plugin这样的东西。faces-config.xml...com.sun.facelets.FaceletViewHandlerde_DEMessagemessageorg.springframework.web.jsf.el.SpringBeanFacesELResolverweb.xml:org.spr

java - Eclim - 将 org.eclim.java.run.mainclass 设置为什么?

我无法让:Java命令在eclim中工作。当我运行它时,我得到:java.lang.RuntimeException:Requiredsetting'org.eclim.java.run.mainclass'hasnotbeenset.atorg.eclim.plugin.jdt.command.src.JavaCommand.execute(JavaCommand.java:107)atorg.eclim.command.Main.main(Main.java:89)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod

java - tomcat7-maven-插件 : run multiple webapps but port 8080 already in use

我正在尝试使用tomcat7-maven-plugin设置嵌入式tomcat容器,在pre-integration-test阶段运行webapps,运行集成测试,然后在post-integration-test阶段关闭tomcat。该项目是一个多模块maven项目(包含app1、app2等)。父级pom.xml如下所示,org.apache.tomcat.maventomcat7-maven-plugin2.1path/to/context.xmlpath/to/tomcat-users.xmltruetomcat-runrunpre-integration-testtomcat-sh

java - spring cloud feign hystrix 回退不起作用

与springboot版本1.3.8.RELEASE和云版本“Brixton.SR”相同的代码工作正常。但是“1.5.2.RELEASE”和“Dalston.RC1”不起作用。异常HTTP状态500-请求处理失败;嵌套异常是java.lang.RuntimeException:com.netflix.client.ClientException:Loadbalancerdoesnothaveavailableserverforclient:math-service 最佳答案 好的,您可以将以下内容添加到您的application.p

java - 是否可以通过在 run() 方法中调用 run() 来启动线程?

我知道不应该调用run方法来启动新线程执行,但我指的是thisarticle他们在另一个run方法中调用了runnable.run();,这似乎暗示它启动了一个新线程或者根本没有creating/strong>线程,它只是创建一个新线程并在同一线程中运行所有可运行的线程,即逐个任务?这是文章提到的代码。publicclassThreadPool{privateBlockingQueuetaskQueue=null;privateListthreads=newArrayList();privatebooleanisStopped=false;publicThreadPool(intnoO