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

7th
Mar 2016
Fabian Wallwitz
@cforce
Mar 07 2016 09:01
--> v1.1.0.RC1 ;)
Stevo Slavić
@sslavic
Mar 07 2016 12:49
in zuul proxy spring cloud app I get HystrixMetricsPoller very often logging on info level that it's starting/stopping
is it misuse on spring cloud side of the HystrixMetricsPoller APIs (so can something be fixed in spring-cloud-netflix side), or should I file a improvement request to netflix guys to consider using debug level there?
it's same for HystrixMetricsStreamServlet
Guillaume Larose
@theonlyguills
Mar 07 2016 14:32
Hi! I know this isn't spring cloud code per se, but I figured maybe someone has encountered this while playing with sleuth and zipkin web... I can't find a way to pass a context-root to zipkin-web for the query url. It'll only take hostname and port but we're stuck with context-roots here.
I looked at the code a bit but unfortunately scala networking with twitter libs isn't my cup of tea.
Marcin Grzejszczak
@marcingrzejszczak
Mar 07 2016 14:34
hi!
Sleuth questions can be asked in #spring-cloud-sleuth channel
you're more than welcome to join :)
Stevo Slavić
@sslavic
Mar 07 2016 14:35
is there one for zuul/netflix?
Marcin Grzejszczak
@marcingrzejszczak
Mar 07 2016 14:36
for zuul and netflix this is the place
I mean for spring cloud
Guillaume Larose
@theonlyguills
Mar 07 2016 14:36
ok sorry @marcingrzejszczak :) I'll ask there
Marcin Grzejszczak
@marcingrzejszczak
Mar 07 2016 14:36
cause if the question is specifically related to Netlifx stuff - you'd have to ask the Netflix guys
np @theonlyguills - see you there :)
Stevo Slavić
@sslavic
Mar 07 2016 14:40
any thoughts on hystrix metrics logging starting/stopping frequently?
logging on info level that poller is started, for each and every request ...
seems like netflix issue, needs lowering to debug level
Marcin Grzejszczak
@marcingrzejszczak
Mar 07 2016 14:42
yeah - it seems so
for now you can explicitly set the ERROR level there
and you'll ignore logs from that servlet
there means via logging configuration
Stevo Slavić
@sslavic
Mar 07 2016 14:43
true, could set logging level for com.netflix.hystrix.contrib.metrics.eventstream to warning or error
both poller and servlet would be affected
Marcin Grzejszczak
@marcingrzejszczak
Mar 07 2016 14:44
you can set it for that class only
Stevo Slavić
@sslavic
Mar 07 2016 14:44
I want both off, info is too much noise for them
Matt Benson
@mbenson
Mar 07 2016 15:26
@dwelch2344 you should be able to do Spring JUnit/ @IntegrationTest -ing of spring-cloud Feign clients without needing direct access to the FeignClientFactoryBean
pradeepkusingh
@pradeepkusingh
Mar 07 2016 15:33
@spencergibb : is hystrix fall back option is available in zuul for multiple services ?
Spencer Gibb
@spencergibb
Mar 07 2016 16:08
No
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:04
hey guys
I was debugging the behaviour of feign with ribbon load balancer and I found something that I cannot really understand
the ConnectTimeout and the ReadTimeout properties declared on a properties file for a given client are discarded because for every request, a FeignOptionsClientConfig instance is passed
LoadBalancerFeignClient line 54
    public Response execute(Request request, Request.Options options) throws IOException {
        try {
            URI asUri = URI.create(request.url());
            String clientName = asUri.getHost();
            URI uriWithoutHost = cleanUrl(request.url(), clientName);
            FeignLoadBalancer.RibbonRequest ribbonRequest = new FeignLoadBalancer.RibbonRequest(
                    this.delegate, request, uriWithoutHost);
            return lbClient(clientName).executeWithLoadBalancer(ribbonRequest,
                    new FeignOptionsClientConfig(options)).toResponse();
        }
        catch (ClientException e) {
            if (e.getCause() instanceof IOException) {
                throw IOException.class.cast(e.getCause());
            }
            throw new RuntimeException(e);
        }
    }
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:17
@spencergibb probably this one is for you
Spencer Gibb
@spencergibb
Mar 07 2016 18:21
You can create a bean of feign.Request.Options to set them
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:29
set the bean where? per client? per method?
shouldn’t the global configuration be used if we don’t have any bean?
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:31
I mean.. the ribbon configuration
Spencer Gibb
@spencergibb
Mar 07 2016 18:32
@pmvilaca probably, this is leftover from how feign initially did it’s ribbon integration
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:32
because this way, it’s the server that is responsible for defining the timeouts
that can be something that not everyone wants, if the Interface is used by multiple services
Spencer Gibb
@spencergibb
Mar 07 2016 18:33
I don’t understand. What server?
There is an open issue spring-cloud/spring-cloud-netflix#696
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:33
if the interface with the Feign annotations is provided by the server
the client cannot configure the timeouts
Spencer Gibb
@spencergibb
Mar 07 2016 18:34
Another reason not to do that.
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:34
it’ll be forced to re-write the interface on its side
Spencer Gibb
@spencergibb
Mar 07 2016 18:34
I don’t advocate that pattern.
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:34
to rely on the interface that is provided by the server?
Spencer Gibb
@spencergibb
Mar 07 2016 18:34
Mixing the server side and client side
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:34
I’m not mentioning the use case where the interface is shared by the server/client
Spencer Gibb
@spencergibb
Mar 07 2016 18:35
Then I don’t undestand.
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:35
I’m just talking about the use-case where the interface to communicate with the server is provided by the server itself
like self-documenting by providing an interface
that will let the client get the new methods that were implemented when upgrading to a new version
Spencer Gibb
@spencergibb
Mar 07 2016 18:36
There’s an open issue I shared above, pull requests are welcome.
Pedro Vilaça
@pmvilaca
Mar 07 2016 18:38
will take a look @spencergibb
thanks
Spencer Gibb
@spencergibb
Mar 07 2016 18:39
NP
Sorry if I wasn
wasn’t understanding. You mean the server provides a jar with the interface.
Matt Benson
@mbenson
Mar 07 2016 18:40
@spencergibb WDYT about spring-cloud 1.1.0 requiring Feign 8.15, to rework spring-cloud/spring-cloud-netflix#841 ? Also @dsyer
Spencer Gibb
@spencergibb
Mar 07 2016 18:41
already started that today
Matt Benson
@mbenson
Mar 07 2016 18:41
oh, great :)
Spencer Gibb
@spencergibb
Mar 07 2016 18:41
just working on something else at the moment
Matt Benson
@mbenson
Mar 07 2016 18:41
sure, let me know if you need anything
pradeepkusingh
@pradeepkusingh
Mar 07 2016 20:12
@spencergibb : Thanks Spencer, I think there was a Enhancement request was opened and you showed me ..I lost that link.
Pedro Vilaça
@pmvilaca
Mar 07 2016 20:19
Pedro Vilaça
@pmvilaca
Mar 07 2016 20:34
@spencergibb :
wasn’t understanding. You mean the server provides a jar with the interface
Exactly
No problem!
Spencer Gibb
@spencergibb
Mar 07 2016 21:35
@mbenson spring-cloud/spring-cloud-netflix#880 is done, feign is now 8.15.0 on master.
Matt Benson
@mbenson
Mar 07 2016 21:40
@spencergibb okay, but are you also going to take advantage of the indexToExpanderso that a user can customize the parameter expansion?
Spencer Gibb
@spencergibb
Mar 07 2016 21:40
I haven’t yet. I just upgraded the version.
Matt Benson
@mbenson
Mar 07 2016 21:41
k
Marcos Barbero
@marcosbarbero
Mar 07 2016 21:58

