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

27th
Jun 2017
Amin Abu-Taleb
@aabutaleb
Jun 27 2017 12:29
Hi Is there any way to reuse existing classes from Spring cloud to query eureka and get a list of the applications it has in the registry?
Dave Syer
@dsyer
Jun 27 2017 12:31
There's a DiscoveryClient abstraction in Spring Cloud Commons.
Amin Abu-Taleb
@aabutaleb
Jun 27 2017 12:31
Thanks @dsyer !
Dave Syer
@dsyer
Jun 27 2017 12:32
If you need to go more granular than that you need the Eureka class (same name, but not available for other discovery services)
Amin Abu-Taleb
@aabutaleb
Jun 27 2017 12:32
let me check, it should be very straightforward, just need to retrieve a list of services running
Dmitry Zhikharev
@jihor
Jun 27 2017 14:17
Hi!In my PR (spring-cloud/spring-cloud-commons#221), I got a response that you are moving away from Lombok. I'm curious to find out, why?
Dave Syer
@dsyer
Jun 27 2017 15:14
It's not common enough amongst the pool of users that might build or submit patches
It confuses the ones who don't use it
and puts them off
We don't have anything against it technically. It's fun and useful for building apps.
We just don't like it in libraries
Felipe Adorno
@FelipeAdorno
Jun 27 2017 16:16
HI all,

if I have config server with this application.yaml configuration:

#AUTH SERVER CONFIGURATION
security:
  user:
    password: none
  basic:
    enabled: false
  oauth2:
    client:
      clientId: bla
      clientSecret: foo
      accessTokenUri: https://foouaa/oauth/token
      grant-type: client_credentials
      scope: server
    resource:
      user-info-uri: https://foo/uaa/me

and in the specific yaml (bla.yaml) I have this:

security:
  oauth2:
    client:
      clientId: correct-bla
      clientSecret: correct-bla
what is the final clientId and clientSecret?
Dave Syer
@dsyer
Jun 27 2017 16:42
It depends how you install/use those files.
You will need to be more specific before we know what you mean
E.g. a sample app
Some sample curl commands or something
Felipe Adorno
@FelipeAdorno
Jun 27 2017 19:17
@dsyer I found the solutions :) .. thanks
Bruno Simioni
@brunosimioni
Jun 27 2017 19:25
Guys, I've seen several references inside issues (@github projects - OpenFeign, Spring Cloud, etc) about how to capture fallback exception with Feign client. By using Spring Cloud Services (@PCF), which is the best way to capture an exception from FeignClient (by using Hystrix transparently), inside fallback method?

for instance, considering:

@FeignClient(name="catalog-service", path="/catalog" , fallback = CatalogRepositoryFallback.class)
public interface CatalogRepository {

    @RequestMapping(method = RequestMethod.GET)
    List<Product> getProducts();

    @RequestMapping(path="{id}", method = RequestMethod.GET)
    Product getProduct(@PathVariable("id") int id);

    @Component
    static class CatalogRepositoryFallback implements CatalogRepository {

        @Override
        public List<Product> getProducts() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Product getProduct(int id) {
            // TODO Auto-generated method stub
            return null;
        }
    }
}

Where should I use an Exception handling?

Bruno Simioni
@brunosimioni
Jun 27 2017 19:41
For instance, handling an exception based on HTTP response code or payload.