Skip to content
Advertisement

KafkaStreams is not running. State is ERROR

I have a Kafka consumer class that listens to events and perform join between events (Order, Customer) and store them in a materialized view. I created another class to access state store when REST call received. But I am getting java.lang.IllegalStateException: KafkaStreams is not running. State is ERROR. I tried to assign application.server property, it didn’t work. Class EventsListener joins events and class StateStoreService queries events. Code uploaded to Github for reference.

Based on this discussion https://confluentcommunity.slack.com/archives/C48AHTCUQ/p1500079616414627 and below notes from Matt, I deleted application.server property.

JavaScript

But I still can not read from the state store. Code stuck at thread.sleep() method.

Exception:

JavaScript

Advertisement

Answer

The issue was caused by the wrong approach. Rest Proxy should start by consumer class and second class should get data from REST API started by jetty server

  1. Start REST proxy from EventsListener class (just execute EventsListener class)
  2. All the customer orders should be accessible from http://localhost:8095/customer-orders/all
  3. Start SpringBoot class and try to access http://localhost:8090/customerOrders/CU9978. This should connect to REST proxy started by EventsListener class.
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement