spring-bootdesign-patternsmicroservicescqrsaxon

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

Solution

  • 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.