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

22nd
Oct 2015
Tommy Ludwig
@shakuzen
Oct 22 2015 00:34
Is there any way to have the benefit of the auto-complete and meta-data for properties/yaml files for my config repo in STS? It is a repo with just yaml files, so there obviously aren't any JARs to pull meta-data from. How are other people updating/creating their config files in their config repo?
(By config repo, I mean the git repo for my Spring Cloud Config configuration files)
turick
@turick
Oct 22 2015 11:54
i just use a text editor, or netbeans if i want to make it prettier for demo purposes
Dave Syer
@dsyer
Oct 22 2015 12:04
You would need a Java project in STS to get auto-completion (so the dependencies are on the classpath).
Tommy Ludwig
@shakuzen
Oct 22 2015 12:07
I guess I could make it a Java project locally and git ignore everything but the configuration files for convenience.
Collin Peters
@collinpeters
Oct 22 2015 18:36
@dsyer - I have another question regarding the spring security/oauth/angular tutorial. Do you know if there is any way to get the UI server to detect when the resource server returns a 401 because the token expired and have it automatically fetch a new one using the refresh token? I guess I'm wondering if either A) this is supported out of the box and I just can't find it or don't have it configured correctly or B) where in Spring Cloud I would go about implementing something like that (assuming it is in Spring Cloud)
turick
@turick
Oct 22 2015 20:30
interesting docker/ip issue... we're having to start up our docker instances with the jar files providing command line porperties for server.port, eureka.instance.ipAddress, hostname, nonSecurePort, homePageUrl, statusPageUrl, and healthCheckUrl. the result is eureka showing all of the proper corresponding values, with the exception of the hostname. we are using the preferIpAddress parameter, and the ip address correctly shows up as what we're manually setting it to (the host VM ip)
the hostname is defaulting the docker IP and it ignores the value we're specifying from the command line
specifically, the service this is occuring on is our config service. when i deploy any other microservice and it attempts to autodiscover the config service, it's getting back the hostname, which is the docker ip
it seems eureka always responds with the hostname? and when you prefer ip address, it just uses the ip address in the hostname field? but it's still using the auto-detected ip address instead of the one we're manually specifying
Spencer Gibb
@spencergibb
Oct 22 2015 20:44
interesting
turick
@turick
Oct 22 2015 20:49
if i don't prefer ip address, i can change the hostname and it shows up properly, but we're not running dns so i'd really like to keep everything ip based for now
hmm... so i can set the hostname to an ip address in this case instead of an actual name... i wonder if that will get us by
Spencer Gibb
@spencergibb
Oct 22 2015 20:50
can you set the hostname to the ip address?
yup, doesn’t matter. That’s the case if it can’t determine a hostname anyway.
turick
@turick
Oct 22 2015 20:53
ok, we'll give it a shot. it's interesting looking at /eureka/apps/config and seeing how so many different properties only effect certain values in eureka... server.port seems to effect the healthcheck and status page urls, but not the homepage url or the actual non-secured port. you have to set the eureka.instance.nonSecurePort specifically for that, but then you have to fully set the homepage url (not that that is a significantly important issue). when you prefer ip address, it changes the hostname to the IP (but the autodiscovered one, not the one you specify), but the statuspage and healthcheck urls still use the hostname
but then if you prefer ip address, you can't specify the host name.... just a crazy mixup of properties and results
Spencer Gibb
@spencergibb
Oct 22 2015 20:53
yes, we can only do so much to guess what those urls should be
turick
@turick
Oct 22 2015 20:57
sorry, not trying to complain, just trying to wrap my head around which properties effect which values and didn't see the results i expected. we're going to give setting the hostname as the ip address tomorrow
thanks for the help :)
is it a valid bug i should submit though, if i specify an ip address explicitly and tell it to prefer ip, but it uses the auto-detected ip for the hostname in it's place?
Spencer Gibb
@spencergibb
Oct 22 2015 20:59
yeah probably
checketts
@checketts
Oct 22 2015 22:26
@spencergibb My config server is taking over 3 minutes to return. I have a git repo on my filesystem and I'm configured to hit it, however looking at a thread dump I see JGit doing some ssh stuff
{

    "methodName": "connect",
    "fileName": "Session.java",
    "lineNumber": 215,
    "className": "com.jcraft.jsch.Session",
    "nativeMethod": false

},
{

    "methodName": "getSession",
    "fileName": "JschConfigSessionFactory.java",
    "lineNumber": 116,
    "className": "org.eclipse.jgit.transport.JschConfigSessionFactory",
    "nativeMethod": false

},
{

    "methodName": "getSession",
    "fileName": "SshTransport.java",
    "lineNumber": 136,
    "className": "org.eclipse.jgit.transport.SshTransport",
    "nativeMethod": false

},
{

    "methodName": "<init>",
    "fileName": "TransportGitSsh.java",
    "lineNumber": 262,
    "className": "org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection",
Spencer Gibb
@spencergibb
Oct 22 2015 22:29
hmm, what’s your config look like?
checketts
@checketts
Oct 22 2015 22:29
spring.cloud.config:
  server:
    git.uri: file:///home/cloud-configuration/test-config
It is snappy when running on my workstation, I only see this slowness when it is running in my cloud based server
I'm guessing that server has limited DNS so that is why there is a difference in behavior
But GitSsh shouldn't be needed
Spencer Gibb
@spencergibb
Oct 22 2015 22:32
well, your checked out repo is connected via git ssh?
it’s still trying to refresh it is my guess and going really slow on your cloud server
checketts
@checketts
Oct 22 2015 22:34
Good point. I rsynced my repo up instead of doing a bare mirror
I'll remove the remotes it has listed
:clap: That was exactly the problem. Wow Spencer.
Thanks
Spencer Gibb
@spencergibb
Oct 22 2015 22:40
yeah, when you said it ran fast on your workstation vs server...
NP