private Pair<AbstractUtf8Array, Boolean> createPayload(ConfigKey<?> configKey, ConfigDefinition def) {
        try {
            ConfigInstance.Builder builder = model.getConfigInstance(configKey, def);
            boolean tempApplyOnRestart = builder.getApplyOnRestart();
            if (builder instanceof GenericConfig.GenericConfigBuilder) {
                return new Pair<>(((GenericConfig.GenericConfigBuilder) builder).getPayload().toUtf8Array(true),
                        tempApplyOnRestart);
            }
            else {
                String cacheBuilderClassNameForErrorReport = builder.getClass().getName();
                ConfigPayload payload;
                boolean applyOnRestart = false;
                try {
                    ConfigInstance instance = ConfigInstanceBuilder.buildInstance(builder, def.getCNode());
                    payload = ConfigPayload.fromInstance(instance);
                    applyOnRestart = tempApplyOnRestart;
                } catch (ConfigurationRuntimeException e) {
                    // This can happen in cases where services ask for config that no longer exist before they have been able
                    // to reconfigure themselves
                    log.log(Level.INFO, TenantRepository.logPre(getId()) +
                                        ": Error resolving instance for builder '" + cacheBuilderClassNameForErrorReport +
                                        "', returning empty config: " + Exceptions.toMessageString(e));
                    payload = ConfigPayload.fromBuilder(new ConfigPayloadBuilder());
                }
                if (def.getCNode() != null)
                    payload.applyDefaultsFromDef(def.getCNode());
                return new Pair<>(payload.toUtf8Array(true), applyOnRestart);
            }
        } catch (Exception e) {
            throw new ConfigurationRuntimeException("Unable to get config for " + app, e);
        }
    }
Gets a config from ZK. Returns null if not found.
configserver/src/main/java/com/yahoo/vespa/config/server/application/Application.java