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

com.zhaofujun.nest.rabbitmq.RabbitMQAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 2.2.12
Show newest version
package com.zhaofujun.nest.rabbitmq;

import com.zhaofujun.nest.NestApplication;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class RabbitMQAutoConfiguration {

    @Bean
    public RabbitMQMessageChannel rabbitMQMessageChannel(DefaultMessageListenerContainer defaultMessageListenerContainer, AmqpTemplate amqpTemplate, AmqpAdmin amqpAdmin) {
        return new RabbitMQMessageChannel(defaultMessageListenerContainer, amqpTemplate, amqpAdmin, NestApplication.current());
    }


    @Bean
    public DefaultMessageListenerContainer messageListenerContainer(ConnectionFactory connectionFactory) {
        return new DefaultMessageListenerContainer(connectionFactory);

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy