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

15th
Nov 2016
Fabian Wallwitz
@cforce
Nov 15 2016 11:59
hi
i recognize that @Value anotated member variabkles are set if a refresh event is trgge
triggered..
as i have currently @Postconstruct that does things based on that data, that should be done also on a cfg base chnanfre (cfg refresh event), the question is how i can intercept that.. because the @Postconstruct is only called on time at app start ..
..but i need that to be called on any update at the @Value anotated members in my class
Dave Syer
@dsyer
Nov 15 2016 12:27
@Value is not refreshed
You would need to use @RefreshScope
at which point the @PostConstruct would also be called
(the first time a method is called)
Fabian Wallwitz
@cforce
Nov 15 2016 12:44
but it happens
strange
Fabian Wallwitz
@cforce
Nov 15 2016 13:22
ich you check my stacktrace, you can see that referesh is triggered .. i i have NO @RerfreshScope at the @Value member
   ServiceModelTcu.setTcu(String) line: 74    
GeneratedMethodAccessor340.invoke(Object, Object[]) line: not available    
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available    
Method.invoke(Object, Object...) line: not available    
BeanWrapperImpl$BeanPropertyHandler.setValue(Object, Object) line: 345    
BeanWrapperImpl(AbstractNestablePropertyAccessor).setPropertyValue(AbstractNestablePropertyAccessor$PropertyTokenHolder, PropertyValue) line: 454    
RelaxedDataBinder$RelaxedBeanWrapper(AbstractNestablePropertyAccessor).setPropertyValue(PropertyValue) line: 280    
RelaxedDataBinder$RelaxedBeanWrapper.setPropertyValue(PropertyValue) line: 700    
RelaxedDataBinder$RelaxedBeanWrapper(AbstractPropertyAccessor).setPropertyValues(PropertyValues, boolean, boolean) line: 95    
RelaxedDataBinder(DataBinder).applyPropertyValues(MutablePropertyValues) line: 834    
RelaxedDataBinder(DataBinder).doBind(MutablePropertyValues) line: 730    
RelaxedDataBinder.doBind(MutablePropertyValues) line: 128    
RelaxedDataBinder(DataBinder).bind(PropertyValues) line: 715    
PropertiesConfigurationFactory<T>.doBindPropertiesToTarget() line: 270    
PropertiesConfigurationFactory<T>.bindPropertiesToTarget() line: 241    
ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(Object, String, ConfigurationProperties) line: 334    
ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(Object, String) line: 289    
ConfigurationPropertiesRebinder.rebind(String) line: 100    
ConfigurationPropertiesRebinder.rebind() line: 88    
ConfigurationPropertiesRebinder.onApplicationEvent(EnvironmentChangeEvent) line: 120    
ConfigurationPropertiesRebinder.onApplicationEvent(ApplicationEvent) line: 49    
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener, ApplicationEvent) line: 166    
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 138    
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).publishEvent(Object, ResolvableType) line: 381    
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 335    
ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a92f3cf3(ConfigurationPropertiesRebinderAutoConfiguration).afterSingletonsInstantiated() line: 79    
DefaultListableBeanFactory.preInstantiateSingletons() line: 798    
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).finishBeanFactoryInitialization(ConfigurableListableBeanFactory) line: 839    
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).refresh() line: 538    
AnnotationConfigEmbeddedWebApplicationContext(EmbeddedWebApplicationContext).refresh() line: 118    
SpringApplication.refresh(ApplicationContext) line: 760    
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 360    
SpringApplication.run(String...) line: 306    
DaivbSpringApplication.run(Object[], String...) line: 65    
DaivbSpringApplication.run(Object, String...) line: 35    
MetaInfoServiceApplication.main(String[]) line: 20    
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]    
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available    
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available    
Method.invoke(Object, Object...) line: not available    
RestartLauncher.run() line: 49    
i put the @PostConconstruct into the same method as the @Configuration Class .. so the refresh hopefully also triggers this @PostConconstruct .. anyway its still questionable why the refresh is called after the app start
pradeepkusingh
@pradeepkusingh
Nov 15 2016 17:44
@spencergibb Thanks
Robert Van Voorhees
@voor
Nov 15 2016 20:19
Hmm, getting an error message of No .git directory at file://opt/config except ls -la inside /opt/config reveals: -rw-r--r-- 1 1000 1000 51 Nov 15 15:18 .git -- anyone know if the .git directory needs to be not just readable, but also writable?
(This is when running the Config Server inside of a Docker Container and sharing the git repository through volumes: in a docker-compose file.)
Dave Syer
@dsyer
Nov 15 2016 20:33
I'd guess it needs to be writable. Otherwise how could you do a checkout/fetch?
Robert Van Voorhees
@voor
Nov 15 2016 20:39
Yeah, I tried it again without the ro, still having issues.
Even without the ro the fact it's not resolving the user id might be causing some hiccups.
Robert Van Voorhees
@voor
Nov 15 2016 20:51
Semi-related question, where does the config server checkout the remote git repository?
Marcin Grzejszczak
@marcingrzejszczak
Nov 15 2016 21:00
To tmp AFAIR
pradeepkusingh
@pradeepkusingh
Nov 15 2016 22:13
@dsyer @spencergibb how to redirect using Zuul filter ?
pradeepkusingh
@pradeepkusingh
Nov 15 2016 22:21
my requirement is to redirect one URL ..