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

17th
Jun 2018
Marcos Barbero
@marcosbarbero
Jun 17 2018 06:45
thanks @ask4gilles I'll check it later
Gilles Robert
@ask4gilles
Jun 17 2018 06:48

I just tried to add

cloud:
    config:
      discovery:
        enabled: true

in my bootsrap and it fixed the issue...

Marcos Barbero
@marcosbarbero
Jun 17 2018 06:50
I thought it could be an issue yesterday, and right now I just realized I misread your configuration
you had spring.cloud.consul.discovery.enabled=true
I misread it as it was spring.cloud.config.discovery.enabled :smile:
Gilles Robert
@ask4gilles
Jun 17 2018 06:52
yes :-)
Thanks for your time though
Marcos Barbero
@marcosbarbero
Jun 17 2018 06:52
you're welcome, I'm glad you could fix the issue
Gilles Robert
@ask4gilles
Jun 17 2018 07:54

@marcosbarbero I think there is a circular glitch there: I want to start a configserver, so I don't want to enable

    config:
      discovery:
        enabled: true

in that case...

Marcos Barbero
@marcosbarbero
Jun 17 2018 07:56
let me check it
Gilles Robert
@ask4gilles
Jun 17 2018 07:58
I mean, it works, but it's a bit weird to have to declare discovery for the service you are starting, no?
2018-06-17 09:56:15.584  WARN 27879 --- [           main] lientConfigServiceBootstrapConfiguration : Could not locate configserver via discovery

java.lang.IllegalStateException: No instances found of configserver (configserver)
Marcos Barbero
@marcosbarbero
Jun 17 2018 08:12
not really actually
if I'm not mistaken, you are adding configserver to also be registered at consul, right?
Gilles Robert
@ask4gilles
Jun 17 2018 08:13
yes
Marcos Barbero
@marcosbarbero
Jun 17 2018 08:15
As you are using Discovery First approach, that's the way it works. It tries to fetch the configserver (that's the default ID) on boostrap phase.
Gilles Robert
@ask4gilles
Jun 17 2018 08:20
for me it does not make any sense to declare the config server to register into consul and it the same configuration, to enable the discovery for this config server (which would make sense in a client application who needs to fetch its config from the config server...)
Marcos Barbero
@marcosbarbero
Jun 17 2018 08:22
Now I’ve a different question. Why do you have consul as well as configserver? Can’t you just use one of them?
Gilles Robert
@ask4gilles
Jun 17 2018 08:24
I want to use Consul for service discovery only. I want to use a config server to fetch my configurations from it through git. I want to use vault to store my credentials in it and I want to use Consul as Vault backend.
Marcos Barbero
@marcosbarbero
Jun 17 2018 08:26
Got it
Gilles Robert
@ask4gilles
Jun 17 2018 08:26
I don't want to use K/V from consul for my configuration because I want to make use of the /monitor to be able to have my configuration refreshed through a git webhook
Marcos Barbero
@marcosbarbero
Jun 17 2018 08:28
Well, I’ll need to fetch some more info about this setup. Maybe in one hour from now, right now I’m heading the gym :smile:
Gilles Robert
@ask4gilles
Jun 17 2018 08:29
hehe, good idea :-D
Gilles Robert
@ask4gilles
Jun 17 2018 10:00
Marcos Barbero
@marcosbarbero
Jun 17 2018 12:22
I'll check it out @ask4gilles
Gilles Robert
@ask4gilles
Jun 17 2018 13:09
So, I figured it out.
1) You don't need spring-cloud-vault-config to use vault with the config server
2) You can combine the usage of Git and Vault in the configserver, using both profiles: git and vault
3 from what I see in org.springframework.cloud.config.server.environment.VaultEnvironmentRepository it is not possible to use it with a discovery client.
The url has to be provided...
With such a config, I'm able to retrieve my properties for my clients apps from git through the config server and the credentials from vault, also through the config server.
Marcos Barbero
@marcosbarbero
Jun 17 2018 13:29
Congratz
Unfortunately I'd not enough time to help you, but I'm glad you figured it out
Gilles Robert
@ask4gilles
Jun 17 2018 13:33
No worries. For those who are interested, I just found this interesting blog post (a bit late for me :) ) http://pscode.rs/spring-cloud-remote-config/
CH4:D
@chad_d_stud_twitter
Jun 17 2018 15:43
Question, is it a practical use case to use kafka or something similar as a means to communicate among a network of microservices?
as opposed to, say, using resttemplate or feign
Marcos Barbero
@marcosbarbero
Jun 17 2018 15:56
It depends on your use case, but it yes a common use case indeed
CH4:D
@chad_d_stud_twitter
Jun 17 2018 16:01
but that does take away the REST endpoints, does it?
excluding a browser-facing service, everything else is a kafka consumer/publisher
Marcos Barbero
@marcosbarbero
Jun 17 2018 16:02
It depends on the use-case
If it’s only service to service communication, you probably can remove all the REST layer
CH4:D
@chad_d_stud_twitter
Jun 17 2018 16:06
yeah, service to service. i don't get the logic behind what they want
they want rest endpoints for each service but they also want it to be a queue
Marcos Barbero
@marcosbarbero
Jun 17 2018 16:07
:smile:
Well, maybe they want to be able to post to some endpoint and it goes to the queue as well? Just guessing
CH4:D
@chad_d_stud_twitter
Jun 17 2018 16:17
not really. the reasoning why it still has to have a REST endpoint is partly due to the requirement that if they were to pull that service by itself, they could reuse it
but that doesn't actually make sense if you're using kafka
so that basically means i'll have TWO classes, one for the rest controller and another one that processes the kafka stream
Marcos Barbero
@marcosbarbero
Jun 17 2018 16:19
There are a lot of companies out there hiring java developers :smile: :smile:
CH4:D
@chad_d_stud_twitter
Jun 17 2018 16:20
well you're not wrong
;)
i really don't get the requirement for local companies asking use for like 5yrs or so with spring boot. if you're worth your weight in java dev then i think a few months is enough to learn most of the useful stuff. admittedly i feel like it takes one lifetime to learn spring at this point XD
Marcos Barbero
@marcosbarbero
Jun 17 2018 16:24
If you take it straight, it’s sort of impossible to have 5 years of spring boot, it was released in april 2014 :smile: of course, I’m not adding beta, alpha phases haha
CH4:D
@chad_d_stud_twitter
Jun 17 2018 16:37
and there you see who's actually the fool who posted the job opening XD