0

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

3 Answers 3

0

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.