eventuate-examples / eventuate-examples-restaurant-management

Event-driven microservices version of restaurant management from POJOs in Action
Other
217 stars 106 forks source link

Kafka timeout for the container eventuateexamplesrestaurantmanagement_restaurantsview_1 #15

Closed lrabiet closed 6 years ago

lrabiet commented 6 years ago

I am trying to use the local version of eventuate (the cloud version is working fine) I am getting this error on the restaurant view just after a curl http://$DOCKER_HOST_IP:8082/swagger-ui.html:

restaurantsview_1  | Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
restaurantsview_1  |    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
restaurantsview_1  |    at java.lang.Thread.run(Thread.java:745)
restaurantsview_1  | Caused by: java.lang.reflect.InvocationTargetException
restaurantsview_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
restaurantsview_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
restaurantsview_1  |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
restaurantsview_1  |    at java.lang.reflect.Method.invoke(Method.java:498)
restaurantsview_1  |    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
restaurantsview_1  |    ... 1 more
restaurantsview_1  | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restaurantQueryWorkflow' defined in class path resource [net/chrisrichardson/eventstore/examples/management/restaurantsviewservice/backend/RestaurantsViewBackendConfiguration.class]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
restaurantsview_1  |    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
restaurantsview_1  |    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
restaurantsview_1  |    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
restaurantsview_1  |    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
restaurantsview_1  |    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
restaurantsview_1  |    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
restaurantsview_1  |    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
restaurantsview_1  |    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
restaurantsview_1  |    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
restaurantsview_1  |    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
restaurantsview_1  |    at net.chrisrichardson.eventstore.examples.management.restaurantsviewservice.RestaurantsViewServiceMain.main(RestaurantsViewServiceMain.java:21)
restaurantsview_1  |    ... 6 more
restaurantsview_1  | Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata
restaurantsview_1  |    at io.eventuate.local.java.kafka.consumer.EventuateKafkaConsumer.start(EventuateKafkaConsumer.java:115)
restaurantsview_1  |    at io.eventuate.local.java.jdbckafkastore.EventuateKafkaAggregateSubscriptions.subscribe(EventuateKafkaAggregateSubscriptions.java:85)
restaurantsview_1  |    at io.eventuate.javaclient.commonimpl.EventuateAggregateStoreImpl.subscribe(EventuateAggregateStoreImpl.java:158)
restaurantsview_1  |    at io.eventuate.javaclient.spring.EventDispatcherInitializer.registerEventHandler(EventDispatcherInitializer.java:105)
restaurantsview_1  |    at io.eventuate.javaclient.spring.EventHandlerBeanPostProcessor.postProcessBeforeInitialization(EventHandlerBeanPostProcessor.java:25)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
restaurantsview_1  |    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
restaurantsview_1  |    ... 21 more
restaurantsview_1  | Caused by: java.lang.RuntimeException: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata
restaurantsview_1  |    at io.eventuate.local.java.kafka.consumer.EventuateKafkaConsumer.verifyTopicExistsBeforeSubscribing(EventuateKafkaConsumer.java:48)
restaurantsview_1  |    at io.eventuate.local.java.kafka.consumer.EventuateKafkaConsumer.start(EventuateKafkaConsumer.java:70)
restaurantsview_1  |    ... 28 more
restaurantsview_1  | Caused by: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata
eventuateexamplesrestaurantmanagement_restaurantsview_1 exited with code 0

and the container is then terminating.

I am using the original code except for a change in the version

-  image: eventuateio/eventuateio-local-kafka:0.9.0
+  image: eventuateio/eventuateio-local-kafka:0.15.0

(and the other containers) and

-eventuateClientVersion=0.14.0.RELEASE
-eventuateLocalVersion=0.10.0.RELEASE
+eventuateClientVersion=0.19.0.RELEASE
+eventuateLocalVersion=0.15.0.RELEASE
lrabiet commented 6 years ago

I had to open the port 9092 for $ADVERTISED_HOST_NAME in my firewall