Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Aug 26, 2021
2 parents e9b42cb + a4df609 commit e50d702
Show file tree
Hide file tree
Showing 61 changed files with 1,343 additions and 79 deletions.
10 changes: 10 additions & 0 deletions .codacy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
engines:
duplications:
exclude_paths:
- "**/src/test/kotlin/**"

exclude_paths:
- ".github/ISSUE_TEMPLATE/**"
- ".mvn/wrapper/**"
- "docs/**"
73 changes: 73 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build the docs

on:
push:
branches:
- develop
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./docs/requirements.txt

- name: Set git username and email
run: |
#
git config --global user.email "${GH_USERNAME}@users.noreply.github.com"
git config --global user.name "${GH_USERNAME}"
env:
GH_USERNAME: ${{ github.actor }}

- name: Pre-fetch the gh-pages branch
run: git fetch

- name: Build docs with MkDocs
run: mkdocs build

- name: Read the tag name
id: get_tag_name
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=TAG_NAME::${GITHUB_REF/refs\/tags\//}

# This is for a tagged version
- name: Create a new version of documentation and push to GH pages.
if: startsWith(github.ref, 'refs/tags/')
run: mike deploy ${{ steps.get_tag_name.outputs.TAG_NAME }} stable --push --rebase

- name: Make stable to default.
if: startsWith(github.ref, 'refs/tags/')
run: mike set-default stable --push --rebase

# This is for develop
- name: Deploy latest develop snapshot docs to GH pages.
if: github.ref == 'refs/heads/develop'
run: mike deploy snapshot --push --rebase
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: lib/coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml
coverage-reports: examples/coverage-aggregate/target/site/jacoco-aggregate/jacoco.xml
38 changes: 15 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,31 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.holixon.axon.avro/axon-avro-serializer/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.holixon.axon.avro/axon-avro-serializer)
[![codecov](https://codecov.io/gh/holixon/axon-avro-serializer/branch/develop/graph/badge.svg?token=ZKDNW1QJ1Y)](https://codecov.io/gh/holixon/axon-avro-serializer)

__DISCLAIMER__: early draft, heavy development, *everything* might still change

* DISCLAIMER: early draft, heavy development, *everything* might still change
This extension to the [Axon Framework](https://docs.axoniq.io/reference-guide/) aims to provide support for serialization of Axon messages (commands, events, queries) with the [Apache Avro](https://avro.apache.org/docs/current/) data format.

This extension to the [axon framework](https://docs.axoniq.io/reference-guide/) aims to provide support for serialization of axon messages (commands, events, queries) with the [apache avro](https://avro.apache.org/docs/current/) data format.

Avro is a schema based data format that can be serialized to JSON and byte sequence, which is useful to minimize
the disk space needed for your axon event store and bandwidth used for transport.
Avro is a schema-based data format that can be serialized to JSON or byte sequence, which is useful to minimize
the disk space needed for your Axon event store and bandwidth used for transport.
Messages can be validated against a schema version and avro supports schema evolution by automatically determining
[`compatibility modes`](https://docs.confluent.io/platform/current/schema-registry/avro.html) between different revisions.

see on [component overview](file:/docs/README.md)


[compatibility modes](https://docs.confluent.io/platform/current/schema-registry/avro.html) between different revisions.

see on [component overview](file:/notes/README.md)

## Links

* [Avro Registry Adapter](https://github.com/holixon/avro-registry-adapter) - used to abstract from concrete schema registry
* <https://hub.docker.com/r/axoniq/axonserver>


AVRO Serialization for Axon axon.serializer.[command|event|general]

* [Avro Registry Adapter](https://github.com/holixon/avro-registry-adapter) - used to abstract from concrete schema registry
* <https://hub.docker.com/r/axoniq/axonserver>

## Notes

* <https://github.com/sksamuel/avro4k>
* <https://www.baeldung.com/java-apache-avro>
* <https://avro.apache.org/docs/current/gettingstartedjava.html>
* <http://bigdatums.net/2016/01/20/simple-apache-avro-example-using-java/>
* <http://www.soutier.de/blog/2017/03/07/daten-modellieren-avro/>
* <https://github.com/sksamuel/avro4k>
* <https://www.baeldung.com/java-apache-avro>
* <https://avro.apache.org/docs/current/gettingstartedjava.html>
* <http://bigdatums.net/2016/01/20/simple-apache-avro-example-using-java/>
* <http://www.soutier.de/blog/2017/03/07/daten-modellieren-avro/>

### great

* <https://blog.cloudera.com/robust-message-serialization-in-apache-kafka-using-apache-avro-part-1/>
* <https://github.com/cloudera/kafka-examples>
* <https://blog.cloudera.com/robust-message-serialization-in-apache-kafka-using-apache-avro-part-1/>
* <https://github.com/cloudera/kafka-examples>
26 changes: 26 additions & 0 deletions detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# see https://github.com/arturbosch/detekt/blob/master/detekt-cli/src/main/resources/default-detekt-config.yml
#
comments:
active: true
excludes: "examples/**,lib/**,**/test/**,**/*Test.kt,*/src/test/kotlin/**/*.kt,**/*Stages.kt,**/*ITest.kt"
CommentOverPrivateFunction:
active: false
CommentOverPrivateProperty:
active: false
EndOfSentenceFormat:
active: false
endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!:]$)
UndocumentedPublicClass:
active: true
searchInNestedClass: true
searchInInnerClass: true
searchInInnerObject: true
searchInInnerInterface: true
UndocumentedPublicFunction:
active: true

performance:
active: true
SpreadOperator:
active: false
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.holixon.io
49 changes: 49 additions & 0 deletions docs/assets/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* General customizations
*/
/* Customize logo size */
.md-header__button.md-logo img, .md-header__button.md-logo svg {
height: 100%;
width: 100%;
}

/* Disable title text*/
.md-header__title .md-ellipsis {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important; /* Fix for https://github.com/twbs/bootstrap/issues/25686 */
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}

[data-md-color-scheme="default"] {
/*
Polyflow color scheme
*/
--monochrome-80: #3e3e3e;
--background-white: #ffffff;
--monochrome-70: #4c4c4c;
--secondary-100: #ebf9fa;
--background-blue: #0a0b31;
--monochrome-20: #cccccc;
--monochrome-50: #7f7f7f;
--monochrome-5: #f2f2f2;
--accent-success-100: #00cc75;
--accent-error-100: #b3003e;
--accent-error-10: #f2e0e6;
--accent-1-100: #6bdce0;
--accent-3-100: #830289;
--accent-4-100: #016db3;
--pumpkin-orange: #fb7b00;
--royal: #0d0f7e;


--md-primary-fg-color: var(--accent-4-100);
--md-accent-fg-color: var(--pumpkin-orange);
--md-footer-bg-color: var(--accent-4-100);
}

Binary file added docs/assets/img/holixon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added docs/index.md
Empty file.
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdocs
mkdocs-git-committers-plugin
mkdocs-material
mike
mkdocs-git-revision-date-localized-plugin
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

@SpringBootApplication
@Import({AxonServerConfiguration.class})
public class BankAccountExampleApplication implements CommandLineRunner {

public static void main(String[] args) {
SpringApplication.run(BankAccountExampleApplication.class, args);
}

@Autowired
private AvroSchemaRegistry schemaRegistry;

@Override
public void run(String... args) throws Exception {

}

/**
* Starts the application.
* @param args line params.
*/
public static void main(String[] args) {
SpringApplication.run(BankAccountExampleApplication.class, args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class BankAccountExampleAggregate {

@AggregateIdentifier
private String bankAccountId;

private int currentBalance;

@CommandHandler
Expand All @@ -31,13 +30,6 @@ public static BankAccountExampleAggregate create(final CreateBankAccountCommand
return new BankAccountExampleAggregate();
}

@EventSourcingHandler
void on(BankAccountCreatedEvent evt) {
this.bankAccountId = evt.getBankAccountId();
this.currentBalance = evt.getInitialBalance();
}


@CommandHandler
void handle(DepositMoneyCommand cmd) {
checkArgument(cmd.getAmount() > 0, "amount must be > 0");
Expand All @@ -48,11 +40,6 @@ void handle(DepositMoneyCommand cmd) {
.build());
}

@EventSourcingHandler
void on(MoneyDepositedEvent evt) {
this.currentBalance += evt.getAmount();
}

@CommandHandler
void handle(WithdrawMoneyCommand cmd) {
checkArgument(cmd.getAmount() > 0, "amount must be > 0");
Expand All @@ -64,6 +51,17 @@ void handle(WithdrawMoneyCommand cmd) {
.build());
}

@EventSourcingHandler
void on(MoneyDepositedEvent evt) {
this.currentBalance += evt.getAmount();
}

@EventSourcingHandler
void on(BankAccountCreatedEvent evt) {
this.bankAccountId = evt.getBankAccountId();
this.currentBalance = evt.getInitialBalance();
}

@EventSourcingHandler
void on(MoneyWithdrawnEvent evt) {
this.currentBalance -= evt.getAmount();
Expand Down
2 changes: 1 addition & 1 deletion examples/bankaccount-springboot-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.avro._</groupId>
<artifactId>examples</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion examples/coverage-aggregate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>io.holixon.axon.avro._</groupId>
<artifactId>examples</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</parent>

<artifactId>coverage-aggregate</artifactId>
Expand Down
11 changes: 8 additions & 3 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
version: '3.1'
version: '3.3'
# https://hub.docker.com/r/axoniq/axonserver
services:
axon-server:
image: axoniq/axonserver:4.5.2
image: axoniq/axonserver:4.5.5
environment:
- AXONIQ_AXONSERVER_DEVMODE_ENABLED=true
- SPRING_SERVLET_MULTIPART_MAX-FILE-SIZE=128MB
- SPRING_SERVLET_MULTIPART_MAX-REQUEST-SIZE=128MB
ports:
- "8024:8024"
- "8124:8124"
Expand All @@ -16,7 +18,10 @@ services:
POSTGRES_USER: apicurio-registry
POSTGRES_PASSWORD: password
registry:
image: apicurio/apicurio-registry-sql:2.0.0.Final
hostname: apicurio
image: apicurio/apicurio-registry-sql:2.0.1.Final
expose:
- "8080"
ports:
- "7777:8080"
environment:
Expand Down
3 changes: 2 additions & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holixon.axon.avro._</groupId>
<artifactId>axon-avro-serializer_</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</parent>

<artifactId>examples</artifactId>
Expand All @@ -17,6 +17,7 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<maven.sources.skip>true</maven.sources.skip>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<gpg.skip>true</gpg.skip>

<springdoc.version>1.5.10</springdoc.version>
Expand Down
Loading

0 comments on commit e50d702

Please sign in to comment.