连接到 AxonServer 节点失败:不可用:网络因未知原因关闭

问题描述 投票:0回答:1

尝试使用 docker 镜像连接到 axon 服务器时:

version: '3'
services:

  axonserver:
    image: axoniq/axonserver:2024.1.2-jdk-17-nonroot
    hostname: axonserver
    container_name: axonserver
    volumes:
      - type: bind
        source: ./data
        target: ./axon/data
      - type: bind
        source: ./events
        target: ./axon/eventdata
      - type: bind
        source: ./config
        target: ./axon/config
        read_only: true
    ports:
      - '8024:8024'
      - '8124:8124'
      - '8224:8224'

Spring Boot应用程序无法连接到axon服务器。

仪表板:

localhost:8024
工作正常,我可以访问它。

我尝试添加此依赖项,如this帖子中所述:

<dependency>
    <groupId>org.axonframework</groupId>
    <artifactId>axon-server-connector</artifactId>
    <version>${axon.version}</version> <!-- 4.9.1 -->
</dependency>

这是我的

application.properties
文件:

# Axon
axon.axonserver.servers=localhost:8024
axon.serializer.general=jackson
axon.serializer.events=jackson
axon.serializer.messages=jackson
spring-boot design-patterns microservices cqrs axon
1个回答
0
投票

如问题前面所述,我添加了

axon-connector
依赖项,并且如这篇文章中所述,客户端(Spring Boot)连接端口是
<host_name>:8124
而不是
<host_name>:8024
。 8024 仅用于仪表板。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.