def METHOD_NAME(vcap_services, existing_constants):
    be_config = {}
    try:
        for service_name, service_creds in vcap_services.items():
            if "kafka" in service_name:
                if len(service_creds) > 1:
                    logging.warning(
                        "Business Events: multiple configurations found for kafka. "
                        "Using the first config from list"
                    )
                if (
                        "credentials" in service_creds[0]
                        and service_creds[0]["credentials"]
                ):
                    kafka_creds = service_creds[0]["credentials"]
                    if CLIENT_CONFIG_URL_KEY in kafka_creds:
                        auth_token = kafka_creds.get("ClientConfigAuthToken", "")
                        for constant in BE_CONSTANTS_TO_INJECT:
                            be_config[
                                f"{CONSTANTS_PREFIX}.{constant}"
                            ] = kafka_creds.get(constant, "")
                        client_config = _put_client_config(
                            kafka_creds.get(CLIENT_CONFIG_URL_KEY, ""),
                            auth_token,
                            "1",
                            _read_dependencies_json_as_str(),
                        )
                        be_config[
                            f"{CONSTANTS_PREFIX}.ClientConfiguration"
                        ] = client_config
                        if kafka_creds.get(OPTIONAL_CONSTANT_APPLY_LIMITS):
                            be_config[
                                f"{CONSTANTS_PREFIX}.{OPTIONAL_CONSTANT_APPLY_LIMITS}"
                            ] = kafka_creds.get(OPTIONAL_CONSTANT_APPLY_LIMITS)
                    else:
                        logging.error(
                            "Business Events: configuration is not compatible, "
                            "please unbind and bind the service again"
                        )
                else:
                    logging.error("Business Events: configuration is empty")
                # Update Business Events constants for metrics
                _configure_business_events_metrics(be_config, existing_constants)
    except Exception as ex:
        logging.error(
            "Business Events: error reading deployment configuration %s", str(ex)
        )
    return be_config