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

io.github.springwolf.plugins.sqs.configuration.SpringwolfSqsProducerConfiguration Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
// SPDX-License-Identifier: Apache-2.0
package io.github.springwolf.plugins.sqs.configuration;

import io.awspring.cloud.sqs.operations.SqsTemplate;
import io.github.springwolf.core.controller.PublishingPayloadCreator;
import io.github.springwolf.plugins.sqs.controller.SpringwolfSqsController;
import io.github.springwolf.plugins.sqs.producer.SpringwolfSqsProducer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

import static io.github.springwolf.plugins.sqs.configuration.properties.SpringwolfSqsConfigConstants.SPRINGWOLF_SQS_CONFIG_PREFIX;
import static io.github.springwolf.plugins.sqs.configuration.properties.SpringwolfSqsConfigConstants.SPRINGWOLF_SQS_PLUGIN_PUBLISHING_ENABLED;

@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty(
        prefix = SPRINGWOLF_SQS_CONFIG_PREFIX,
        name = SPRINGWOLF_SQS_PLUGIN_PUBLISHING_ENABLED,
        havingValue = "true")
public class SpringwolfSqsProducerConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public SpringwolfSqsProducer springwolfSqsProducer(List sqsTemplates) {
        return new SpringwolfSqsProducer(sqsTemplates);
    }

    @Bean
    @ConditionalOnMissingBean
    public SpringwolfSqsController springwolfSqsController(
            PublishingPayloadCreator publishingPayloadCreator, SpringwolfSqsProducer springwolfSqsProducer) {
        return new SpringwolfSqsController(publishingPayloadCreator, springwolfSqsProducer);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy