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

7th
Jan 2019
@tul
@atulmundaware
Jan 07 06:50
hi guys can any one suggest good micro services development tutorials link which will support 2.1.1
i had done it in 1.5
Gilles Robert
@ask4gilles
Jan 07 11:26
Hi,
I'm using spring cloud config server and I was wondering if changing the value of spring.jpa.properties.hibernate.generate_statistics=true/false can be done at runtime without a restart? (apparently not...)
Spencer Gibb
@spencergibb
Jan 07 12:39
@jkubrynski the factory is useful if the filter can be applied to different routes with different configuration.
@ask4gilles hibernate would have to respond to a change either programatically or via @RefreshScope
Gilles Robert
@ask4gilles
Jan 07 12:43
@spencergibb I do see that JpaProperties are refreshed but not taken into account.
Here is my config, but I guess this property is tight to the hibernate session factory which is not refreshed... ?
@Bean
  public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
                                                                     JpaProperties jpaProperties) {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    factoryBean.setDataSource(dataSource);
    factoryBean.setPackagesToScan("x.y.z");
    factoryBean.setJpaVendorAdapter(vendorAdapter);
    factoryBean.setJpaPropertyMap(jpaProperties.getProperties());

    return factoryBean;
  }

and adding @RefreshScope on that bean breaks this one:

 @Bean
  public PlatformTransactionManager transactionManager(LocalContainerEntityManagerFactoryBean entityManagerFactory) {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory.getObject());

    return transactionManager;
  }

(does not find the entityManagerFactory bean anymore)

Jakub Kubryński
@jkubrynski
Jan 07 12:51
thanks @spencergibb - makes sense :)
Hugh Hamill
@hughwphamill
Jan 07 14:17
@spencergibb did you get a chance to see my question above, re: microservice cross linking at the gateway layer?
Spencer Gibb
@spencergibb
Jan 07 16:13
There isn't support for that
Hugh Hamill
@hughwphamill
Jan 07 16:31
Do you think there might be any plans in the future? It seems like a really unfortunate disconnect between the gateway and spring-hateoas
Spencer Gibb
@spencergibb
Jan 07 16:53
no one has requested it yet. Any time you modify bodies in a gateway it then becomes memory constrained