Spring AMQP发送许多连接请求

时间:2019-05-29 06:11:55

标签: spring-boot spring-amqp spring-boot-starter

我有一个Spring-Boot应用程序(Netflix Eureka),它应连接到rabbitMQ以提供logstash的日志。 如果存在RabbitMQ,则一切正常,但是如果服务器不可用,则每毫秒向RabbitMQ发送20个以上的请求。

这是我的依赖项:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')

    compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server')

    compile('org.springframework.cloud:spring-cloud-starter-config')

    compile('org.springframework.retry:spring-retry:1.2.2.RELEASE')

    compile('org.springframework.boot:spring-boot-starter-aop:2.0.3.RELEASE')

    compileOnly('org.projectlombok:lombok')

    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-sleuth', version: '2.1.1.RELEASE'
    compile('net.logstash.logback:logstash-logback-encoder:5.2')
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-amqp', version: '2.1.5.RELEASE'

    testCompile('org.springframework.boot:spring-boot-starter-test')
}

我已经尝试过不使用spring retry,但这不是解决方案。

这是我对兔子的配置:

spring:
  profiles: prod
  rabbitmq:
    host: rabbitmq
    port: 5672
    username: user
    password: supersecretpassword

我想将重试次数减少到每秒1次。 目前每毫秒20 +

编辑: 我正在玩这个游戏,发现在访问配置fron cloud config时它的功能相同。在配置加载到错误的目的地之前,它会发送大量请求。 由于大量请求的结果,RAM负担很重。

0 个答案:

没有答案