[axon] command/query project 생성 - clone coding
2022.01.12 - [architecture/MSA] - [cqrs] axon framework
[cqrs] axon framework
2022.01.11 - [architecture/MSA] - [arch] what is cqrs - 조회와 비조회의 엄연한 분리 [arch] what is cqrs - 조회와 비조회의 엄연한 분리 CQRS는 Command and Query Responsibility Segregation(명령과 조회..
bangpurin.tistory.com
이전 글에서 axon-springboot 에 대한 클론코딩을 진행한다고 했는데, 아무래도 글쓴이는 19년도에 실습을 하였고 나는 22년에 진행을 하기에 그 사이 버전업으로 인해 달라진 점이나, 설명이 미흡하여 헤맨 부분을 따로 정리하도록 한다.
개발환경: springboot 2.6.2 / gradle 7.3.2 / postgre-14(on linux)
postgresql은 vm 리눅스에 설치했다.
- 아래 링크대로 했으며 계정명만 command, query 로 바꾸어 pair 로 생성
- 설정 입맛에 맞게 변경
vi /var/lib/pgsql/14/data/pg_hba.conf vi /var/lib/pgsql/14/data/pg_hba.conf
//아래와 같이 수정
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all command, query md5
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
host all all 0.0.0.0/0 md5
소스: https://github.com/haileyjhbang/cqrs-clone.git
실습내용: https://cla9.tistory.com/7?category=814447
4. Gradle Multi Project 생성
1. 서론 CQRS 구성을 위해 일반적으로 Command, Query 두가지 Application을 구성합니다. 이때 Application 사이 매개체 역할을 Event가 담당합니다. 따라서 Event 정보를 알기 위해서는 Event 정보가 두 App에 모..
cla9.tistory.com
문제:
1. root project의 gradle build가 되지 않는 문제
- gradle version up 으로 인한 build.gradle 차이
- https://stackoverflow.com/questions/23796404/could-not-find-method-compile-for-arguments-gradle
2. main class 의 run버튼이 안 나타나는 문제
- intellij가 폴더 구조를 몰라서
- https://stackoverflow.com/questions/37081574/intellij-doesnt-show-run-button
실습내용: https://cla9.tistory.com/8
5. Axon Framework 기본 구성 및 Axon Server 연동
1. 서론 이번 시간에는 지난 포스팅에 이어서 AxonFramework 구성 및 AxonServer 연동에 대해 다루도록 하겠습니다. 진행하기 앞서 몇가지 사전 작업이 필요합니다. Postgresql 설치 Postgresql Command, Query DB..
cla9.tistory.com
문제:
1. application.yml 항목 deprecated
2. springboot 2.6 이상일 경우 아래 에러 발생
Error creating bean with name 'entityManagerFactory': Requested bean is currently in creation
server:
port: 8080
spring:
application:
name: eventsourcing-cqrs-command
datasource:
url: jdbc:postgresql://192.168.35.100:5432/command
username: command
password: command
driverClassName: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: true
main:
allow-circular-references: true
axon:
serializer:
general: xstream
axonserver:
servers: 192.168.35.100:8124
command/query 모두 위와 비슷하게 변경