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

20th
Dec 2018
Ingo Griebsch
@ingogriebsch
Dec 20 2018 09:30
@spencergibb Are their plans to change this in the near future? And do you have a hint for us to get it working in some other way? Don't want to move all the properties contained in the data into the request paramters (would currently be possible because the data only contains simple properties). But what else could we do? Change to RestTemplate? Or is there another way to handle it?
Marcos Barbero
@marcosbarbero
Dec 20 2018 09:33
At this time moving to RestTemplate is the easiest way
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 12:38
Hi, I want to specify few properties in manifest.yml. if I specify them using: env option in manifest then on PCF they appear under user provided env variables. But I'm not sure if that's the place I want them to be and I'm not sure they are making any effect there. The properties I am providing are io.netty.allocator.type=unpooled and io.netty.noPreferDirect=true , these are for dealing with OOM issue. On local when I run using java -jar -D these props it works fine, but on PCF they don't appear to have any effect. Thanks.
Marcos Barbero
@marcosbarbero
Dec 20 2018 12:41
Hi @Sarvesh-D can you share your manifest.yml?
Sushant
@bsushant-athena
Dec 20 2018 12:42
Hi, we tried to move to finchley sr2 and we see that /metrics endpoint is not available ? Can you please tell how to get that , our monitoring is based on that?
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 13:23
---
applications:
- name: app-name
- memory: 1024M
- env:
     io.netty.allocator.type: unpooled
Marcos Barbero
@marcosbarbero
Dec 20 2018 13:34
@Sarvesh-D your manifest.yml has some formating problems it should be something like this:
---
applications:
- name: app-name
  memory: 1024M
  env:
    io.netty.allocator.type: unpooled
