顯示具有 Microservices 標籤的文章。 顯示所有文章
顯示具有 Microservices 標籤的文章。 顯示所有文章

2022年3月23日 星期三

Axon Server的EventStorageEngine

https://docs.axoniq.io/reference-guide/v/4.2/configuring-infrastructure-components/event-processing/event-bus-and-event-store#embedded-event-store

如果不使用axon-server,採用non-axon-server(Embedded event store)方式,預設使用JPA,JpaEventStorageEngine會儲存events在你設定的data source
JPA方式需要設定META-INF/persistence.xml
也可以使用InMemoryEventStorageEngine、JdbcEventStorageEngine、MongoEventStorageEngine等其他方式儲存events


pom.xml修改排除引用connector
<dependency>
    <groupId>org.axonframework</groupId>
    <artifactId>axon-spring-boot-starter</artifactId>
    <version>${axon.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.axonframework</groupId>
            <artifactId>axon-server-connector</artifactId>
        </exclusion>
    </exclusions>
</dependency>


參考資料:
Interface EventStorageEngine

Event Sourcing 和 CQRS落地(三):Event-Sourcing 实现

AxonFramework,EventStore实现

https://github.com/soooban/AxonDemo

2022年3月3日 星期四

微服務的容錯處理規範:Microprofile Fault Tolerance

Quarkus有實做Microprofile規範的容錯處理(採用SmallRye) 
Spring Cloud以前會使用Netflix Hystrix的方案,但是Hystrix已經停止開發了(只維護)
SpringCloud在2020之後的版本也已經移除spring-cloud-netflix,改推薦使用Resilience4j


Microprofile Fault Tolerance的規格
https://download.eclipse.org/microprofile/microprofile-fault-tolerance-1.1.2/microprofile-fault-tolerance-spec.html

Spring和MicroProfile解決方案比較表
https://www.eclipse.org/community/eclipse_newsletter/2019/september/microprofile.php