通过设置 System.setProperty("seata.config.name","/abc/registry.conf") 设置registry.conf的路径不生效

yacmzcpb  于 22天前  发布在  其他
关注(0)|答案(3)|浏览(15)

目的时为了在类路径的abc目录下放置registry.conf,但通过设置 System.setProperty("seata.config.name","/abc/registry.conf")后,registry.conf的内容不生效,同时registry.conf里也设置了config.file.name="/abc/file.conf",file.conf内容也不生效!

registry.conf内容如下:

registry {
  # file 、nacos 、eureka、redis、zk
  type = "nacos"

  nacos {
      application="seata-server"
      serverAddr="192.168.137.199:8848"
      namespace=""
      cluster="default"
      group="SEATA_GROUP"
      username="nacos"
      password="nacos"
  }
}

config {
  # file、nacos 、apollo、zk
  type = "file"
  file {
    name = "/abc/file.conf"
  }
}
evrscar2

evrscar21#

check your seata dependency first:

  1. seata-spring-boot-starter uses the .yml and .properties profiles
  2. seata-all uses the .conf configuration file
dfuffjeb

dfuffjeb2#

Also note that you are configuring an absolute path.

2q5ifsrm

2q5ifsrm3#

如何设置相对类路径下的子路径呢?  …

------------------ 原始邮件 ------------------ 发件人: "seata/seata" ***@***.***>; 发送时间: 2023年2月24日(星期五) 上午10:03 ***@***.***>; ***@***.******@***.***>; 主题: Re: [seata/seata] 通过设置 System.setProperty("seata.config.name","/abc/registry.conf") 设置registry.conf的路径不生效 (Issue #5388) Also note that you are configuring an absolute path. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: ***@***.***>

相关问题