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

11th
May 2017
Mark Corkery
@KramKroc
May 11 2017 07:03
Hi @jonatan-ivanov I think setting that may cause other issues, i.e. how to dynamically set it to avoid collisions with multiple instances of same container/service
Mark Corkery
@KramKroc
May 11 2017 10:39
I think part of the problem is that the container is starting and has multiple network interfaces. The hostInfo for the EurekaInstanceConfigBean is populated by a call to this.inetUtils.findFirstNonLoopbackHostInfo() which I guess is not gauranteed to always use the same interface. I think you can use spring.cloud.inteutils properties to add ignored/preferred networks but that appears at first glance to be brittle
Dave Syer
@dsyer
May 11 2017 10:54
Don't you have an environment variable with the IP address in it?
Mark Corkery
@KramKroc
May 11 2017 12:05
@dsyer I guess with swarm your containers/services could “spawn”/spin up anywhere so Im not sure setting an environment variable would work?
Dave Syer
@dsyer
May 11 2017 12:09
I never used it
Doesn't it set environment variables?
Vanilla docker does
Stian Lågstad
@stianlagstad
May 11 2017 12:47
My problem was solved with help on stackoverflow (http://stackoverflow.com/questions/43910556/spring-boot-with-feign-and-hystrix-cant-get-request-timeouts-to-work). I hadn't enabled hystrix with feign.hystrix.enabled: true. It works when I add that
Mark Corkery
@KramKroc
May 11 2017 12:52
@dsyer The closest env I can see is the HOSTNAME, but that wouldn’t be unique:
[root@configserver /]# env
HOSTNAME=configserver
TERM=xterm
EUREKA_PORT=8761
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
SHLVL=1
HOME=/root
EUREKA_HOST=discoveryservice
_=/usr/bin/env
Dave Syer
@dsyer
May 11 2017 12:57
Don't know then. If you really don't even know the network interface, I guess maybe eureka is the wrong solution.
Mark Corkery
@KramKroc
May 11 2017 13:38
@dsyer eureka rules them all :D
Seriously though, eureka gives us so much that stepping back from there and using docker’s service discovery wouldn’t be optimal.
Mark Corkery
@KramKroc
May 11 2017 13:44
Removing docker as a source of confusion, there could be other situations where there would be multiple network interfaces (multipe ethernet cards plugged into a server etc) so how in spring discovery client would we set it up to use a specific interface for say front channel communication
I’m looking at spring.cloud.inetutils.preferredNetwork as a solution
Dave Syer
@dsyer
May 11 2017 13:46
That's what people use
Mark Corkery
@KramKroc
May 11 2017 13:46
:+1: Thanks as always @dsyer
Dave Syer
@dsyer
May 11 2017 13:46
Or else an IP address in config (e.g. via env var)
A decent platform will give you that, or an API to find it.
E.g. AWS has a Java API
That's what Netflix use in the original eureka
Mark Corkery
@KramKroc
May 11 2017 13:49
But would that not be the IP of the Host rather than the container so you are punching out to come back into the config server?
Dave Syer
@dsyer
May 11 2017 14:35
It depends right?
The platform would know what would be most useful.
Felipe Adorno
@FelipeAdorno
May 11 2017 16:01
Hi all, can I use @Cachable in feign interface? I'm using proxy-target classes
Felipe Adorno
@FelipeAdorno
May 11 2017 16:21
I tested and I think works fine the first call off the feign interface method I see logs about Feign and in the second time I don't see anything
Al Grant
@bigalnz
May 11 2017 19:45
beanstalk?
WHats a good ec2 marketplace instance to start up for Springboot/MySql project?
Eric Deandrea
@edeandrea
May 11 2017 21:45
@bigalnz you could use elastic beanstalk to run a spring boot app. You'd have to stand up the database yourself though. You could also use Pivotal Web Services (public instance of pivotal cloud foundry). That's what I use.