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

18th
Aug 2016
bitsofinfo
@bitsofinfo
Aug 18 2016 01:11
@spencergibb so.. well no matter what I have configured as mentioned above via WebMvcConfigurerAdapter with extendMessageConverters specifying my own deserializers. they never get invoked. Looks like the TraceFeignDecoder created in TraceFeignClientAutoConfiguration is not working with the same set of HttpMessageConverters that I am mutating in the adapter so mentioned.
mittyok
@mittyok
Aug 18 2016 03:48
what's the best practive for transaction in Microservices
?
Ali Moghadam
@alighm
Aug 18 2016 04:22
@mittyok take a business use case that can live independently, in which can serve a purpose, and have it transition over into your first service.
Remember that your Microservice is really nothing but the same loose couple layers we have in Spring, but focusing on 1 business problem and doing it right.
have your service expose Restful APIs for interaction
and that would be a nice transition into Microservices for you. (My 2 cents)
mittyok
@mittyok
Aug 18 2016 07:21
@alighm OK, thank you !
Daniel Lavoie
@daniellavoie
Aug 18 2016 11:45
Afffff, Just found something interesting, I am going to need your input on that one ! It appears that the eureka client won't update his port number when server.port=0 if you ever use the EurekaClient.getNextServerFromEureka(...) BEFORE the EmbeddedServletContainerInitializedEvent has properly updated the port number. I suppose that this is a edgy use case but it was a hard investigation. Symptoms where that the eureka instance stayed registered on port 0 within Eureka. I can try to fix that bug. Any though on this ?
Dave Syer
@dsyer
Aug 18 2016 11:46
It's probably a big waste of time trying to work around it
There are many race conditions and lifecycle issues with eureka client
We do our best to work around them by making things lazy where possible
But if you go and call a method early in the lifecycle you will screw all that up
The problem is really that eureka is not designed for dependency injection.
So there are heavyweight initializers in constructors and class initializers.
You might be able to call /refresh to reset it
So you could try doing that in a command line runner or something
Daniel Lavoie
@daniellavoie
Aug 18 2016 11:49
I understand. Well, I won't lose my time and bootstrap my initialization business on an InstanceRegisteredEvent.
Dave Syer
@dsyer
Aug 18 2016 11:49
But the data in the early call will be bogus anyway
Daniel Lavoie
@daniellavoie
Aug 18 2016 11:49
Thank you for your precious input ;)
Dave Syer
@dsyer
Aug 18 2016 11:50
If you want to see how big a mess it is look at EurekaClientAutoConfiguration
Daniel Lavoie
@daniellavoie
Aug 18 2016 11:50
It all starts with a @AutoConfigureBefore :)
Usually a good indicator ;)
You discouraged me to try to touch anything in that class
Got any news on Eureka 2 ? I don't see any commit since January on netflix' 2.x branch
Dave Syer
@dsyer
Aug 18 2016 11:54
I don't think it has a high priority at Neflix
They decided they didn't really need it
Stephan L
@stephlag
Aug 18 2016 13:02
Hi @spencergibb
I've updated the #1221 spring-cloud/spring-cloud-netflix#1221
Daniel Lavoie
@daniellavoie
Aug 18 2016 13:09
Hello @stephlag I think it might be a good idea to squash your commits with a soft reset + force push. Your PR has reached 12 commits.
Stephan L
@stephlag
Aug 18 2016 13:10
If I'm not mistaken it will be reduced as 1 commit once merged
This is what happened yesterday when it was one merged
Daniel Lavoie
@daniellavoie
Aug 18 2016 13:11
Ah ! Ok, my bad. Good to know ;)
Stephan L
@stephlag
Aug 18 2016 13:11
before being reverted when the compatibility issue was discovered
spring-cloud/spring-cloud-netflix@21df6e4
bitsofinfo
@bitsofinfo
Aug 18 2016 18:37
I have a @FeignClient that invokes a rest service that can return a 201, 409 or 500x . I only want the fallback invoked on a 500 error, but its still getting invoked on a 409. How can I do this?
looks like its hardcoded that it will only attempt to decode the response on 200-300 or 404. Anything else goes to the ErrorDecoder and even with that implemented the fallback still gets invoked, yet I don't have access to the "reason" in the fallback.
Spencer Gibb
@spencergibb
Aug 18 2016 19:12
that’s a pure feign question @bitsofinfo
bitsofinfo
@bitsofinfo
Aug 18 2016 19:12
not following what you mean
Spencer Gibb
@spencergibb
Aug 18 2016 19:13
it’s part of upstream feigns design
bitsofinfo
@bitsofinfo
Aug 18 2016 19:13
i.e. ask on the feign channel?
k
Spencer Gibb
@spencergibb
Aug 18 2016 19:13
yeah, we can keep having the discussion there :-)