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

7th
Jul 2017
Abhishek Dujari
@abshkd
Jul 07 2017 08:22
sad to hear about Lombok, i was thinking of using it in future
Abhishek Dujari
@abshkd
Jul 07 2017 08:27
is it the correct approach to test a rest service that has "non-required" relations in the same testclass?
for e.g. Blog and Category so If I am doing BlogResourceIntTest, should I include test to apply a category?
i am not sure what is the best practise. in Rspec we do that
Dave Syer
@dsyer
Jul 07 2017 08:34
What happened to Lombok?
(Your question about tests is nothing to do with Spring or Spring Cloud, so I'm just going to ignore that)
Abhishek Dujari
@abshkd
Jul 07 2017 08:36
@dsyer So Spring-cloud has no convention on writing tests?
Dave Syer
@dsyer
Jul 07 2017 08:36
Nothing that applies at that level. You are talking about simple domain objects.
Spring Cloud is about distributed systems
Abhishek Dujari
@abshkd
Jul 07 2017 08:36
ok, cause I was testing the rest service within a microservice
i havent progressed farther into restTemplate
thanks anyway.
this should probably be asked in Spring Boot
Dave Syer
@dsyer
Jul 07 2017 08:38
I don't think it has anything to do with Spring Boot either
Abhishek Dujari
@abshkd
Jul 07 2017 08:39
ok. so there isnt a testing guide
that is specifically for Spring
Dave Syer
@dsyer
Jul 07 2017 08:39
I have no idea what you are asking for
You can find lots of documentation on testing Spring applications.
None of it will tell you how to test your own domain objects
because those are yours
Abhishek Dujari
@abshkd
Jul 07 2017 08:40
i think you misunderstand, maybe my english.
i was just citing example.
what i wanted to know is if there are any guidelines or writing useful tests for a Spring apps such that we can do TDD
sorry, closest i know is Rails/Rspec
Dave Syer
@dsyer
Jul 07 2017 08:42
Did you look here: https://spring.io/guides?
Abhishek Dujari
@abshkd
Jul 07 2017 08:43
yes i did but it has a very basic example
Dave Syer
@dsyer
Jul 07 2017 08:43
It's a start
You might also be interested in looking at the Spring Boot samples in github.
Abhishek Dujari
@abshkd
Jul 07 2017 08:44
ah yes, those
i am sure they have a lot more tests, thanks
Thibaud Lepretre
@kakawait
Jul 07 2017 11:04
Is there any fondamental difference between DiscoveryClient#getInstances(String serviceId) and ServiceList#getUpdatedListOfServers() from ribbon?
Even that neither Spring Cloud Consul nor Spring Cloud Etcd nor Spring Cloud Zookeeper are sharing code between those methods, but it seems to do the same thing (just output seems to be different)
Thibaud Lepretre
@kakawait
Jul 07 2017 12:45
So I was asking myself why should I have to implement a custom *RibbonClientConfiguration that will define a ServerList<?> when I already implemented a DiscoveryClient. I was thinking that only implementing DiscoveryClient will be enough to get @LoadBalanced RestTemplate but not... I have to duplicate logic inside ServerList<?>
Dave Syer
@dsyer
Jul 07 2017 12:49
Where does the default ServerList come from then?
Is it not from the DiscoveryClient?
Andrew Fitzgerald
@fitzoh
Jul 07 2017 16:05
is spring-cloud-gateway missing from the milestone repo?
http://repo.spring.io/milestone/org/springframework/cloud/ + ctrl+f ‘gateway’
Spencer Gibb
@spencergibb
Jul 07 2017 16:09
@Fitzoh yeah, something is wrong
@kakawait I've thought about a DiscoveryClient based ServerList.
@Fitzoh should be fixed
Andrew Fitzgerald
@fitzoh
Jul 07 2017 16:14
Cool, thanks @spencergibb ... Are you starting a channel for gateway, or just keeping it here for now?
Spencer Gibb
@spencergibb
Jul 07 2017 16:15
here for now
Andrew Fitzgerald
@fitzoh
Jul 07 2017 16:15
:+1:
Andrew Fitzgerald
@fitzoh
Jul 07 2017 16:51
Back from lunch, looks good. One other thing you might want to be aware of is that master is now super different than M1, which might be a little confusing for people (like me) who just found out about the project
(and master is the default branch if you visit it on github)
Spencer Gibb
@spencergibb
Jul 07 2017 16:51
we released from the 2.0.x branch. It's super unusual that we're doing an M1 6 months in advance
Andrew Fitzgerald
@fitzoh
Jul 07 2017 16:53
yeah, I was just thinking that you might want to temporarily set the default branch to 2.0.x instead of master so that people see something closer to the milestone if they look at github
Andrew Fitzgerald
@fitzoh
Jul 07 2017 17:24
Screen Shot 2017-07-07 at 1.25.00 PM.png
Any idea why this RouteLocator function isn’t executing?
Spencer Gibb
@spencergibb
Jul 07 2017 17:34
No
Spencer Gibb
@spencergibb
Jul 07 2017 17:40
change the name of the bean @Fitzoh
Andrew Fitzgerald
@fitzoh
Jul 07 2017 17:40
yep, that does it
Andrew Fitzgerald
@fitzoh
Jul 07 2017 18:31

This is awesome btw @spencergibb
We’ve been using zuul/consul for blue-green deployments for a while now, but didn’t really know how to approach digging into the Rule/Loadbalance rules to handle more sophisticated deployments (canaries/internal only).

spring-cloud-gateway makes most of the trivial, got an poc up and running in like an hour

Thibaud Lepretre
@kakawait
Jul 07 2017 18:46
@dsyer notre from DiscoveryClient.. at least for Spring cloud consul, etcd and zookeeper. As @spencergibb may already though it could be great to get a default impl that delegate to DiscoveryClient if iscoveryClient bean is found