These are chat archives for spring-cloud/spring-cloud

14th
Mar 2018
Abhishek Dujari
@abshkd
Mar 14 2018 02:53
so I recently learned about @Qualifier beans and I thought this would be a good way to configure the Ribbon enabled RestTemplate to use in specific Components. Unfortunately I cant seem to get it to work
Abhishek Dujari
@abshkd
Mar 14 2018 04:16
can I confirm with someone about ZuulFilters
when I run my tests locally with webenvironment and I do debugging I see that my zuulfilter is never called
I am doing this @SpringBootTest(classes = GatewayApp.class,webEnvironment= SpringBootTest.WebEnvironment.MOCK)
this is my MockMvc
        mvc = MockMvcBuilders
            .webAppContextSetup(context)
            .addFilters(springSecurityFilterChain)
            .build();
di need to add zuulfilter and if so how?
Abhishek Dujari
@abshkd
Mar 14 2018 04:22
@spencergibb do you have any tests for these ? https://github.com/spring-cloud-samples/sample-zuul-filters
i am trying to test forward headers for a custom auth
Abhishek Dujari
@abshkd
Mar 14 2018 04:55
i never see any zuulfilter being run at all
i just tested with RestAssured and call a defined port directly
Abhishek Dujari
@abshkd
Mar 14 2018 06:29
i got it working by manually defining the zuul route
i have another test I need to fix, i have disabled the eureka client in application.yml but for one test I need the discover Client to be enabled so I did this
 static {
        System.setProperty("eureka.client.enabled", "true");
        System.setProperty("spring.cloud.config.failFast", "false");
    }
