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

20th
Jan 2017
Patrick Cornelißen
@pcornelissen
Jan 20 2017 07:45
I have a weird service behaviour here. I have aprox 20 spring cloud based services and one of them seeme to fetch the config from the config server every few minutes (the service is up all the time
2017-01-20T07:43:08.000Z 1: 2017-01-20 08:43:08.383 INFO 11 --- [io-11111-exec-2] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://confighub:8888
2017-01-20T07:43:08.000Z 1: 2017-01-20 08:43:08.578 INFO 11 --- [io-11111-exec-2] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=contracts, profiles=[docker, kontena, live], label=null, version=null, state=null
I’ve never seen this before. What could trigger this?
Patrick Cornelißen
@pcornelissen
Jan 20 2017 08:01
Hmm, I’ve found a few more services that show this symptom, but not all of them and I don’t see the difference that might cause this...
Dave Syer
@dsyer
Jan 20 2017 10:09
Docker and networks. Good luck figuring that out.
Is there an error?
Or you just wonder why it is fetching?
Probably someone is pinging its /health endpoint?
Marcos Barbero
@marcosbarbero
Jan 20 2017 10:29
I don't know why it's happening just with few of them because there is a health checking pooling configserver by default so it should happens to every single service that depends on configserver unless you disable it.
Dave Syer
@dsyer
Jan 20 2017 10:31
It depends on who is pinging the /health endpoint
It must be something in your platform (Spring Cloud doesn't do that)
Casey Link
@Ramblurr
Jan 20 2017 10:49
can someone point me to docs or an example on how I would trigger a spring-cloud-task from a normal spring boot web app
Dave Syer
@dsyer
Jan 20 2017 10:49
spring-cloud-task is tied to the ApplicationContext lifecycle.
Casey Link
@Ramblurr
Jan 20 2017 10:50
I don't have spring cloud flow, and I'd like to avoid that for now as it adds extra complexity i don't need.
@dsyer ah I should mention the cloud-task is a separate project/codebase
so it would run as a different process/jvm
Dave Syer
@dsyer
Jan 20 2017 10:50
All you need to do is create an ApplicationContext that has @EnableTask in it.
It's up to you how you want to do that.
dataflow uses the spring-cloud-deployer abstraction
Casey Link
@Ramblurr
Jan 20 2017 10:51
Yea I have that working great, and I can launch the task with the spring boot jar. I guess I could just trigger that system command from my web app
Dave Syer
@dsyer
Jan 20 2017 10:51
If you want it as a separate process that's probably the cleanest way to do it
Casey Link
@Ramblurr
Jan 20 2017 10:54
assuming i had a data flow local server and wanted to launch the task through there, what would be the best way to do that?
Use the data flow rest api?
Dave Syer
@dsyer
Jan 20 2017 10:54
I guess that depends on what you want to achieve. Certainly that's an option.
Casey Link
@Ramblurr
Jan 20 2017 10:57
There are a few batch jobs I have implemented as cloud-tasks that I want to allow users of my application launch and run
but I don't want to give these users access to the data flow dashboard
Dave Syer
@dsyer
Jan 20 2017 10:58
Sure. So what it comes down to really is how much you want to know about the deployer, or need to strategize it.
And how much you care about where the jobs run
Using dataflow would enable them to run anywhere (like a different host/container)
Using the deployer directly means you make that choice when you build your app
The app deployer is pretty easy to use.
I'd start there if I were you
Casey Link
@Ramblurr
Jan 20 2017 11:01
Does it have a docs reference site/page?
Dave Syer
@dsyer
Jan 20 2017 11:01
Don't know
It has an API
Casey Link
@Ramblurr
Jan 20 2017 11:03
and if i wanted to abstract the where and how of running the tasks, how would my app communicate with data flow?
thanks for the links
Dave Syer
@dsyer
Jan 20 2017 11:03
The REST API I guess.
dataflow probably documents it
What would be neat would be if there was an AppDeployer that used the dataflow REST endpoints.
Casey Link
@Ramblurr
Jan 20 2017 11:05
that would be useful :)
Dave Syer
@dsyer
Jan 20 2017 11:11
Should be easy to implement
Patrick Cornelißen
@pcornelissen
Jan 20 2017 14:32
you’re right I have a check that pings health, I wasn’t aware that this triggers the config server fetch process
Patrick Cornelißen
@pcornelissen
Jan 20 2017 16:46
I’m switching to /info instead...
Patrick Cornelißen
@pcornelissen
Jan 20 2017 16:59
which reminds me that info might be a better endpoint for the eureka health check too