潘志宝
5 天以前 4d7e3bb9a93ac0bdba9075e5efa536a165f8aae9
提交 | 用户 | 时间
e7c126 1 package com.iailab.framework.mq.rabbitmq.config;
H 2
3 import lombok.extern.slf4j.Slf4j;
4 import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
5 import org.springframework.amqp.support.converter.MessageConverter;
6 import org.springframework.boot.autoconfigure.AutoConfiguration;
7 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
8 import org.springframework.context.annotation.Bean;
9
10 /**
11  * RabbitMQ 消息队列配置类
12  *
13  * @author iailab
14  */
15 @AutoConfiguration
16 @Slf4j
17 @ConditionalOnClass(name = "org.springframework.amqp.rabbit.core.RabbitTemplate")
18 public class IailabRabbitMQAutoConfiguration {
19
20     /**
21      * Jackson2JsonMessageConverter Bean:使用 jackson 序列化消息
22      */
23     @Bean
24     public MessageConverter createMessageConverter() {
25         return new Jackson2JsonMessageConverter();
26     }
27
28 }