<jupyter_start><jupyter_text>🦀 New Consumer Group ---Let's try to create a consumer on another `group_id` (`my_NEW_pizza_group`) and the `auto_offset_reset=earliest`<jupyter_code>from kafka import KafkaConsumer
import json
from config.kafka_config import *

consumer_new_group = KafkaConsumer(
        ## NEW group_id #########
        group_id='my_NEW_pizza_group',
        #########################
        bootstrap_servers=hostname+":"+str(port),
        security_protocol="SSL",
        ssl_cafile=cert_folder+"/ca.pem",
        ssl_certfile=cert_folder+"/service.cert",
        ssl_keyfile=cert_folder+"/service.key",
        value_deserializer = lambda v: json.loads(v.decode('ascii')),
        key_deserializer = lambda v: json.loads(v.decode('ascii')),
        auto_offset_reset='earliest',
        max_poll_records = 10
    )

consumer_new_group.subscribe(topics=[topic_name])
consumer_new_group.subscription()
for message in consumer_new_group:
    print ("%d:%d: key=%s value=%s" % (message.partition,
                                       message.offset,
                                       message.key,
                                       message.value))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13443983402489626, 'fraction_numerical': 0.0016597510373443983, 'mean_word_length': 2.853035143769968, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '267458', 'license': 'Apache-2.0', 'n_tokens_mistral': 377, 'n_tokens_neox': 363, 'n_words': 60, 'path': '04 - New Consumer Group.ipynb', 'repo_name': 'srikanth-platformatory/python-notebooks-for-apache-kafka', 'size': '1205'}