parent
faf13d6ef2
commit
3ffd9f9549
@ -1,35 +1,35 @@
|
|||||||
//package com.luoo.music.config;
|
package com.luoo.music.config;
|
||||||
//
|
|
||||||
//import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
|
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
|
||||||
//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
//import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
//import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
//import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
//
|
|
||||||
///**
|
/**
|
||||||
// * @Author: yawei.huang
|
* @Author: yawei.huang
|
||||||
// * @Package: com.macro.mall.config
|
* @Package: com.macro.mall.config
|
||||||
// * @Project: macrozhengmall
|
* @Project: macrozhengmall
|
||||||
// * @Date: 2024/5/8 14:13
|
* @Date: 2024/5/8 14:13
|
||||||
// * @Filename: RabbitMQConfig
|
* @Filename: RabbitMQConfig
|
||||||
// * @Describe:
|
* @Describe:
|
||||||
// */
|
*/
|
||||||
//@Configuration
|
@Configuration
|
||||||
//public class RabbitMQConfig {
|
public class RabbitMQConfig {
|
||||||
//
|
|
||||||
// @Bean
|
@Bean
|
||||||
// public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
|
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
|
||||||
// RabbitTemplate template = new RabbitTemplate(connectionFactory);
|
RabbitTemplate template = new RabbitTemplate(connectionFactory);
|
||||||
// template.setMessageConverter(new Jackson2JsonMessageConverter());
|
template.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||||
// return template;
|
return template;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// @Bean
|
@Bean
|
||||||
// public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
|
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
|
||||||
// SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||||
// factory.setConnectionFactory(connectionFactory);
|
factory.setConnectionFactory(connectionFactory);
|
||||||
// factory.setMessageConverter(new Jackson2JsonMessageConverter());
|
factory.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||||
// return factory;
|
return factory;
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.luoo.user.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
|
||||||
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class RabbitMQConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
|
||||||
|
RabbitTemplate template = new RabbitTemplate(connectionFactory);
|
||||||
|
template.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
|
||||||
|
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||||
|
factory.setConnectionFactory(connectionFactory);
|
||||||
|
factory.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue