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

14th
Sep 2016
bitsofinfo
@bitsofinfo
Sep 14 2016 00:30

Another thing I noticed, after adding the following dependencies to my app and with an @EnableBinding(MyConsumerInterface.class) with a consumer @Input declared, now I am seeing an additional fetch from my config-server late in the boot process... why is this? (brixton sr5)

Added:

    compile 'org.springframework.cloud:spring-cloud-stream'
    compile 'org.springframework.cloud:spring-cloud-starter-stream-kafka'

I now get this 2x after the above

[ConfigServicePropertySourceLocator] Fetching config from server at: https://192.168.0.34:8888/
.... bunch of output...
[ConfigServicePropertySourceLocator] Fetching config from server at: https://192.168.0.34:8888/
bitsofinfo
@bitsofinfo
Sep 14 2016 03:11
everything is functioning fine, I just don't understand why it would make multiple requests to the config server
Dave Syer
@dsyer
Sep 14 2016 06:22
That might be a bug. Spring Cloud Stream creates a child application context. But it doesn't need to go to the config server again.
Dennis Melzer
@SirWayne
Sep 14 2016 08:42

Hello i would like to use the @RemoteApplicationEventScan, but if I se this annotation the SubtypeModule will not setup correct.
Question:
Is it possible to seperate the configuration with the annotation and the events in 2 jars? In my scenario 1 jar contains the events and the other jar contains the @RemoteApplicationEventScan, or is this a problem?

After debugging I saw.

The BusJacksonMessageConverter#findSubTypes and the this.mapper.registerModule(new SubtypeModule(findSubTypes())); is executed twice:
First with the Default-Package and the second call with my custom package, but the SubtypeModule#setupModule will not call again with the custom package.

The module is registered twice, but the MapperFeature.IGNORE_DUPLICATE_MODULE_REGISTRATIONS is disable.
Nicolas Lejeune
@lejeunen
Sep 14 2016 09:19
Hello I'm looking for Spring Cloud Netflix 1.1.0 Release notes
Nicolas Lejeune
@lejeunen
Sep 14 2016 09:38
Thanks, I found these by digging around http://cloud.spring.io/spring-cloud-netflix/1.1.x/
Dave Syer
@dsyer
Sep 14 2016 09:58
@SirWayne it sounds like if you found a problem you'd be in a good position to fix it? (I didn't follow entirely what you did and what happened.)
Dennis Melzer
@SirWayne
Sep 14 2016 10:41
@dsyer i'm not sure. The next problem is: I use the RC1 from the http://repo.spring.io/libs-milestone/org/springframework/cloud/spring-cloud-bus/1.2.0.RC1/. There are 2 identical classes BusJacksonAutoConfiguration.class and BusJacksonMessageConverter.class, but on the github source release there is only 1 java file.
Dave Syer
@dsyer
Sep 14 2016 11:04
I guess that's a bug in the jar
Use a snapshot
Dennis Melzer
@SirWayne
Sep 14 2016 11:04
ok I will checkout the master
Dennis Melzer
@SirWayne
Sep 14 2016 13:07
Ok i will create a PR
Dennis Melzer
@SirWayne
Sep 14 2016 13:43
spring-cloud/spring-cloud-bus#41
bitsofinfo
@bitsofinfo
Sep 14 2016 13:47
@dsyer so where should I look to track this down. Its not re-loading the entire app context 2x is it? https://gitter.im/spring-cloud/spring-cloud?at=57d8ecbdcba69fe7350f888a
Dave Syer
@dsyer
Sep 14 2016 14:13
No, like I said, its creation a child context
12010994
@12010994
Sep 14 2016 14:59
Hello! With Spring Cloud Stream, is there a way to remove/pull out some messages that have been previously put into the queue (and still pile up)?
bitsofinfo
@bitsofinfo
Sep 14 2016 19:41

For my @FeignClient config, i have a custom configuration as such:

public Feign.Builder myFeignBuilder() {
          return HystrixFeign.builder()

                  .requestInterceptor(new RequestInterceptor() {

                    @Override
                    public void apply(RequestTemplate template) {
                        System.out.println("invoked")
                    }

                  });
}

When I execute a client bound to this configuration, that RequestInterceptor is not being invoked. Instead

feign.SynchronousMethodHandler.targetRequest is consulting some completely different set of RequestInterceptors.

these ones [org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor@3313002e, org.springframework.cloud.sleuth.instrument.web.client.feign.TraceFeignRequestInterceptor@14944a7b]
bitsofinfo
@bitsofinfo
Sep 14 2016 19:44
hmm, yeah that is what I am doing
Spencer Gibb
@spencergibb
Sep 14 2016 19:44
no need to create a builder for that, just create a bean in a class and add it to @EnableFeignClients.
except requestInterceptors is called later on the builder
bitsofinfo
@bitsofinfo
Sep 14 2016 19:49
a bit confused... I have a @Configuration class, that declares this custom Feign.Builder. The config class is referenced as such @EnableFeignClients(defaultConfiguration=MyFeignClientsConfig.class) (Besides what is pasted above, this configures a custom Apache Client as well, So this is not the way to configure a custom RequestInterceptor? Or you are saying that would be overridden (or IS being overriden) by just another @Bean declared in this feign context config (or in my main spring context config) of type RequestInterceptor
Spencer Gibb
@spencergibb
Sep 14 2016 19:49
just declare the request interceptor as a bean in MyFeignClientsConfig
bitsofinfo
@bitsofinfo
Sep 14 2016 19:50
k, let me give it a shot
so this OAuth2FeignRequestInterceptor I have declared somewhere else (and the sleuth one) must be overriding/replacing what I am declaring in that custom Builder bean method?
Spencer Gibb
@spencergibb
Sep 14 2016 19:52
yes
bitsofinfo
@bitsofinfo
Sep 14 2016 19:53
k, thanks for the help
bitsofinfo
@bitsofinfo
Sep 14 2016 20:13
Ok, that works, however now I've lost that sleuth tracing interceptor....
whoops, no its there
Spencer Gibb
@spencergibb
Sep 14 2016 20:16
What version of sleuth are you using?
bitsofinfo
@bitsofinfo
Sep 14 2016 20:16
ok, so looks like any RequestInterceptor declared anywhere gets aggregated together in a collection and leveraged by SynchronousMethodHandler
whatever is bound to brixton sr5
just want to understand how TraceFeignRequestInterceptor is registered for a better understanding, looking
bitsofinfo
@bitsofinfo
Sep 14 2016 20:27
@spencergibb I am correct in that assumption? (RequestInterceptor declared in root spring context configs, or feign specific client config) get aggregated together for usage in that client.
Spencer Gibb
@spencergibb
Sep 14 2016 20:28
yeah, because when you as the child context (feign specific client config) for all RequestInterceptor classes, it looks in the parent
bitsofinfo
@bitsofinfo
Sep 14 2016 20:28
great, thanks man