all the extra - just breaks it
Marcos Barbero
@marcosbarbero
Dec 20 2018 13:40
@bsushant-athena what was the previous version? Was it Edgware? If so, you were using spring-boot 1.5.x and Finchley uses Spring Boot 2.x where Actuator had a big refactoring, if that's the case you can find the migration guide here https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Migration-Guide#spring-boot-actuator
choubani amir
@amirensit
Dec 20 2018 13:44
hello.
OAuth2FeignRequestInterceptor interceptor is used by feign client.
Is there the equivalent of that one in RestTemplate?
Marcos Barbero
@marcosbarbero
Dec 20 2018 13:45
you can use OAuth2RestTemplate
choubani amir
@amirensit
Dec 20 2018 13:46
ok thanks
Marcos Barbero
@marcosbarbero
Dec 20 2018 13:46
:)
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 13:55
@marcosbarbero sorry, the actual manifest only is as per your reply. While posting here I added extra - by mistake
And the properties are getting added on PCF under "User Provided Environment Variables" but they are not having any effect. Whereas same varibales prevent OOM while running local using java -jar command
Marcos Barbero
@marcosbarbero
Dec 20 2018 14:00
that's odd, since it's shown as user provided variables it should work
Marcos Barbero
@marcosbarbero
Dec 20 2018 14:28
Did you check the logs to see what happens there? @Sarvesh-D
Maybe enable debug or check the /env endpoint in case you have actuator in your app?
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 15:10
@marcosbarbero I cannot see the property at /env endpoint. I will try few more approaches and let u know. My one question is since these netty related memory properties should kick in before the application configures netty, should I provide them someplace else?
Jeffrey Cameron
@x97mdr
Dec 20 2018 15:11
Hey all, I had a question about the config server. Is this the right place to ask?
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 15:13
@marcosbarbero Sorry, read it as I can see property at env endpoint
Marcos Barbero
@marcosbarbero
Dec 20 2018 15:17
no problem @Sarvesh-D
you are right, the env variables should get affected too late in the lifecycle, I'm trying to remember how to set System properties, it has been a while :D
@x97mdr yes, that's the right place to ask :)
Marcos Barbero
@marcosbarbero
Dec 20 2018 15:24
@Sarvesh-D this property io.netty.allocator.type isn't spring-boot related, is it? Is it a JVM argument?
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 16:12
@marcosbarbero yes it's not spring boot related. it has something to do with how netty utilizes jvm memory. I found it here for fixing OOM issue https://github.com/netty/netty/issues/6221#issuecomment-273033368
Marcos Barbero
@marcosbarbero
Dec 20 2018 16:15
Got it! In this case you have to set this property in the JAVA_OPTS var, it may solve your problem
Jeffrey Cameron
@x97mdr
Dec 20 2018 16:34
I’m having a heck of a time getting the git repository to work with ssh credentials!
The repo is in Bitbucket Server (if that helps)
I have applied the public key appropriately there (as I can clone the repo through regular git clone)
I continue to get com.jcraft.jsch.JSchException: USERAUTH fail when attempting to read the config.
Marcos Barbero
@marcosbarbero
Dec 20 2018 16:38
What’s the spring cloud version?
Jeffrey Cameron
@x97mdr
Dec 20 2018 16:39
2.0.0.RELEASE
In terms of auth/connection settings I only have these set: https://gist.github.com/x97mdr/ef08ab105176cb76896cbbba1683c08e
Marcos Barbero
@marcosbarbero
Dec 20 2018 16:42
I think you are probably mistaken you the version, there’s no spring cloud 2
Jeffrey Cameron
@x97mdr
Dec 20 2018 16:45
well, there you have it :)
ok, lemme change that and see if it fixes everything
Sarvesh Dubey
@Sarvesh-D
Dec 20 2018 16:51
@marcosbarbero thanks for the reply
But I'm not sure how to do that, any PCF docs on how to do that will help. Thanks
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:00
I’m away from my computer now, search for set env and JAVA_OPTS :smiley: sorry
@x97mdr if you are using spring boot 2 your spring cloud will probably be Finchley.SR2
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:04
I am using Spring Cloud! Thanks, I used Spring Initializr to get the real dependency management and it pointed me to Greenwich.RC1
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:05
Are you on which version of spring boot?
RC1? :worried:
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:10
2.1.0.RELEASE
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:11
Then move to Finchley
It may solve all your problems
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:12
fingers crossed
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:12
I mean, the Config server problems haha
But I think Finchley isn’t compatible with spring boot 2.1.0, you may have to use 2.0.x (x is the latest, google it I don’t recall)
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:13
… and here I thought I was going to wint the lottery too!
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:13
The lottery only available on next release, I’ll keep working on that
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:14
would downgrading to spring boot 2.0.0.RELEASE be better?
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:14
You can use the latest on 2.0.x series
I just don’t recall which one is that
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:15
I have already set the spring.main.allow-bean-definition-overriding=true property in the app
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:15
2.0.7.RELEASE
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:15
looks like that was the big problem with 2.1.0.RELEASE?
awesome, i’ll try that too
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:25
hrm, same result with spring boot 2.0.7.RELEASE and spring cloud Finchley.SR2
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:26
Can you share your pom? Or gradle dependencies, whatever you use
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:27
I’ll strip it and add it to the gist, give me a minute
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:27
No problem
Another question, is it a on premises installation of bitbucket?
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:28
yes, it is an on-premise install
whoops, wait one forgot the config-server build.gradle too
fixed now
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:48
Man, I’m in a Xmas drinks right now. I’ll check it once I’m out here :)
Sorry
Jeffrey Cameron
@x97mdr
Dec 20 2018 17:52
lol no worries! enjoy it
Marcos Barbero
@marcosbarbero
Dec 20 2018 17:55
<3
I’m the meantime maybe @spencergibb can help you
Marcos Barbero
@marcosbarbero
Dec 20 2018 18:23
In*
dharezlak
@dharezlak
Dec 20 2018 20:31
Hi, is there any way to bridge the gap between Spring Rest Docs
... and Swagger/OpenAPI?
Spring Rest Docs already produces curl snippets and I was wondering if there is a plan to extend the output snippets to API specs such as OpenAPI or Postman.
dharezlak
@dharezlak
Dec 20 2018 20:38
I know that Spring Cloud Contracts integrates nicely with Spring Rest Docs to produce WireMock request specs so maybe there is something more in the making. Can anyone share on this topic?
Marcos Barbero
@marcosbarbero
Dec 20 2018 22:23
Hi @dharezlak I don't know about the plans but I do know it's not supported, the closest i could get was by using this https://springframework.guru/defining-spring-cloud-contracts-in-open-api/