消息代理message broker
目的地destination
队列queue
主题topic
JMS:activemq
AMQP:rabbitmq
@EnableRabbit:开启基于注解的RabbitMQ模式
@JmsListener
@RabbitListener:配置监听器
@EnableJms
JmsAutoConfiguration
RabbitAutoConfiguration
ConnectionFactory
JmsTemplate
RabbitTemplate
以遵循AMQP协议的RabbitMQ为例,首先启动starter启动器:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
重点看一下RabbitAutoConfiguration类,该类提供了如下实例:
CachingConnectionFactory
RabbitTemplateConfiguration
AmqpAdmin
RabbitMessagingTemplate
RabbitTemplate:给RabbitMQ发送和接受消息,类似于JDBCTempldate;
创建、删除队列、交换器等;