Turbine instanceURLSuffix not working - spring

I'm gathering hystrix streams from turbine but the services have the management port enabled on port 5555.
When I set the property in turbine:
eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka/
server.port=8989
InstanceDiscovery.impl=com.netflix.turbine.discovery.EurekaInstanceDiscovery.class
turbine.instanceUrlSuffix=:5555/hystrix.stream
turbine.InstanceMonitor.eventStream.skipLineLogic.enabled=false
turbine.appConfig=service1,service2,gateway
turbine.clusterNameExpression=new String('default')
it tries to connect to:
http://gateway-ip:10000/:5555/hystrix.stream
instead of replacing the port. Is there something I'm missing?
UPDATE
I suspect there's an incompatibility between the instanceUrlSuffix and the EurekaInstanceDiscovery.
Is there any information I need to put in metadataMap for that service in order to make it work?
Versions are:
Turbine service:
spring-cloud-starter-parent: Brixton.SR5
spring-cloud-starter-turbine: 1.1.6
Eureka service:
spring-cloud-starter-parent: Brixton.SR5

To make it work I had to add these two properties to the configuration:
turbine:
instanceInsertPort: false
instanceUrlSuffix: :5555/hystrix.stream
turbine.instanceInsertPort is what did the trick, composing the final URL from schema://host+urlSuffix

Following worked for me.
Note: Default profile doesn't work for me either, but individual stream works this way.
my service1 is registered to Eureka with -Dserver.port=5151 and -Dmanagement.port=5152 so my hystrix stream is on different port than my service endpoint.
turbine.instanceInsertPort=false
turbine.appConfig=service1
turbine.aggregator.clusterConfig=SERVICE1
turbine.instanceUrlSuffix.USER=:5152/hystrix.stream
InstanceDiscovery.impl=com.netflix.turbine.discovery.EurekaInstanceDiscovery.class

Turbine can not read 'turbine.instanceUrlSuffix' in application.property or environment, it need other lib to read properties.
Did you dependency lib spring-cloud-starter-netflix-hystrix-dashboard or spring-cloud-starter-netflix-archaius? If not, try to add it to your pom.xml.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
<version>2.2.7.RELEASE</version>
</dependency>

Related

Quarkus - Spring Cloud Config Client

I am getting this error when trying to set header that has to be sent to Spring Config Server.
Unrecognized configuration key "quarkus.spring-cloud-config.headers" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
# application.properties
quarkus.spring-cloud-config.headers="access_token=12345"
I am not sure what I am doing wrong. Please help. Thanks in advance.
You need to use:
quarkus.spring-cloud-config.headers.access_token=12345

Spring cloud's config server plain text api with SVN and a default label

I have spring boot 2 app that acts as a config server with the following properties. Notice in particularly the "default-label" properties which is the empty string because we check out directly the folder that contains the files, and not some parent branch/folder.
spring:
application:
name: config-server
profiles:
include: subversion
cloud:
config:
server:
svn:
uri: https://...somesvnrepo.../project/trunk/config
username: fake
password: notreal
default-label:
basedir: C:\Users\John\Documents\Application\configserver_tmp
The contents of /trunk/config is straigthforward. There ae no subdirectories and just these files:
application.yml
application-dev.yml
myservice.yml
myservice-dev.yml
logback.xml
Serving the yml files works fine, but getting the logback.xml file using the "plain text api" not work at all.
Doing localhost:8888/appname/default/master/logback.xml gives the error "no label master found" which is true, I don't have that label. Any other combination of paths by omitting profiles or labels results in a 404 all the way up to just calling localhost:8888/logback.xml. Adding the ?useDefaultLabel request parameter makes no difference. Actually I don't understand the purpose of the appname, profile and label part of the url when the context is to get a plain text file that is not bound to any specific application, profile or label.
I found similar questions on the internet but they mention updating their spring boot version and then it worked for them. I'm already at the latest spring boot version (2.1.3-release).
Is this because I use SVN? Or because of of the default-label being empty?

Inject external properties for Apache Storm Flux

