Skip to content

Commit 584e5ec

Browse files
committed
Attempt to clarify error message on consumer subscribe/assign assert failure
1 parent 00599b6 commit 584e5ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kafka/consumer/subscription_state.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ class SubscriptionState(object):
3636
the assigned partitions. This is updated through committed() and can be used
3737
to set the initial fetch position (e.g. Fetcher._reset_offset() ).
3838
"""
39-
_SUBSCRIPTION_EXCEPTION_MESSAGE = ("Subscription to topics, partitions and"
40-
" pattern are mutually exclusive")
39+
_SUBSCRIPTION_EXCEPTION_MESSAGE = (
40+
"You must choose only one way to configure your consumer:"
41+
" (1) subscribe to specific topics by name,"
42+
" (2) subscribe to topics matching a regex pattern,"
43+
" (3) assign itself specific topic-partitions.")
4144

4245
def __init__(self, offset_reset_strategy='earliest'):
4346
"""Initialize a SubscriptionState instance

0 commit comments

Comments
 (0)