@spencergibb I’m playing with spring-cloud-config-monitor, I found your blog post here http://spencer.gibb.us/blog/2015/09/24/spring-cloud-config-push-notifications/ but I’m missing something.
The configserver is working fine, if I do update de configserver.yml from my github repository it just trigger and refresh my configserver properties. By the other hand, when I do update any other yml file it doesn’t work and it’s just acting strange.
E.g: When I do update my gateway.yml the webhook triggers configserver/monitor endpoint but when I look through the logs it has the following log lines:

2016-03-07 18:51:27.656  INFO 7991 --- [XNIO-3 task-16] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/tmp/config-repo-3042254121045833031/configserver.yml
2016-03-07 18:51:27.656  INFO 7991 --- [XNIO-3 task-16] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/tmp/config-repo-3042254121045833031/application.yml

I’m using Brixton.M5 on configserver, server and client has spring-cloud-bus dependency, only the configserver has the monitor dependency. Am I missing something?

Spencer Gibb
@spencergibb
Mar 07 2016 22:00
not sure, what message broker are you using? rabbit, redis or kafka?
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:00
rabbit
Spencer Gibb
@spencergibb
Mar 07 2016 22:00
Does manually running a refresh work (ie post to /bus/refresh)?
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:05
yes, it does
Spencer Gibb
@spencergibb
Mar 07 2016 22:06
Does manually hitting the monitor endpoint work? http --form POST :8888/monitor path=gateway(or whatever the curl equivalent is).
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:06

