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

1st
Feb 2017
Spencer Gibb
@spencergibb
Feb 01 2017 03:50
Eugenio Romano
@eromano
Feb 01 2017 09:55
ok thanks I will
Andrew Fitzgerald
@fitzoh
Feb 01 2017 14:15

@spencergibb, the current GitLab situation reminded me that I should follow up on spring-cloud/spring-cloud-config#617

Is the composite environment stuff available in 1.2.2, or do we need to wait for 1.3?

Also, if a running config server is unable to connect to the underlying git repo, will it serve stale config or fail?

Dave Syer
@dsyer
Feb 01 2017 15:06
The composite is in 1.3
Josh Fix
@joshfix
Feb 01 2017 18:23
i asked the question over in spring-cloud-stream and was advised to ask here... the kafka endpoints in stream default to localhost, but can be configured with properties using spring.cloud.stream.kafka.binder.zkNodes and .brokers. I was wondering if there is a way to simply specify the service name from the discovery service, or if i would manually have to create some sort of bean or run some code to manually pull the endpoints from DiscoveryService and configure them manually myself. if i have to do it manually, what bean should i create or what class should i wire in to set the updated endpoints?
Dave Syer
@dsyer
Feb 01 2017 18:24
What's a "kafka endpoint"?
Josh Fix
@joshfix
Feb 01 2017 18:25
the ip/port of the kafka server
Dave Syer
@dsyer
Feb 01 2017 18:25
That's not a spring cloud feature then.
It's not autoconfig in spring boot now?
it defaults to localhost
Dave Syer
@dsyer
Feb 01 2017 18:27
I don't know why you're asking here still
That's code in spring cloud stream
Josh Fix
@joshfix
Feb 01 2017 18:27
correct... i just asked in the stream channel and was advised to ask here
Dave Syer
@dsyer
Feb 01 2017 18:28
Crossed wire then
I get it.
You want to register the Kafka broker as a service?
Josh Fix
@joshfix
Feb 01 2017 18:28
yes sir
Dave Syer
@dsyer
Feb 01 2017 18:29
I've heard of people doing that (non HTTP services in the registry).
Especially with consul
Service Discovery in spring cloud is mainly aimed at HTTP services that register themselves though
The Kafka broker is not http and it isn't going to register itself is it?
Josh Fix
@joshfix
Feb 01 2017 18:31
i already have it registered. i'm just wondering the correct way to programatically modify the endpoint while my app is booting up
Dave Syer
@dsyer
Feb 01 2017 18:33
What kind of service registry is it?
Josh Fix
@joshfix
Feb 01 2017 18:33
consul :)
Dave Syer
@dsyer
Feb 01 2017 18:34
I don't think the spring cloud abstraction lets you pick out a host and port without downcasting
You'd probably have to hard code some knowledge of the fact that it's consul (assuming it's even possible).
@spencergibb should be able to help
I don't think the consul service registry is the same as the spring-cloud-consul one either
Josh Fix
@joshfix
Feb 01 2017 18:36
ok... i'm basing this question off of how i perform the similar config for redis -- i have a bean to create the JedisConnectionFactory. that class autowires in the DiscoveryClient, i nab the endpoint for my redis server, then set the hostname/port using the values from discovery
Dave Syer
@dsyer
Feb 01 2017 18:36
Again, I might be wrong.
Josh Fix
@joshfix
Feb 01 2017 18:37
i just wasn't sure if i could provide my own "connection factory" for kafka/stream
or inject those values somehow in the provided config props classes before they're used to build the connection
Dave Syer
@dsyer
Feb 01 2017 18:37
Whatever you did for redis you can donfor Kafka. I don't think it has anything to do with spring cloud discovery though. Does it?
s/donfor/do for/
If you want to plug into the config to keep spring cloud stream happy you would need to create a PropertySource in the environment. Spring Cloud has a PropertySourceLocator and spring boot has EnvironmentPostProcessor.
Josh Fix
@joshfix
Feb 01 2017 18:40
not directly. i wasn't sure if there was already some mechanism to simply tell stream to use a name from discovery... similar to a feign client or rest template where you don't explicitly provide the endpoint/url, but just tell it the service name. since that is not possible, i am interested in using the spring cloud discovery client to manually grab the info myself and programmatically update the endpoints vs just relying the config props
Dave Syer
@dsyer
Feb 01 2017 18:40
One of those should do what you need.
They are pretty well documented
Josh Fix
@joshfix
Feb 01 2017 18:41
i think you're right and i should have thought of that. thanks for pointing me in the right direction!