doesnt have any effect
Mark Paluch
@mp911de
Mar 14 2018 07:31
@BhavaniJ2_twitter I didn't expect that it would have worked with your custom configuration but rather that you get a possibility to print/investigate the value of VaultProperties.getToken(). Disable Vault (spring.cloud.vault.enabled=false) and don't rely on property values from Vault when checking what's inside of VaultProperties.getToken().
ghoddg
@ghoddg
Mar 14 2018 08:44
Hi,
I am getting below error when I am using zuul api gateway with service discovery
Caused by: java.lang.RuntimeException: org.apache.http.conn.ConnectTimeoutException: Connect to 10.180.175.7:8080 [/10.180.175.7] failed: connect timed out
at rx.exceptions.Exceptions.propagate(Exceptions.java:58) ~[rxjava-1.2.0.jar:1.2.0]
at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:464) ~[rxjava-1.2.0.jar:1.2.0]
at rx.observables.BlockingObservable.single(BlockingObservable.java:341) ~[rxjava-1.2.0.jar:1.2.0]
at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:112) ~[ribbon-loadbalancer-2.2.4.jar:2.2.4]
... 134 common frames omitted
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to 10.180.175.7:8080 [/10.180.175.7] failed: connect timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.3.jar:4.5.3]
ghoddg
@ghoddg
Mar 14 2018 08:57
any updates?
ghoddg
@ghoddg
Mar 14 2018 09:15
zuul:
ignoredServices: ""
routes:
platoapi:
path: /*

serviceId: API-GATEWAY-REF
stripPrefix: true
this is application.yml configuration
this is url i am hitting
api-gateway-service and plato-discovery-client are the contexts for api gateway service and api-gateway-ref micro-services
i have deployed both these on weblogic
in different domains
can anybody please help me?
sethupalaniyappan
@sethupalaniyappan
Mar 14 2018 09:22
Need to config the config server auto pull the git before request
can anyone helpon this
玹霖
@SoftwareKing
Mar 14 2018 09:57
@spencergibb What is the difference between GatewayFilter and GlobalFilter?
Andre Dörnbrack
@doernbrackandre
Mar 14 2018 15:47
hey, @spencergibb please, can you give me the current status of the spring-cloud-kubernetes project? we ran into two issues and we have some ideas. unfortunately, it seems that this project is kind of inactive?
Spencer Gibb
@spencergibb
Mar 14 2018 16:33
@doernbrackandre it is currently a community maintained project. We have plans after Finchley is released to make it officially supported.
Furer Alexander
@jvmlet
Mar 14 2018 16:38
Hello I've enabled basic security in SCDF and trying to invoke CTR via rest endpoint. My question is how can I pass credentials to CTR to be used to access SCDF?
Thomas B.
@tblazz
Mar 14 2018 16:50
Hi, is there a possibility to handle versions in distributed configuration with consul. (Something like config/myapp,dev,v1.0.1). For now the only "workaround "I found was to manually override the spring.application.name with name-version (config/myapp-1.0.1,dev)
Spencer Gibb
@spencergibb
Mar 14 2018 16:53
not currently
johnBgood
@johnBgood
Mar 14 2018 16:56
Hi, @spencergibb
do you know if this feature is scheduled ?
Spencer Gibb
@spencergibb
Mar 14 2018 16:57
no, it is not
Thomas B.
@tblazz
Mar 14 2018 17:01
Would you be interested by a PR ?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:37
@spencergibb I am trying to registered a service in eureka which is deployed in Cloud foundry and struggling, in Eureka I see this value "http://customer-type-determination-service-prod.g2.app.cloud.comcast.net:8080/api/api/info"
which is not working..can you please help
why this is adding port number ?
eureka.instance.metadataMap.instanceId= ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${server.port}}}
Spencer Gibb
@spencergibb
Mar 14 2018 17:38
are you using spring cloud services?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:38
yes
Spencer Gibb
@spencergibb
Mar 14 2018 17:39
you need to go thru support
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:39
we are using spring cloud..
Spencer Gibb
@spencergibb
Mar 14 2018 17:39
the value you see isn't what is registered, it's just a url
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:40
but in cloud foundry URL is Route and if that route doesn't get resolve obviously it will fail. We are suing spring cloud free one ..not paid
Spencer Gibb
@spencergibb
Mar 14 2018 17:41

that was my question

are you using spring cloud services

that is the paid one

pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:42
sorry, my bad..got confused
Spencer Gibb
@spencergibb
Mar 14 2018 17:42
where are you seeing "that value"?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:43
in eureka dashboard
no port
but with latest upgrade seeing this new behavior
is there anything changed ?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:49
Sorry , this is causing issue in prod that is why looking for some guidence
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:57
seeing this error
message":"Could not resolve placeholder 'spring.application.instance_id' in value \"vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id}\"
Spencer Gibb
@spencergibb
Mar 14 2018 17:57
spring cloud services did much of that for you previously
pradeepkusingh
@pradeepkusingh
Mar 14 2018 17:58
we got pivotal consulting and they helped us to set it up
but somehow got messed up..
Spencer Gibb
@spencergibb
Mar 14 2018 18:05
I need your eureka.* keys on the client and what you see in http://<eurekaserver>/eureka/apps
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:08
sure
Spencer Gibb
@spencergibb
Mar 14 2018 18:13
all those *Url fields don't mean anything. This is what clients use customer-type-determination-service-prod.g2.app.cloud.comcast.net:80
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:13

eureka.client.serviceUrl.defaultZone: "/eureka/"
eureka.client.enabled: "true",

eureka.client.fetchRegistry: true,
eureka.client.healthcheck.enabled: false,
eureka.client.prefer-same-zone-eureka: true,
eureka.client.region: "region1",
eureka.client.registerWithEureka: true,
eureka.client.service-url.g1: "URL",
eureka.client.service-url.g2: "URL",

Spencer Gibb
@spencergibb
Mar 14 2018 18:15
@pradeepkusingh Is customer-type-determination-service-prod.g2.app.cloud.comcast.net:80 correct?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:15
ok, Thanks.. but APIGateway giving error as 500 internal server error
yes, customer-type-determination-service-prod.g2.app.cloud.comcast.net:80 works fine..
Spencer Gibb
@spencergibb
Mar 14 2018 18:16
ok, so what's the problem?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:17
it works fine
when it has port number added ..it fails and apigateway says 500 internal error and ribbot is trying to sent the request to teh CF rpute with port number and it can't be resolved
as long as eureka registry doesn't have port 8080 it works fine
Spencer Gibb
@spencergibb
Mar 14 2018 18:18
port 80?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:18
with port 8080 .. it creates problem and I don't know from where this port is coming from
Spencer Gibb
@spencergibb
Mar 14 2018 18:19
it's the default
What are your eureka.instance.* keys?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:19
in CF we don't have port concept, so this is surpring for me why it keep adding port 8080
one second
eureka.instance.hostname: "customer-type-determination-service-prod.g2.app.cloud.comcast.net"
eureka.instance.hostname: "customer-type-determination-service-prod.g2.app.cloud.comcast.net",
eureka.instance.leaseExpirationDurationInSeconds: 30,
eureka.instance.leaseRenewalIntervalInSeconds: 30,
eureka.instance.metadata-map.instanceId: "b4c58901-66fe-4217-6111-5de7",
eureka.instance.healthCheckUrlPath: "/api/health"
Spencer Gibb
@spencergibb
Mar 14 2018 18:22
set eureka.instance.nonSecurePort=80
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:22
eureka.instance.nonSecurePort: 80,
this is also tehre
sorry my bad again to mention that
Spencer Gibb
@spencergibb
Mar 14 2018 18:23
that is what eureka gives out. I still don't understand the problem
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:23
ok, let me try to simplify it
Spencer Gibb
@spencergibb
Mar 14 2018 18:27
you haven't shown me anything from /eureka/apps with <port enabled="true">80</port>
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:27
one second

<overriddenstatus>UNKNOWN</overriddenstatus>

<port enabled="true">80</port>

<securePort enabled="false">443</securePort>

I can create a public route and give you access to url in DM if you want
you can see all configuration
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:39
Seems this is the isseu I am facing

application.yml.

eureka:
instance:
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
With the metadata shown in the preceding example and multiple service instances deployed on localhost, the random value is inserted there to make the instance unique. In Cloudfoundry, the vcap.application.instance_id is populated automatically in a Spring Boot application, so the random value is not needed.

I don't need server port in : Eureka instance id
this might be the reason
in cloud foundry it seems no servcer.port requried
I think I should try this one : ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id}} , but pivotal team set it up as ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${server.port}}} and this was working since agaes
only after sping cloud jar upgrade this issue appear
Spencer Gibb
@spencergibb
Mar 14 2018 18:45
that doesn't matter, its using {vcap.application.instance_id for instanceId
again, what you showed me is <port enabled="true">80</port>
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:46
yes..
Spencer Gibb
@spencergibb
Mar 14 2018 18:46
nothing you have shown me says <port enabled="true">8080</port>
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:46
I showed you

<overriddenstatus>UNKNOWN</overriddenstatus>

<port enabled="true">80</port>

<securePort enabled="false">443</securePort>

this was in big xml
Spencer Gibb
@spencergibb
Mar 14 2018 18:46
that is port 80, not 8080
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:47
yes, that is why I am surprised from where port 8080 keep coming :(
you are right nowhere I mentioned port 8080
and it keep adding in URL
Spencer Gibb
@spencergibb
Mar 14 2018 18:47
neither do I
what url?
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:48
this url is in eureka dashboard
Sorry, if it is getting over complicated.
Spencer Gibb
@spencergibb
Mar 14 2018 18:53
those urls in the eurkea dashboard are only used in the dashboard. <port></port> is the only thing that matters
pradeepkusingh
@pradeepkusingh
Mar 14 2018 18:53
hmm.. Thanks . let me try.
Thanks for help :)
as usual you are awsome
Spencer Gibb
@spencergibb
Mar 14 2018 19:24
NP