I am using Flux 1.0.0 and I have rewritten my topology into a YAML file. But I have some properties that used to be part of the configuration that I used the Storm driver to run with.
storm.Driver --config myConfig/config.conf
Now with Storm Flux, how can I inject the properties that are in config.conf into my topology?
I am currently doing java -cp myStormJar org.apache.sotrm.flux.Flux --local /src/main/resources/myTopology.yaml
I tried to use --resources option, followed by the path to the conf file, but it does not inject it.
Add the filter --resources placeholders ${resource.filter} to your yaml file.
To make the property available in the stormConf - re-declare the filter resource in config: properties.
name: "storm-topology"
config:
kafka.mapper.zkPort: ${kafka.mapper.zkPort}
kafka.mapper.zkServers: ${kafka.mapper.zkServers}
You can also review the simple_hdfs.yaml example at: https://github.com/ptgoetz/flux/tree/master/flux-examples

Spring Boot method entry and exit logging not working

I have the following entry in my application.yml for logging, but it's not logging the method entry and exit. It's only logging the Tomcat server log.
application.yml
logging:
file: ../logs/Audit_Management_DS.log
level: DEBUG
I am deploying my application on Tomcat 8. I have tried this through application.properties, but it's not working. My entry in application.properties is as follows:
logging.file= ../logs/Audit_Management_DS.log
logging.level.*=DEBUG
logging.level.org.springframework = ON
Your application.yml looks like it has whitespace errors, the '*' (asterisk) in your properties file probably should be "ROOT", and "ON" is not a valid log level. Fix some or all of those and see if it helps.
(But as the others said in comments, Spring Boot does not log method executions.)

OSGi bundle as external webservice client

I need to call an external webservice from my bundle which is deployed in apache felix container ( I can not use ServiceMix, fuse...)
I added the bundle cxf-dosgi (which can be downloaded from here) and put the following lines in my pom.xml:
<Require-Bundle>cxf-dosgi-ri-singlebundle-distribution</Require-Bundle>
<Import-Package>
javax.jws,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.namespace,
javax.xml.ws,
META-INF.cxf,
org.apache.cxf,
org.apache.cxf.binding,
org.apache.cxf.binding.soap,
org.apache.cxf.binding.soap.spring,
org.apache.cxf.bus,
org.apache.cxf.bus.resource,
org.apache.cxf.bus.spring,
org.apache.cxf.buslifecycle,
org.apache.cxf.catalog,
org.apache.cxf.configuration,
org.apache.cxf.configuration.spring,
org.apache.cxf.endpoint,
org.apache.cxf.headers,
org.apache.cxf.management,
org.apache.cxf.phase,
org.apache.cxf.resource,
org.apache.cxf.transport,
org.apache.cxf.transport.http,
org.apache.cxf.transport.http.policy,
org.apache.cxf.transport.http_jetty,
org.apache.cxf.transports.http,
org.apache.cxf.workqueue,
org.apache.cxf.ws.policy.builder.jaxb,
org.apache.cxf.wsdl,
org.apache.cxf.wsdl11,
org.apache.cxf.jaxws.*,
*
</Import-Package>
I use the jaxws way to establish the communication:
QName SERVICE_NAME = new QName("http://test.com/", "MockImplService");
Service service = Service.create(new URL(endpointAddress + "?wsdl"), SERVICE_NAME);
mockService= service.getPort(IMock.class);
When I run the example I have the following exception:
Caused by: javax.xml.ws.spi.FactoryFinder$ConfigurationError: Provider org.apache.axis2.jaxws.spi.Provider not found
at javax.xml.ws.spi.FactoryFinder$2.run(FactoryFinder.java:138)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:282)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:125)
at javax.xml.ws.spi.FactoryFinder.access$200(FactoryFinder.java:42)
at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:273)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:282)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:168)
at javax.xml.ws.spi.Provider.provider(Provider.java:39)
at javax.xml.ws.Service.<init>(Service.java:36)
at javax.xml.ws.Service.create(Service.java:116)
any idea please ?
Apache DOSGi is designed for exposing services as webservices, not for calling other webservices. Though, it probably contains some api to call other webservices.
Somehow the axis jaxws implementation is used. You probably have a axis2-jaxws-xxx.jar on your classpath. Try to remove it. The JRA jaxws will be used instead (which should be fine for axis and better for cxf).

Resources