When I manually post to /bus/refresh the configserver just logs out:

2016-03-07 19:05:11.248  INFO 7991 --- [XNIO-3 task-9] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/tmp/config-repo-3783584979545919066/gateway.yml
2016-03-07 19:05:11.249  INFO 7991 --- [XNIO-3 task-9] o.s.c.c.s.e.NativeEnvironmentRepository  : Adding property source: file:/tmp/config-repo-3783584979545919066/application.yml

as expected

I’ll check that
I just run /monitor endpoint from curl and it also loads the configserver.yml file
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:13
curl -X POST http://localhost:8888/monitor\?path\=gateway -H "Content-Type: application/x-www-form-urlencoded"
The response was:
[ "gateway" ]
Spencer Gibb
@spencergibb
Mar 07 2016 22:13
what does it log in the gateway application?
You should see something like
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:15
When I post to /bus/refresh it does log that, when I manually run the /monitor it doesn't
Spencer Gibb
@spencergibb
Mar 07 2016 22:15
2015-09-24 12:15:54.257  INFO 11202 --- [enerContainer-2] o.s.cloud.bus.event.RefreshListener      : Received remote refresh request. Keys refreshed [info.description]
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:15
hehehe our messages got inverted right now
Spencer Gibb
@spencergibb
Mar 07 2016 22:16
I don’t know. If you can create a project to share that recreates the problem, file an issue.
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:16
Sure, I’ll do that
@spencergibb The config clients also has to be using Brixton.M5 release? Or it should work with Angel.SR6?
Spencer Gibb
@spencergibb
Mar 07 2016 22:19
no, it won't
The bus changed significantly in Brixton.
They both need to be Brixton.
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:20
I see, that might be the problem… I just found out the gateway app is using Angel.SR6, I’ll upgrade it to Brixton and make some tests
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:26
That’s it, after upgrading to Brixton everything is working fine. I'm sorry for a lot of noise :smile: and thanks so much.
Spencer Gibb
@spencergibb
Mar 07 2016 22:26
NP! Glad to be of help
The queues/topics/exchanges all changed when we moved to spring-cloud-stream as the underlying implementation for bus. Hopefully Camden bus works with Brixton without a hitch.
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:29
That’s good to know.
I'm looking forward for Brixton release! :D
Spencer Gibb
@spencergibb
Mar 07 2016 22:29
RC1 soon (next week-ish)
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:29
:clap: :clap:
Spencer Gibb
@spencergibb
Mar 07 2016 22:30
We’re dependent on the Spring Cloud Stream RC1. Subsequent releases we won’t have to wait.
Marcos Barbero
@marcosbarbero
Mar 07 2016 22:31
What great news!
Fabian Wallwitz
@cforce
Mar 07 2016 23:13
yeha
Fabian Wallwitz
@cforce
Mar 07 2016 23:21
is there a chat for Spring Cloud Data Flow ?
fomerly known as XD
Tiarê Balbi
@tiarebalbi
Mar 07 2016 23:21
no
Fabian Wallwitz
@cforce
Mar 07 2016 23:22
yes, saw that. pretty much less than the code
David Welch
@dwelch2344
Mar 07 2016 23:24
@mbenson Indeed we can. But we're writing a Feign-based library for hitting Stripe.com's API (garbage java SDK) and were hoping to create the Feign client similar to how SpringCloud does it. We ended up distilling what that factory does via the following:
public StripeService(String secretKey, ObjectFactory<HttpMessageConverters> converters){
        Feign.Builder builder = Feign.builder()
                .logger(new Slf4jLogger(StripeService.class))
                .logLevel(Logger.Level.FULL)
                .encoder(new SpringEncoder(converters))
                .decoder(new SpringDecoder(converters))
                .requestInterceptor(rt -> rt.header("Authorization", "Bearer " + secretKey))
                .contract(new SpringMvcContract());
        this.feign = builder.target(StripeFeign.class, "https://api.stripe.com/v1");
    }