From 9ee00c4b6661a590afcd5fb390bd0abaa3dcce1b Mon Sep 17 00:00:00 2001 From: Stuart Perks Date: Thu, 22 Mar 2018 22:37:28 +0000 Subject: [PATCH] KAFKA-6659: Improve error message if state store is not found (#4732) Reviewers: Bill Bejeck , Matthias J. Sax --- .../streams/processor/internals/ProcessorContextImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java index 3761bfb0ee6..44a25c1213f 100644 --- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java +++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java @@ -72,7 +72,13 @@ public class ProcessorContextImpl extends AbstractProcessorContext implements Re } if (!currentNode().stateStores.contains(name)) { - throw new StreamsException("Processor " + currentNode().name() + " has no access to StateStore " + name); + throw new StreamsException("Processor " + currentNode().name() + " has no access to StateStore " + name + + " as the store is not connected to the processor. If you add stores manually via '.addStateStore()' " + + "make sure to connect the added store to the processor by providing the processor name to " + + "'.addStateStore()' or connect them via '.connectProcessorAndStateStores()'. " + + "DSL users need to provide the store name to '.process()', '.transform()', or '.transformValues()' " + + "to connect the store to the corresponding operator. If you do not add stores manually, " + + "please file a bug report at https://issues.apache.org/jira/projects/KAFKA."); } return stateManager.getStore(name);