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

8th
Mar 2016
Stevo Slavić
@sslavic
Mar 08 2016 00:02
"This version should be backwards-compatible with v1.4.x. If you find otherwise, please submit a Hystrix issue as it was unintentional."
Spencer Gibb
@spencergibb
Mar 08 2016 00:03
Yup
Stevo Slavić
@sslavic
Mar 08 2016 01:10
in Zuul app, for every service using Ribbon with static list of servers, there will be a service specific RestClient instance with underlying NamedConnectionPool; requests routed to service (by RibbonRoutingFilter) get wrapped in hystrix command (by RestClientRibbonCommandFactory) - correct?
Spencer Gibb
@spencergibb
Mar 08 2016 01:17
yes, I believe you are correct.
Stevo Slavić
@sslavic
Mar 08 2016 01:17
for monitoring, hystrix command metrics can be reported/published, but also NamedConnectionPool has some Servo metrics that could be published
expecting these connection pool metrics will shed more light on issue I'm seeing - ribbon is configured to timeout, requests get sent to underlying service but barely before timeout expires, and even though underlying service is fast to respond, client gets 500 since ribbon timeouts
Stevo Slavić
@sslavic
Mar 08 2016 01:23
requests get queued up somewhere before being sent to service, and I'm not sure yet where or why
Fabian Wallwitz
@cforce
Mar 08 2016 09:14
hi .. i recognize that my cloud app registers in eureka with the default port and then after some time with one i have configured in application.yml.. than i have the service registered in eureka twice with different ports, but only reachable on the configured port ..
any idea what the source of this problems could be? using Brixton M5
there is no need to have the port configured in bootstrap.yml, do i ?
my setup is eureka first bootstrapping
Dave Syer
@dsyer
Mar 08 2016 09:25
Eureka first is the problem
But if you try snapshots you may find it works better
Fabian Wallwitz
@cforce
Mar 08 2016 09:31
is there a old(solved) issue .. couldn't find one..
is it related to spring-cloud/spring-cloud-netflix#815
needs ip-address: ${server.address} .. if you use prefer-ip-address: true
Dave Syer
@dsyer
Mar 08 2016 11:33
It's more related to updates in eureka I think
Things just started working for me when we upgrade a couple of weeks ago
Paul
@asm0dey
Mar 08 2016 14:08
Is anybody interested in annotation processor, which takes interfaces and converts the to other interfaces - one for feign, one (with deferredresults) for mvc?
Fabian Wallwitz
@cforce
Mar 08 2016 14:27
does it solve issues with MVC having the same bean twice if implementing Interfaces of MvcControllers?
Paul
@asm0dey
Mar 08 2016 14:31
Well, actually you implement different interfaces, but guaranteed that they have common contract

i.e. if you have commons interface

interface ClientAPI{
  @RequestMapping(path="/action", method=GET)
  String doAction();
}

than there will be generated 2 interfaces

public interface ClientAPIClient{
  @RequestMapping(path="/action",method=GET)
  String doAction();
}

and

