@staticmethod
def create_kafka_config(user_config: dict) ->dict:
    """Creates the kafka configuration"""
    config = {'bootstrap.servers': user_config.get('KAFKA_ADDRESS'),
        'enable.auto.commit': False, 'auto.offset.reset': 'earliest',
        'default.topic.config': {'auto.offset.reset': 'smallest'}}
    if user_config.get('EVENTHUB_KAFKA_CONNECTION_STRING'):
        ssl_location = user_config.get('SSL_CERT_LOCATION'
            ) or '/etc/ssl/certs/ca-certificates.crt'
        eventhub_config = {'security.protocol': 'SASL_SSL',
            'sasl.mechanism': 'PLAIN', 'ssl.ca.location': ssl_location,
            'sasl.username': '$ConnectionString', 'sasl.password':
            user_config.get('EVENTHUB_KAFKA_CONNECTION_STRING'),
            'client.id': 'agogosml'}
        config = {**config, **eventhub_config}
    if user_config.get('KAFKA_CONSUMER_GROUP') is not None:
        config['group.id'] = user_config['KAFKA_CONSUMER_GROUP']
    return config
