All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zalando.spring.boot.nakadi.config.FahrscheinConfigProperties Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package org.zalando.spring.boot.nakadi.config;

import java.util.LinkedHashMap;
import java.util.Map;

import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import lombok.Data;

@Data
@Component
@Validated
public class FahrscheinConfigProperties {

    @NestedConfigurationProperty
    private DefaultConsumerConfig defaults = new DefaultConsumerConfig();

    private Map consumers = new LinkedHashMap<>();

    private PublisherConfig publisher = new PublisherConfig();

    void postProcess() {
        consumers.entrySet().forEach(e -> {
            e.getValue().mergeWithDefaultConfig(defaults);
            e.getValue().setId(e.getKey());
            e.getValue().getOauth().setAccessTokenIdIfNotConfigured(e.getKey());
        });
        publisher.mergeWithDefaultConfig(defaults);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy