Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nacos 刷新失败 #240

Closed
lhzsdnu opened this issue May 22, 2022 · 11 comments
Closed

Nacos 刷新失败 #240

lhzsdnu opened this issue May 22, 2022 · 11 comments

Comments

@lhzsdnu
Copy link

lhzsdnu commented May 22, 2022

Bug Report

在开始报告错误之前,请确保认真查看了以下步骤:

请在提交问题之前回答这些问题,谢谢。

你使用了哪个项目?Hippo-4J Server 还是 Hippo-4J Core?

Hippo-4J Core

你使用了哪个版本?

1.2.1

预期行为

修改nacos线程参数,线程池参数实时刷新

实际行为

线程池参数一直为启动时nacos上获取到的

修改时的日志
o.s.cloud.commons.util.InetUtils : Cannot determine local hostname
o.s.c.e.event.RefreshEventListener : Refresh keys changed: [spring.dynamic.thread-pool.executors[0].maximum-pool-size, spring.dynamic.thread-pool.executors[0].core-pool-size]

原因分析(如果可以)

问题重现步骤

springboot 2.6.8
springcloud alibaba 2021.0.1.0
nacos 2.0.2

用于重现此问题的示例代码(例如 GitHub 链接)

https://github.com/lhzsdnu/example-hippo4j

@magestacks
Copy link
Member

我本地复现下这个环境。另外,如果可以的话,你可以尝试 debug 下 cn.hippo4j.core.springboot.starter.refresher.AbstractCoreThreadPoolDynamicRefresh#dynamicRefresh

@lhzsdnu
Copy link
Author

lhzsdnu commented May 22, 2022

没有走到这个断点

@magestacks
Copy link
Member

收到,我本地在复现

@magestacks
Copy link
Member

麻烦把 pom 文件相关都贴一下 @lhzsdnu

@lhzsdnu
Copy link
Author

lhzsdnu commented May 22, 2022

@magestacks
Copy link
Member

@lhzsdnu 经过测试,应该是你项目没有配置正确。我会对示例项目提一个 pr,你可以合并看看。

我在 nacos 的配置:

DataId:hippo4j-nacos.yaml
Group:DEFAULT_GROUP

server:
  port: 8089
  servlet:
    context-path: /example
spring:
  profiles:
    active: dev
  cloud:
    nacos:
      config:
        # group: DEFAULT_GROUP
        password: nacos
        server-addr: 192.168.1.5:8848
        username: nacos
        # namespace: public
  dynamic:
    thread-pool:
      enable: true
      collect-type: metric
      check-state-interval: 3
      notify-platforms:
        - platform: 'WECHAT'
          secret-key: ac0426a5-c712-474c-9bff-72b8b8f5caff
        - platform: 'DING'
          token: 56417ebba6a27ca352f0de77a2ae9da66d01f39610b5ee8a6033c60ef9071c55
          secret: SEC40943de20b51e993b47e9a55490a168f1c9e00bdb4f0fb15b1d9e4b58f8b05f3
        - platform: 'LARK'
          secret-key: 2cbf2808-3839-4c26-a04d-fd201dd51f9e
      nacos:
        data-id: 'hippo4j-nacos.yaml'
        group: 'DEFAULT_GROUP'
      config-file-type: yml
      # undertow:
      # jetty:
      tomcat:
        core-pool-size: 104
        maximum-pool-size: 203
        keep-alive-time: 1003
      is-alarm: true
      active-alarm: 70
      capacity-alarm: 70
      alarm-interval: 3
      receive: 111
      adapter-executors:
        - threadPoolKey: 'input'
          mark: 'RocketMQSpringCloudStream'
          corePoolSize: 103
          maximumPoolSize: 103
      executors:
        - threadPoolId: 'message'
          corePoolSize: 8
          maximumPoolSize: 10
          queue-capacity: 10
          blocking-queue: 'ResizableCapacityLinkedBlockIngQueue'
          rejected-handler: 'DiscardPolicy'
          keep-alive-time: 2000
          executeTimeOut: 800
          allow-core-thread-time-out: true
          thread-name-prefix: 'message-consume'
          notify:
            # is-alarm: true
            #active-alarm: 80
            #capacity-alarm: 90
            #interval: 1
            receive: 15601166691

@magestacks
Copy link
Member

image

@magestacks
Copy link
Member

@lhzsdnu pr 已提交,可以尝试合并下。因为原项目缺少 idea 默认文件,所以提交文件会多些,如果你觉得没必要合并,可以参考修改内容

lhzsdnu/example-hippo4j#1

@lhzsdnu
Copy link
Author

lhzsdnu commented May 22, 2022

image

@lhzsdnu
Copy link
Author

lhzsdnu commented May 22, 2022

image

@magestacks
Copy link
Member

@lhzsdnu 本 issue 问题已解决,可以选择新开一个 issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants