Hey,
I am trying to use turbine to aggregate all my hystrix dashboards but I don't see anyway to use https instead of http for all the dashboards. I have it up and running using ConfigPropertyBasedDiscovery bean and it all works on http, but there is no property to force https. Any ideas? I can see the class SpringClusterMonitor doing this:
if (host.getAttributes().containsKey("securePort")) {
port = host.getAttributes().get("securePort");
scheme = "https";
}
But I don't see anyway to set that attributes map through configuration?
Comment From: ryanjbaxter
Are you using Eureka? There is a way to tell Eureka clients to publish their secure port http://cloud.spring.io/spring-cloud-static/Greenwich.SR1/single/spring-cloud.html#_registering_a_secure_application
Comment From: devinwhalen
Hello,
Thanks. I should have mentioned that I am using Config property based discovery, not Eureka. I was hoping for a property or something. Tracing through the code it looks like it is looking at an "attr" map but there doesn't seem to be a way to set this map.
Comment From: ryanjbaxter
@devinwhalen do you mean using ribbon.serverList?
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: devinwhalen
Hello,
ryanjbaxter, I am not using ribbon. I am using the ConfigPropertyBasedDiscovery way of using turbine and it defaults to using http. There seems to be no way to force https and I have a security requirement to use https. I see in the code that there is some sort of "attr" map but there is no way to add values to it.
I found a workaround by providing my own implementation of ConfigPropertyBasedDiscovery that allows you to set this property.
Comment From: therain123in
Hello,
ryanjbaxter, I am not using ribbon. I am using the ConfigPropertyBasedDiscovery way of using turbine and it defaults to using http. There seems to be no way to force https and I have a security requirement to use https. I see in the code that there is some sort of "attr" map but there is no way to add values to it.
I found a workaround by providing my own implementation of ConfigPropertyBasedDiscovery that allows you to set this property.
Hi devinwhalen ,
Can you please provide the sample project for implementing Turbine without Eureka ? I have tried a lot , but turbine doest seem to work without eureka
2020-01-08 21:06:34.030 INFO 70836 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Fetching instances for app: crud 2020-01-08 21:06:34.054 INFO 70836 --- [ Timer-0] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING 2020-01-08 21:06:34.227 INFO 70836 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8075 (http) with context path '' 2020-01-08 21:06:34.234 INFO 70836 --- [ main] c.t.t.TurbineServiceApplication : Started TurbineServiceApplication in 14.106 seconds (JVM running for 16.616) 2020-01-08 21:06:34.276 INFO 70836 --- [ Timer-0] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1 2020-01-08 21:06:34.277 INFO 70836 --- [ Timer-0] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data. 2020-01-08 21:06:34.306 INFO 70836 --- [ Timer-0] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1578497794303 with initial instances count: 0 2020-01-08 21:06:34.340 WARN 70836 --- [ Timer-0] o.s.c.n.turbine.EurekaInstanceDiscovery : Eureka returned null for app: crud
Regards, therain
Comment From: devinwhalen
Hey,
You need to expose a "configPropertyBasedDiscoveryImpl bean:
@Bean
public InstanceDiscovery discoveryInstance() {
return new ConfigPropertyBasedDiscovery();
}
Or a file based discovery bean:
https://github.com/Netflix/Turbine/wiki/Configuration-(1.x)
FileBasedInstanceDiscovery:
filePath: /projects/hystrix-dashboard/src/main/resources/turbine.hostnames.txt
Then you need to configure it:
turbine:
instanceInsertPort:
service1: true
service2: true
aggregator:
clusterConfig: service1,service2
-- Note, I have remapped hystrix endpoint
instanceUrlSuffix:
service2: /manage/hystrix.stream
service1: /manage/hystrix.stream
InstanceMonitor:
eventStream:
skipLineLogic:
enabled: false
ConfigPropertyBasedDiscovery:
service1:
instances: service1a.dev.com,service1b.dev.com
isSecure: true
instancePort: 8443
service2:
instances: service2a.dev.com,service2b.dev.com
isSecure: true
instancePort: 8443
Hope that helps. BTW, using a secure port took some extra work. I had to create my own implementation of the ConfigPropertyBasedDiscovery bean.
Comment From: therain123in
Hi Devin, Thanks for the response. I followed your steps, but i still get as "Loading" when i hit http://localhost:8075/hystrix/monitor?stream=http://localhost:8075/turbine.stream
and empty clusters when i hit http://localhost:8075/clusters
-- Turbine POM
<groupId>com.turbine</groupId>
<artifactId>turbine-service-wo-eureka</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>turbine-service</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
application.properties
server.port=8075
spring.application.name=turbine
turbine.appConfig= crudrev
turbine.instanceInsertPort.crudrev= true
turbine.instanceMonitor.eventStream.skipLineLogic.enabled= false
turbine.ConfigPropertyBasedDiscovery.crudrev.instances=localhost
turbine.ConfigPropertyBasedDiscovery.crudrev.isSecure=false
turbine.ConfigPropertyBasedDiscovery.crudrev.instancePort=8091
turbine.clusterNameExpression= new String("default")
TurbineApplication.java
@SpringBootApplication
@EnableTurbine
@EnableHystrixDashboard
@EnableDiscoveryClient
public class TurbineServiceApplication {
public static final String TURBINE_AGGREGATOR_CLUSTER_CONFIG = "turbine.aggregator.clusterConfig";
public static void main(String[] args) {
SpringApplication.run(TurbineServiceApplication.class, args);
}
@Bean
public InstanceDiscovery discoveryInstance() {
return new ConfigPropertyBasedDiscovery();
}
}
CRUD application.properties
server.port=8091
spring.application.name=crudrev
management.endpoints.web.exposure.include=*
crudcontroller.java
@SuppressWarnings("unused")
@RestController()
@RequestMapping("/crudcontr")
public class CRUDController {
@Autowired
private Environment environment;
@HystrixCommand(fallbackMethod = "insert_Fallback")
@RequestMapping("/insert")
public String insert() {
//int i = 1/0;
return "Insert Service Invoked............" + environment.getProperty("local.server.port");
}
@RequestMapping("/update")
public String update() {
return "Update Service Invoked............" + environment.getProperty("local.server.port");
}
@RequestMapping("/delete")
public String delete() {
return "Delete Service Invoked............" + environment.getProperty("local.server.port");
}
public String insert_fallback() {
return "Fallback Insert Service Invoked....... ....." + environment.getProperty("local.server.port");
}
}
Console Logs
2020-01-13 18:53:30.957 INFO 52476 --- [ main] c.t.t.TurbineServiceApplication : Starting TurbineServiceApplication on CRISILLAP3002 with PID 52476 (D:\GIT\Spring_samples\ribbonloadbalancingzuul\turbine-wo-eureka\target\classes started by DhirenP in D:\GIT\Spring_samples\ribbonloadbalancingzuul\turbine-wo-eureka)
2020-01-13 18:53:30.962 INFO 52476 --- [ main] c.t.t.TurbineServiceApplication : No active profile set, falling back to default profiles: default
2020-01-13 18:53:33.876 INFO 52476 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8075 (http)
2020-01-13 18:53:33.894 INFO 52476 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-01-13 18:53:33.895 INFO 52476 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.29]
2020-01-13 18:53:34.163 INFO 52476 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-01-13 18:53:34.164 INFO 52476 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3082 ms
2020-01-13 18:53:35.060 WARN 52476 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2020-01-13 18:53:35.061 INFO 52476 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-01-13 18:53:35.078 INFO 52476 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@75f2099
2020-01-13 18:53:35.386 INFO 52476 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-01-13 18:53:36.445 INFO 52476 --- [ main] o.s.c.n.turbine.SpringAggregatorFactory : Could not find monitors: []
2020-01-13 18:53:36.876 INFO 52476 --- [ main] c.n.t.monitor.cluster.ClusterMonitor : Registering event handler for cluster monitor: StaticListener_For_Aggregator
2020-01-13 18:53:36.878 INFO 52476 --- [ main] c.n.t.handler.TurbineDataDispatcher :
Just added and starting handler tuple: StaticListener_For_Aggregator
2020-01-13 18:53:36.879 INFO 52476 --- [ main] c.n.t.monitor.cluster.ClusterMonitor : All event handlers for cluster monitor: [StaticListener_For_Aggregator]
2020-01-13 18:53:36.879 INFO 52476 --- [ main] c.n.t.monitor.cluster.ClusterMonitor : Starting up the cluster monitor for CRUDREV_agg
2020-01-13 18:53:36.883 INFO 52476 --- [ main] c.n.t.discovery.InstanceObservable : Starting InstanceObservable at frequency: 60000 millis
2020-01-13 18:53:36.884 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instance list for apps: [crudrev]
2020-01-13 18:53:36.884 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instances for app: crudrev
2020-01-13 18:53:36.884 WARN 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : DiscoveryClient returned null or empty for service: crudrev
2020-01-13 18:53:36.884 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Retrieved hosts from InstanceDiscovery: 0
2020-01-13 18:53:36.884 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Found hosts that have been previously terminated: 0
2020-01-13 18:53:36.884 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:0, hosts down: 0
2020-01-13 18:53:36.951 INFO 52476 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8075 (http) with context path ''
2020-01-13 18:53:37.377 INFO 52476 --- [ main] c.t.t.TurbineServiceApplication : Started TurbineServiceApplication in 7.686 seconds (JVM running for 9.202)
2020-01-13 18:53:50.195 INFO 52476 --- [nio-8075-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-01-13 18:53:50.195 INFO 52476 --- [nio-8075-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-01-13 18:53:50.209 INFO 52476 --- [nio-8075-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 13 ms
2020-01-13 18:54:36.886 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instance list for apps: [crudrev]
2020-01-13 18:54:36.886 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instances for app: crudrev
2020-01-13 18:54:36.886 WARN 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : DiscoveryClient returned null or empty for service: crudrev
2020-01-13 18:54:36.886 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Retrieved hosts from InstanceDiscovery: 0
2020-01-13 18:54:36.886 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Found hosts that have been previously terminated: 0
2020-01-13 18:54:36.887 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:0, hosts down: 0
2020-01-13 18:55:36.889 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instance list for apps: [crudrev]
2020-01-13 18:55:36.889 INFO 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : Fetching instances for app: crudrev
2020-01-13 18:55:36.889 WARN 52476 --- [ Timer-0] o.s.c.n.t.CommonsInstanceDiscovery : DiscoveryClient returned null or empty for service: crudrev
2020-01-13 18:55:36.889 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Retrieved hosts from InstanceDiscovery: 0
2020-01-13 18:55:36.889 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Found hosts that have been previously terminated: 0
2020-01-13 18:55:36.889 INFO 52476 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:0, hosts down: 0
Pl let me know where am i going wrong.
Regards, therain
Comment From: spencergibb
This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.