public interface ClientAPIEndpoint{
  @RequestMapping(path="/action",method=GET)
  DeferredResult<String> doAction();
}
Paul
@asm0dey
Mar 08 2016 14:37
note that ClientAPI isn't public. Only generated interfaces are public
David Welch
@dwelch2344
Mar 08 2016 14:39
@asm0dey sounds interesting. github?
Paul
@asm0dey
Mar 08 2016 14:39
Well, actually it's single class, so I can create gist I think
David Welch
@dwelch2344
Mar 08 2016 14:40
nice. Yeah, I'd be interested to see how it works. So, what's the workflow. You run this when you change ClientAPI and it generates a new source file for you?
Fabian Wallwitz
@cforce
Mar 08 2016 14:41
is it a code generator you need to involve at compile time or does it work with proxy bean's detecting the right usage
It works at compile time
Fabian Wallwitz
@cforce
Mar 08 2016 14:42
how do you involve this in your build management?
Paul
@asm0dey
Mar 08 2016 14:44
Well, our workflow is following:
1) we have project,called commons-api
2) When anybody changes (creates new etc…) API interfaces
2.1) project is recompiled (so generated interfaces are being recreated)
2.2) project is being deployed to our local nexus repository
3) all project depend on latest commons-api release version, so they must implement new convention (or their code wont'compile)
@cforce :point_up: March 8, 2016 5:44 PM
of course maven-processor-plugin in connected to commons-api maven build
Fabian Wallwitz
@cforce
Mar 08 2016 14:45
tx for your contribution .. i still hope that there will a lightweight solution (runtime)..
Paul
@asm0dey
Mar 08 2016 14:45
Well, I think that compile-time is more lightweight actually :)
But of course it's not such comfortable
Matt Benson
@mbenson
Mar 08 2016 14:46
@asm0dey I had thought about doing something similar to this.
Fabian Wallwitz
@cforce
Mar 08 2016 14:46
i jsut wanted to post you gist ;)
however this one especially is not for the MVC issues in general..
Matt Benson
@mbenson
Mar 08 2016 14:47
hi @cforce , why? :)
Paul
@asm0dey
Mar 08 2016 14:48
@mbenson great minds do think similar, don't they? ;)
I can create github project and will be glad if somebody will help us to improve it :)
Fabian Wallwitz
@cforce
Mar 08 2016 14:48
i must confess i didn't try, but i dind't read it to solve this issues
i had the issue that Mvc tried to instantiate a bean (because of the @Path anoation on class level implicating a Component/Controller ) with the same bean name .. as the @FeignClient which inhertited it ..
@mbenson does your MagicWrapper solve this too?
workaorund was to move the @Path to the MvcController Impl and replicate the path element in the @FeigbnClient anotation
Matt Benson
@mbenson
Mar 08 2016 14:52
but why do you have the impl and a feign client in the same app? My gist only handles finding the inherited parameter annotations
Fabian Wallwitz
@cforce
Mar 08 2016 14:52
The @FeignClient project does not know the MvcController Impl ..so it does not instantiate the bean twice
Paul
@asm0dey
Mar 08 2016 14:53
https://jira.spring.io/browse/SPR-14021
actually there are some other bugs, linked to annotations in interfaces :)
Matt Benson
@mbenson
Mar 08 2016 14:53
or are you saying you have feign clients enabled in the server app
Fabian Wallwitz
@cforce
Mar 08 2016 14:54
i do have FeignClients in apss also having MvcController's ..why not?
Matt Benson
@mbenson
Mar 08 2016 14:54
@asm0dey that is closed as duplicate of SPR-11055, to which I attached a big patch that so far has gathered little attention
Fabian Wallwitz
@cforce
Mar 08 2016 14:55
is SPR-14021 my issue?
sounds similar .. bit i am not 100% sure
Matt Benson
@mbenson
Mar 08 2016 14:56
@cforce seems that's why it's actually good to use spring-cloud's single-annotation @FeignClient feature... you publish your interface. Your server implements it, but the version of the interface it knows about is not annotated as a feign client. The client project extends the published service interface to mark it @FeignClient, thus no 2-beans-implementing-service in the server project
Fabian Wallwitz
@cforce
Mar 08 2016 15:01
you mean as long Mvc does not find and impl vor the Controller Interface it won't try to instaia
Matt Benson
@mbenson
Mar 08 2016 15:28
I mean the opposite... if there is not a @FeignClient in the server application context (or feign clients are not enabled), there will be no feign client created
Fabian Wallwitz
@cforce
Mar 08 2016 16:05
well that's a contract i can't sign .. i need to have @FeigClient (for api calls to remote miorservices) in my micorservices which itself provides endpoints
you created an issue at Mvc/Boot project as far as i remember, can you remember the url?
Matt Benson
@mbenson
Mar 08 2016 16:10
the issue I created won't help you. I still think there is a communication gap here. You have service interface A annotated @FeignClient. You have a server project that implements A. It may also call service B using a local @FeignClient. You have a client project that consumes A. Your problem is that @FeignClient A and AImpl are both detected as beans in your server project because it has @EnableFeignClients in order to make calls on service B. Correct?
(technically I didn't create that issue, either; I just submitted a PR for it)
Stevo Slavić
@sslavic
Mar 08 2016 16:30
are there plans to switch to ribbon-rxnetty?
Fabian Wallwitz
@cforce
Mar 08 2016 16:31
nope .. not in my server project .. in my client project (which does not has AImpl in classpath) . The @FeignClient is not directly at A, its in C which inherits from A. A does have a @Requestmapping anotation (which is the problem for the proxy with same name as FeignClient Proxy ) . Spring creates a dynamic proxy for A (without having a impl) and also creates a proxy for the @FeignClient with the same name (for interface is falls back somehow to the base interface ).
If i move the @RequestMapping from a to AImpl it works..but of course i have to configure my @FeignClient with the path from @RequestMapping again ..
Matt Benson
@mbenson
Mar 08 2016 16:34
okay, I haven't seen this problem with the dynamic proxy. Do you have a Scope annotation on the interface? Can you create a sample project that demonstrates the problem?
Fabian Wallwitz
@cforce
Mar 08 2016 16:36
Btw .. i have a very similar issue with that dynamic proxy for the fallback used in the @FeignClient. The AFallbaclClass implements @FeignClient A.. and now i have a dynmiac proxy bean with the same name for FallbackClass (because its implements A)..i really wonder if anyone tried the example from documentation
the example btw is missing an @Component anotation on the Fallbacl class, else i get an error that the fallback bean is not found..
Matt Benson
@mbenson
Mar 08 2016 16:37
I don't know what you mean about fallback. A sample project would probably be best to demonstrate your issues.
Fabian Wallwitz
@cforce
Mar 08 2016 16:37
maybe it would work with Qualifiers..had not time to dig into this deeper
oh .. FallBack is a standard feature of the @FeignCLient anotation .. see "Feign HystrixFallbacks" in http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html
the example is incomplete and i didn't get it working..
well maybe it only works with static inner classes
Fabian Wallwitz
@cforce
Mar 08 2016 16:59
i don#t had a Scope anotation on my interface as i remember
Paul
@asm0dey
Mar 08 2016 17:46
Guys, sounds like my double-interfaced solution is enough for you — no duplicate interface implementations, single contract, you can set up any annotation anywhere… And also you get DeferredResult bonuses :)
Matt Benson
@mbenson
Mar 08 2016 17:48
the DeferredResult part is the most interesting to me
TBH
and similar
Paul
@asm0dey
Mar 08 2016 17:51
Well, to be honest my generator is pretty simple, but there is one caveat about DeferredResult: sometimes you just do not need it. Sometimes you just do not perform blocking operations in controller. So we need at least one more annotation: @DoNotDeferor smth like that, for processor to not generate DeferredResult return type
Matt Benson
@mbenson
Mar 08 2016 18:20
@spencergibb I did go ahead and update #841 for Feign 8.15.0
Spencer Gibb
@spencergibb
Mar 08 2016 18:21
I saw. Was going to look at it shortly.