@Configuration
@ConditionalOnProperty(prefix="alum.aim.cluster",
name="mode",
havingValue="rabbitmq")
public class RabbitMQConfig
extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected io.netty.util.internal.logging.InternalLogger |
logger |
| 构造器和说明 |
|---|
RabbitMQConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.amqp.core.Binding |
bindKick() |
org.springframework.amqp.core.Binding |
bindMessage() |
org.springframework.amqp.core.Binding |
bindReply() |
org.springframework.amqp.core.FanoutExchange |
fanoutExchange()
针对消费者配置:
1.
|
org.springframework.amqp.core.Queue |
kick() |
org.springframework.amqp.core.Queue |
message() |
org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer |
messageListenerContainer(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) |
RabbitMessageListener |
rabbitMessageListener() |
RabbitMQPusher |
rabbitMQPusher() |
org.springframework.amqp.rabbit.core.RabbitTemplate |
rabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) |
org.springframework.amqp.core.Queue |
reply() |
@Bean public org.springframework.amqp.core.FanoutExchange fanoutExchange()
1. 设置交换机类型。
2. 将队列绑定到交换机。
FanoutExchange: 将消息分发到所有的绑定队列,无routingkey的概念。
HeadersExchange :通过添加属性key-value匹配。
DirectExchange:按照routingkey分发到指定队列。
TopicExchange:多关键字匹配。
@Bean public org.springframework.amqp.core.Queue reply()
@Bean public org.springframework.amqp.core.Queue message()
@Bean public org.springframework.amqp.core.Queue kick()
@Bean public org.springframework.amqp.core.Binding bindReply()
@Bean public org.springframework.amqp.core.Binding bindMessage()
@Bean public org.springframework.amqp.core.Binding bindKick()
@Bean public RabbitMessageListener rabbitMessageListener()
public org.springframework.amqp.rabbit.core.RabbitTemplate rabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
@Bean public org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer messageListenerContainer(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
connectionFactory - @Bean public RabbitMQPusher rabbitMQPusher()
Copyright © 2020–2022 The AIM Project. All rights reserved.