【发布时间】:2021-10-02 07:25:23
【问题描述】:
我有以下 spring-boot 设置。
- 客户端/邮递员正在调用 API 网关(也充当负载平衡器)。
- API 网关和产品是 Spring Boot 应用程序/微服务,已在 Eureka 中注册
- 发现服务(也称为 Spring Boot 应用程序)。
- 我按以下顺序运行应用程序:Eureka 发现服务、产品、API 网关
在产品的 pom.xml 文件中,我有以下条目:
<dependency>
<groupId>org.axonframework</groupId>
<artifactId>axon-spring-boot-starter</artifactId>
<version>4.4.7</version>
</dependency>
我正在使用以下Axon Server:AxonServer-4.5.5.jar来运行Axon Server,axonserver.properties条目如下:
server.port=8026
axoniq.axonserver.name=My Axon Server
axoniq.axonserver.hostname=localhost
axoniq.axonserver.devmode.enabled=true
Axon 服务器的默认端口是 8024。我尝试通过更新 axonserver.properties 文件在 8024、8025、8026 上运行它。 Axon 服务器在 localhost 上运行。
每次我通过更新 axonserver.properties 文件更改 Axon 服务器中的端口时,产品微服务都会识别 Axon 服务器,即使 Axon 服务器未在默认端口上运行。我没有在产品微服务中指定 Axon 服务器端口。
我的问题是:即使我不是在产品微服务中指定端口,产品微服务如何识别正确的端口。
【问题讨论】:
标签: spring-boot event-handling microservices spring-cloud axon