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

9th
Mar 2016
Stevo Slavić
@sslavic
Mar 09 2016 08:20
are there plans in spring-cloud-netflix to switch from ribbon-httpclient to ribbon-rxnetty?
Stevo Slavić
@sslavic
Mar 09 2016 09:17
found closed but related issue spring-cloud/spring-cloud-netflix#499
Spencer Gibb
@spencergibb
Mar 09 2016 12:38
Not currently
Stevo Slavić
@sslavic
Mar 09 2016 13:57
thought ribbon-rxnetty 1.x was available
but it's actually ribbon-transport and only available in 2.x
Stevo Slavić
@sslavic
Mar 09 2016 14:07
asking because I still have classpath issue with jersey stuff, would prefer of getting rid of the jersey entirely
why is spring-cloud-netflix bom pom forcing jersey 1.19 while netflix components like ribbon are depending on 1.11 ?
Stevo Slavić
@sslavic
Mar 09 2016 14:50
managed to fix issue, transitive dependency, javax.ws.rs-api 2.0.1 was on classpath, and it's conflicting with jersey 1.x
Matt Benson
@mbenson
Mar 09 2016 15:56
@sslavic : note that Eureka has a hard dependency on jersey v1x
it even bleeds across different Eureka modules so it would be extremely hard to escape
Stevo Slavić
@sslavic
Mar 09 2016 15:58
noticed, thanks anyway, not using service discovery/eureka yet, more likely to use zookeeper, but do not like that it's external to cloud project
Matt Benson
@mbenson
Mar 09 2016 15:59
I'm sorry to say that when my group eval'd ZK we found it felt a little slapdash
David Welch
@dwelch2344
Mar 09 2016 15:59
Consul is an awesome for service discovery :)
Matt Benson
@mbenson
Mar 09 2016 16:00
@dwelch2344 we were working with Consul as well but my teammate who was working on bringing up the cluster ran immediately into some issue that prevented it from starting in a clustered scenario. I believe it was something that had been reported and wasn't just his error :/
Stevo Slavić
@sslavic
Mar 09 2016 16:02
small team, and we already have ZK in the infra zoo
and it's not easy to remove it, some other infra components require and only support ZK
if there was like a generic API for coordination...
maybe idea for a spring project, abstraction/gluing coordination
Spencer Gibb
@spencergibb
Mar 09 2016 16:18
spring cloud cluster has distributed locks and leader selection abstractions
Stevo Slavić
@sslavic
Mar 09 2016 16:19
ah nice, wasn't aware, thanks for sharing
could you imagine something like Apache Kafka switching to use it?
storing metadata/configuration, distributed locking, and leader election
Dave Syer
@dsyer
Mar 09 2016 16:22
That might fit
I think the spring cloud stream guys have a k-v store for Spring Data based on Kafka consolidated topics
Kafka already uses ZK of course
so you are just moving the interface in some ways
David Welch
@dwelch2344
Mar 09 2016 16:24
@mbenson interesting, as we're still figuring out cluster election on our end. If we can crack that nut though, we'll be super happy with what it's ended up as
Matt Benson
@mbenson
Mar 09 2016 16:24
@dsyer thoughts on the latest cut of spring-cloud/spring-cloud-netflix#841 ?
Dave Syer
@dsyer
Mar 09 2016 16:25
@spencergibb probably has more of an opinion
Matt Benson
@mbenson
Mar 09 2016 16:25
he said he was satisfied if you were ;)
Spencer Gibb
@spencergibb
Mar 09 2016 16:25
Yup
Dave Syer
@dsyer
Mar 09 2016 16:26
I would say it should only apply a converter if the parameter is annotated
What's a typical use case?
Spencer Gibb
@spencergibb
Mar 09 2016 16:26
@dwelch2344 I have a POC leader election impl with Consul
Dave Syer
@dsyer
Mar 09 2016 16:26
Surely we already have support for @RequestBody?
(with HttpMessageConverters)
So this is for @ModelAttribute (effectively)?
What is the server-side equivalent?
Matt Benson
@mbenson
Mar 09 2016 16:32
@dsyer : my IDE is freezing up and I was trying to refer to the code while discussing. Not sure how to answer, TBH. You're making calls against a Feign client using, potentially, arbitrary Java types as arguments. My use-case includes enum and java.time.LocalDate. The Expander API extracts a String representation of a parameter in order to insert it into the REST request URI.
Dave Syer
@dsyer
Mar 09 2016 16:33
How does it know how to insert it into the URI?
Matt Benson
@mbenson
Mar 09 2016 16:33
That would be based on the interpretation of the annotations by the Contract.
Dave Syer
@dsyer
Mar 09 2016 16:34
I need an example
Matt Benson
@mbenson
Mar 09 2016 16:36
there is FeignClientTests#testConvertingExpander() at https://github.com/spring-cloud/spring-cloud-netflix/pull/841/files
firstly. The interface method accepts an enum type as a parameter. Enabling a Spring conversion-based Param.Expander allows this to "just work" without having to modify the SpringMvcContract to handle some form equivalent to Feign's @Param#expander().
this is bridging the gap between the Java API and the REST call on the client side
Dave Syer
@dsyer
Mar 09 2016 16:40
That's an Arg parameter annotated with @RequestParam
Matt Benson
@mbenson
Mar 09 2016 16:41
yes
Dave Syer
@dsyer
Mar 09 2016 16:41
That's easy. So it works with any of the existing annotations that refer to URI placeholders or query params?
Matt Benson
@mbenson
Mar 09 2016 16:42
the change is enabled for any item for which annotations have been detected:
if (isHttpAnnotation ...)
Dave Syer
@dsyer
Mar 09 2016 16:43
I see
Where does the ConversionService come from?
Matt Benson
@mbenson
Mar 09 2016 16:45
Actually, that's missing. My intent was to modify the FeignClientsConfiguration to pass in an instance autowired from the ApplicationContext. Does that seem appropriate?
Dave Syer
@dsyer
Mar 09 2016 16:46
It's a start
Matt Benson
@mbenson
Mar 09 2016 16:46
:)
Dave Syer
@dsyer
Mar 09 2016 16:46
The problem is that there can be many ConversionServices in the context
There is a default one
Matt Benson
@mbenson
Mar 09 2016 16:46
that's why I asked.
Dave Syer
@dsyer
Mar 09 2016 16:46
but generally Spring MVC has its own
and Spring Integration has one too
So we'll need to do some research to figure out how to default it sensibly and allow users to change it if necessary
Matt Benson
@mbenson
Mar 09 2016 16:48
it's not clear to me that an app which is both a Spring MVC application as well as a Feign client would use the same ConversionService for both purposes, and your comment would seem to agree. And I agree with what you said there; just not sure how to implement.
My assumption is that just autowiring any ConversionService is going to get the default one, and since you said that would be a start I will go ahead and update the PR in this manner.
Dave Syer
@dsyer
Mar 09 2016 16:49
It's dangerous to autowire it by type I think
Look at how Spring MVC handles it
Probably lookup by name and then a configurer interface to customize it
Matt Benson
@mbenson
Mar 09 2016 16:50
I'll see if I can find it :P
Matt Benson
@mbenson
Mar 09 2016 17:03
AFAICT the basic strategy of Spring WebMVC is to create its own FormattingConversionService which is indeed modified using WebMvcConfigurers, but those actually use the FormatterRegistry interface to modify the aforementioned FCS. I suppose it would be possible to mimic this format but it's not clear to me how to properly inject the default ConversionService for use as a default, I suppose in the absence of any WebMvcConfigurer analogues?
Matt Benson
@mbenson
Mar 09 2016 17:09
Might be easier to just use a FormattingConversionService as does Spring MVC and have done with it.
Matt Benson
@mbenson
Mar 09 2016 17:47
updated
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:12
@dsyer : HI Dave, I am trying to put session replication in my microservices using redis, I have created "session-replication" redis and binded this service in cloud foundry to app .. I don't see session is getting persist, can you please provide any working sample ?
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:17
@spencergibb , Thanks I tried this option and was getting "KEYSPACE " issue
Spencer Gibb
@spencergibb
Mar 09 2016 18:17
spring-session isn’t a spring-cloud project btw
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:18
Unable to configure Redis to keyspace notifications.
ok
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:23
do we have any cloud foundry room ?
Spencer Gibb
@spencergibb
Mar 09 2016 18:23
on gitter? I don’t know.
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:24
:) Ok , Actually PCF docs says just bind apps to redis named as session-replication and it should take care of session replication across the PCF instance .. but we don't see same
pradeepkusingh
@pradeepkusingh
Mar 09 2016 18:34
Thanks @spencergibb , as always you are very helpful
David Welch
@dwelch2344
Mar 09 2016 21:04
@spencergibb and co: just had a very insightful conversation on the #spring-boot channel about duplicated log entries for startup stats when using Spring Cloud.
tracked the issue down and think it's a pretty easy fix actually. spring-cloud/spring-cloud-commons#100
Spencer Gibb
@spencergibb
Mar 09 2016 21:05
cool, simple fix. I’ve noticed it before, but never thought about it.
it was my guess that it had to do with bootstrap