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

12th
Oct 2016
姜为
@wmz7year
Oct 12 2016 01:52
Hello does sleuth support kafka?
Marcos Barbero
@marcosbarbero
Oct 12 2016 01:56
@wmz7year this channel will be more helpful for sleuth doubts https://gitter.im/spring-cloud/spring-cloud-sleuth
姜为
@wmz7year
Oct 12 2016 01:59
@marcosbarbero thanks :)
Roy Kachouh
@roykachouh
Oct 12 2016 13:07
good morning all…i have a question regarding refresh scope
I’m wondering if it’s safe to apply the refresh scope to beans that are themselves factories
for example...
@RefreshScope
  public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(QueueConfig queueConfig,
      DnsValidationConfiguration dnsConfig) {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory(queueConfig));
    factory.setMessageConverter(messageConverter());
    factory.setConcurrentConsumers(CORES * 2);
    factory.setConcurrentConsumers(dnsConfig.getQueueConsumers());
    return factory;
}
i’d like to have the concurrent consumers defined in Consul, but I’m wondering what happens to all the objects that get created by the factory…and when we refresh, what happens?
Stephen Gream
@ThreeToes
Oct 12 2016 13:33
So I have eureka in a docker container, looks like my other containers can see it, but I'm having a lot of trouble getting my other services to register with it. I think my config is wrong, what properties in application.yml do I need to set to get it looking in the right place?
Stephen Gream
@ThreeToes
Oct 12 2016 13:48
nevermind, figured it out. eureka.client.service-url.defaultZone is the right key :)
Ryan Baxter
@ryanjbaxter
Oct 12 2016 13:48
Roy Kachouh
@roykachouh
Oct 12 2016 13:51
Hey @spencergibb any idea on the above question regarding RefreshScope, i could try it out…but goot to have an understanding not mentioned in the docs
Dante Sun
@dantesun
Oct 12 2016 13:54
@roykachouh RefreshScope just create another proxy around the original bean, for concret class, by default, it’s a CGLIB proxy. So no problem using this way.
no destory method defined in SimpleRabbitListenerContainerFactory
Roy Kachouh
@roykachouh
Oct 12 2016 13:57
Thanks @dantesun ! so what happens to all the connections that SimpleRabbitListenerContainerFactory created in the mean time?
Dante Sun
@dantesun
Oct 12 2016 13:58
the whole bean method will be executed again after refresh
“rabbitListenerContainerFactory” will be invoked after RefreshScope.refreshAll()
@Configuration
    @EnableConfigurationProperties
    protected static class RefreshScopeTestConfig {

        @RefreshableBean
        public FooProperties fooProperties() {
            return new FooProperties();
        }

        @Bean
        public RefreshScope refreshScope() {
            return new RefreshScope();
        }

        @RefreshableBean
        public Foo foo(FooProperties properties) {
            Foo foo = new Foo();
            foo.setMessage(properties.getMessage());
            return foo;
        }
    }

    @Test
    public void testScope() {
        Properties properties = new Properties();
        properties.put("message", "Hello Foo!");
        properties.put("logging.config", "../config/logback.xml");
        PropertiesPropertySource propertySource = new PropertiesPropertySource("fooProperties", properties);
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.getEnvironment().getPropertySources().addFirst(propertySource);
        context.register(RefreshScopeTestConfig.class);
        context.refresh();

        Foo bean = (Foo) context.getBean("foo");
        System.out.println(bean.getMessage());
        String value = "Hi Foo!";
        properties.put("message", value);
        context.getBean(RefreshScope.class).refreshAll();
        Assert.assertEquals(value, context.getBean(FooProperties.class).getMessage());
        Assert.assertEquals(value, bean.getMessage());
    }
@roykachouh you can try your self
Roy Kachouh
@roykachouh
Oct 12 2016 14:01
Thanks Again @dantesun going to experment more...
Dante Sun
@dantesun
Oct 12 2016 14:01
RefreshableBean is just a composite annotation I created. you can replace it with
@Bean
@RefreshScope
Roy Kachouh
@roykachouh
Oct 12 2016 14:02
Yep, i had plans on creating my own composite annotation similar to that :thumbsup:
Spencer Gibb
@spencergibb
Oct 12 2016 16:31
@/all NOTE: any class that is annotated with @ConfigurationProperties does not need @RefreshScope. If you have a class that uses @RefreshScope just to update some fields with @Value, change it to use a @ConfigurationProperties bean.
Dave Syer
@dsyer
Oct 12 2016 16:53
Up to a point anyway...
...rob harrop has pointed out that config props updates are not atomic without the consumer being in refresh scope
Spencer Gibb
@spencergibb
Oct 12 2016 17:30
Interesting. We should document it. I didn't know that.
Dave Syer
@dsyer
Oct 12 2016 18:42
I've been working up the energy to do that
It needs a bit of thought/analysis still
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:16
Any ideas on what might be causing intermittent 504 timeouts between zuul and an internal service?
Only seeing it happen on saml requests, so they payloads are somewhat large.
We went from working consistently to failing consistently, communication between zuul/saml app is fine for all other requests
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:47
@Fitzoh no changes in the versions of the artifacts you are using?
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:52
negative
We had two instances of the saml app running, one of them stopped responding to saml requests after being up for 4 hours
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:53
stopped responding is different than the request timing out...
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:54
poorly phrased. After 4 hours of uptime, there is no evidence it received a saml request
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:55
meaning you are suspecting that all requests to that instance timed out...
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:55
only saml requests
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:55
sure ok
nothing comes to mind as to why that would suddenly happen
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:56
Yeah, feeling pretty stumped
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:56
so are u seeing the timeouts in zuul?
in the logs?
Andrew Fitzgerald
@fitzoh
Oct 12 2016 20:58
yep
com.netflix.zuul.exception.ZuulException: Forwarding error
Caused by: java.net.SocketTimeoutException: Read timed out
Ryan Baxter
@ryanjbaxter
Oct 12 2016 20:58
k
well wouldnt the request still get to the server eventually?
shouldnt u be seeing the request get to the service but just zuul timing it out
Andrew Fitzgerald
@fitzoh
Oct 12 2016 21:01
Nothing showing up in the logs
Ryan Baxter
@ryanjbaxter
Oct 12 2016 21:01
that makes me think it is a network issue
Andrew Fitzgerald
@fitzoh
Oct 12 2016 21:01
I think we also need to mess with our filter order
none of the saml stuff is getting intercepted by zipkin
and other request logging filters
Ryan Baxter
@ryanjbaxter
Oct 12 2016 21:02
especially if nothing has changed from a code perspective i would be looking into network issues
between zuul and that service