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

9th
Nov 2017
Xy Ma
@garfeildma
Nov 09 2017 03:49
HI all, I'm working with spring cloud zookeeper config, when I mark the class with @RefreshScope, the value can auto update when changed in zookeeper, but when mark with @ConfigurationProperties, the value didn't auto upadte
@Component
@ConfigurationProperties
@RefreshScope
class ApplicationConfigs {
    @Value("\${app.test}")
    var test = ""
}
maskleo
@maskleo
Nov 09 2017 03:52
@Value("${app.test}")
Xy Ma
@garfeildma
Nov 09 2017 03:52
in both case I can see o.s.c.e.e.RefreshEventListener : Refresh keys changed: [app.test] in log
@mask-dmrs I'm writing in kotlin
maskleo
@maskleo
Nov 09 2017 04:02
i thank u must visit http://ip:port/refresh @garfeildma
think
Xy Ma
@garfeildma
Nov 09 2017 04:05
@mask-dmrs refresh doesn't help
maskleo
@maskleo
Nov 09 2017 04:37
spring-boot-starter-actuator.jar
Xy Ma
@garfeildma
Nov 09 2017 05:38
@mask-dmrs it's in my class lib, the problem now is I have to add @RefreshScope to make it work, but https://github.com/spring-cloud/spring-cloud-config/issues/444#issuecomment-232239054 I see here says @ConfigurationProperties can work too
Dave Syer
@dsyer
Nov 09 2017 06:37
If you use @Value only @RefreshScope will rebind the property
@ConfigurationProperties doesn’t work like that (it binds to bean properties).
Xy Ma
@garfeildma
Nov 09 2017 08:00
OK, got it, thx
tankdeper
@tankdeper
Nov 09 2017 08:39
what's the differences between properties and yml?
eureka:
  client:
   registerWithEureka: false
maskleo
@maskleo
Nov 09 2017 08:40
Grammar is different
Nothing else is different
tankdeper
@tankdeper
Nov 09 2017 08:41
Well, I mean the config items on these two types
# yaml
eureka:
  client:
   registerWithEureka: false
#properties
eureka.client.register-with-eureka=false
maskleo
@maskleo
Nov 09 2017 08:42
They are the same,I've tried many times.
tankdeper
@tankdeper
Nov 09 2017 08:43
you mean just the format is different?
maskleo
@maskleo
Nov 09 2017 08:43
yeah
u can try to do it
tankdeper
@tankdeper
Nov 09 2017 08:44
# yaml
eureka:
  client:
     register-with-eureka: false
I could use this ?
I've tried it several times
actually, it still works
maskleo
@maskleo
Nov 09 2017 08:45
yes
It's just a different way of parsing it
tankdeper
@tankdeper
Nov 09 2017 08:46
ok! Ii just feel a little weird
:sweat_smile:
Yogendra Mishra
@imyom25
Nov 09 2017 11:44
@dsyer @imyom25
thanks . i have configured services individually and it did worked. Also I was getting some feign retry issue which I fixed by putting below properties
ribbon:
OkToRetryOnAllOperations: false
ReadTimeout: 60000
ConnectTimeout: 60000
xCJPECKOVERx
@xCJPECKOVERx
Nov 09 2017 17:41
I've got multiple Spring Boot applications running as services on AWS. They utilize spring config, oauth, jpa, feign, and have various REST endpoints. The problem is that after about 8-10 days of running, the apps will crash due to a lack of memory. Using sysstat I'm able to pinpoint the time the app crashed, as well as view the rise in memory usage until failure.
Any thoughts on why the applications are using so much memory? I thought it could perhaps be something of my own doing, until my authentication server crashed which doesn't use feign, isn't an oauth client, and doesn't have any endpoints made by me; It's just a run of the mill uaa server that give JWT tokens.
Dave Syer
@dsyer
Nov 09 2017 18:52
Don’t know. You don’t exactly provide a lot of detail. Maybe try upgrading to latest versions?
xCJPECKOVERx
@xCJPECKOVERx
Nov 09 2017 19:33
I'm trying out 2.0.0.M3 right now, I'll upgrade to M6 and see how that goes.
Not many details just because I don't know much about whats happening. Just that after about 2 weeks, spring boot uses too much of the available memory and the system aborts it. Granted, I'm using the smallest ec2 instance with only .5gb ram, though I wouldn't expect a fairly lightweight spring boot app to use that much.
I did find success in one app where i added the .conf file with jvm memory limits. In 9 days, so far, it's stayed at a steady 85% system memory usage (of 1gb)