Seyed Ali
Seyed Ali

Reputation: 1

Connecting to AxonServer node failed: UNAVAILABLE: Network closed for unknown reason

While trying to connect to axon server using docker image of it:

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'

The spring boot application couldn't connect to the axon server.

The dashboard: localhost:8024 was working fine and I could access it.

I tried adding this dependency as described in this post:

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

This is my application.properties file:

# Axon
axon.axonserver.servers=localhost:8024
axon.serializer.general=jackson
axon.serializer.events=jackson
axon.serializer.messages=jackson

Upvotes: 0

Views: 104

Answers (3)

Mateusz Nowak
Mateusz Nowak

Reputation: 41

Please try to open the dashboard on localhost:8024 and create the first context manually (first screen on the dashboard).

Then your app should connect to Axon Server.

Upvotes: 0

Steven
Steven

Reputation: 7275

Are you using Spring Boot as well, @SeyedAli? If so, do you have a dependency on the axon-spring-boot-starter?

Having that dependency without any configuration next to it is sufficient for Axon Framework to connect to a default Axon Server set up.

Upvotes: 0

Seyed Ali
Seyed Ali

Reputation: 1

As described earlier in the question, I added the axon-connector dependency, and also as described in this post, the client (spring boot) connecting port is <host_name>:8124 not <host_name>:8024. 8024 is for the dashboard only.

Upvotes: 0

Related Questions