From 584e5ec740de4cb99b6e0437375d4eccb6e93ca9 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Mon, 14 Mar 2016 12:36:11 -0700 Subject: Attempt to clarify error message on consumer subscribe/assign assert failure --- kafka/consumer/subscription_state.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kafka/consumer') diff --git a/kafka/consumer/subscription_state.py b/kafka/consumer/subscription_state.py index c137e5b..a4043a1 100644 --- a/kafka/consumer/subscription_state.py +++ b/kafka/consumer/subscription_state.py @@ -36,8 +36,11 @@ class SubscriptionState(object): the assigned partitions. This is updated through committed() and can be used to set the initial fetch position (e.g. Fetcher._reset_offset() ). """ - _SUBSCRIPTION_EXCEPTION_MESSAGE = ("Subscription to topics, partitions and" - " pattern are mutually exclusive") + _SUBSCRIPTION_EXCEPTION_MESSAGE = ( + "You must choose only one way to configure your consumer:" + " (1) subscribe to specific topics by name," + " (2) subscribe to topics matching a regex pattern," + " (3) assign itself specific topic-partitions.") def __init__(self, offset_reset_strategy='earliest'): """Initialize a SubscriptionState instance -- cgit v1.2.1