Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consume message error #2453

Open
lonycc opened this issue Dec 30, 2024 · 0 comments
Open

consume message error #2453

lonycc opened this issue Dec 30, 2024 · 0 comments

Comments

@lonycc
Copy link

lonycc commented Dec 30, 2024

consumer = KafkaConsumer(
    'topic-yunan',
    group_id = "consumer-yunan",
    bootstrap_servers = ['127.0.0.1:50003'],
    api_version = (1, 1),

    security_protocol = "SASL_SSL",
    sasl_mechanism = "PLAIN",
    sasl_plain_username = "username",
    sasl_plain_password = "password",
    ssl_cafile = "CARoot.pem",
    ssl_check_hostname = False,
)

for message in consumer:
    print("Topic:[%s] Partition:[%d] Offset:[%d] Value:[%s]" % (message.topic, message.partition, message.offset, message.value))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/consumer/group.py", line 1197, in __next__
    return self.next_v2()
           ^^^^^^^^^^^^^^
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/consumer/group.py", line 1205, in next_v2
    return next(self._iterator)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/consumer/group.py", line 1120, in _message_generator_v2
    record_map = self.poll(timeout_ms=timeout_ms, update_offsets=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/consumer/group.py", line 657, in poll
    records = self._poll_once(remaining, max_records, update_offsets=update_offsets)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/consumer/group.py", line 679, in _poll_once
    self._coordinator.poll()
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/coordinator/consumer.py", line 289, in poll
    self.ensure_active_group()
  File "/home/tony/mixed/py/myvenv/lib/python3.12/site-packages/kafka/coordinator/base.py", line 425, in ensure_active_group
    raise exception  # pylint: disable-msg=raising-bad-type
    ^^^^^^^^^^^^^^^
kafka.errors.UnknownError: [Error -1] UnknownError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant