小调整
This commit is contained in:
parent
3833d169a4
commit
d6dea7eb1d
@ -27,6 +27,7 @@ spring:
|
||||
name: ruoyi
|
||||
#配置rabbitMq 服务器
|
||||
rabbitmq:
|
||||
enable: false
|
||||
host: 127.0.0.1
|
||||
port: 5672
|
||||
username: guest
|
||||
|
@ -31,7 +31,6 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
|
||||
public class HttpClientUtil {
|
||||
|
||||
@ -46,7 +45,7 @@ public class HttpClientUtil {
|
||||
.setConnectTimeout(600000)
|
||||
.setConnectionRequestTimeout(600000).build();
|
||||
|
||||
private static CloseableHttpClient client = SpringUtils.getBean("closeableHttpClient");
|
||||
private static CloseableHttpClient client = HttpUtils.initClient();
|
||||
|
||||
/**
|
||||
* 发送 post请求
|
||||
|
@ -2,12 +2,14 @@ package com.ruoyi.middleware.rabbitmq;
|
||||
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.ruoyi.common.core.domain.Message;
|
||||
|
||||
@Component
|
||||
@RabbitListener(queues = "TestDirectQueue") // 监听的队列名称 TestDirectQueue
|
||||
@ConditionalOnProperty(prefix = "spring.rabbitmq", name = { "enable" }, havingValue = "true", matchIfMissing = false)
|
||||
public class DirectReceiver {
|
||||
|
||||
@RabbitHandler
|
||||
|
Loading…
Reference in New Issue
Block a user