feat:添加rabbitmq配置(是否启用RabbitMQ)
This commit is contained in:
parent
1936ede088
commit
8cb6142d88
@ -43,7 +43,8 @@ logging:
|
||||
# Spring配置
|
||||
spring:
|
||||
rabbitmq:
|
||||
host: 192.168.1.194 # RabbitMQ 服务的地址
|
||||
enabled: false # 是否启用RabbitMQ
|
||||
host: localhost # RabbitMQ 服务的地址
|
||||
port: 5672 # RabbitMQ 服务的端口
|
||||
username: mes # RabbitMQ 服务的账号
|
||||
password: mes # RabbitMQ 服务的密码
|
||||
@ -71,13 +72,13 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.1.254
|
||||
host: localhost
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password:
|
||||
password: 123456
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
|
@ -3,6 +3,7 @@ package com.ktg.mes.rabbitmq;
|
||||
import com.ktg.mes.websocket.MesWebSocket;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@ -12,6 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = "enabled", havingValue = "true")
|
||||
public class DirectQueueHandler {
|
||||
|
||||
@RabbitListener(queues = "iot.original.mes")
|
||||
|
Loading…
Reference in New Issue
Block a user