Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8abe19e
[maven-release-plugin] prepare release axonserver-connector-java-2023…
m1l4n54v1c Jun 20, 2023
9c3d167
[maven-release-plugin] prepare for next development iteration
m1l4n54v1c Jun 20, 2023
b3d0c11
[maven-release-plugin] rollback the release of axonserver-connector-j…
m1l4n54v1c Jun 20, 2023
65a1665
Merge remote-tracking branch 'origin/master'
m1l4n54v1c Mar 20, 2024
534a108
Added DcbEventChannel with methods for appending events and requestin…
m1l4n54v1c Mar 20, 2024
fc8c1c3
Adapted to the latest API changes.
m1l4n54v1c Dec 13, 2024
7857fd1
Merge remote-tracking branch 'origin/master' into feature/dcb
m1l4n54v1c Dec 23, 2024
d76f015
Adapted to the latest API changes.
m1l4n54v1c Apr 8, 2025
71f506e
Added head, tail, and tagsFor methods.
m1l4n54v1c Apr 8, 2025
49321b1
Added stream test.
m1l4n54v1c Apr 10, 2025
8057e15
Added a few more tests for the DCB.
m1l4n54v1c Apr 11, 2025
06f123b
Added a few more tests for the DCB.
m1l4n54v1c Apr 15, 2025
f487f05
Added a few more tests for the DCB.
m1l4n54v1c Apr 15, 2025
49f3231
- Removed unnecessary imports.
m1l4n54v1c Apr 17, 2025
270a7a6
Merge remote-tracking branch 'origin/master' into feature/dcb
m1l4n54v1c Apr 17, 2025
0546d69
- Added few more stream tests.
m1l4n54v1c Apr 21, 2025
ecb9ef7
Merge branch 'master' of github.com:AxonIQ/axonserver-connector-java …
silvanob Apr 25, 2025
c80a41b
Update API version to 2025.1.0-SNAPSHOT
smcvb Apr 28, 2025
4d93e24
- Added support for creation of dcb contexts.
m1l4n54v1c Apr 28, 2025
ef58769
- Tests are now resilient to non-emptiness of the event store.
m1l4n54v1c Apr 28, 2025
7452dbc
Add mechanism to get Axon Server image
smcvb Apr 29, 2025
914c49e
Adjusted assert message.
m1l4n54v1c May 5, 2025
703fbfc
- Adapted append test to check the response to append events accordin…
m1l4n54v1c May 5, 2025
a08bb0c
Merge remote-tracking branch 'origin/feature/dcb' into feature/dcb
m1l4n54v1c May 5, 2025
63cf8e9
getSequenceAt impl
schananas May 6, 2025
994df79
Add Axon Server image env variable
smcvb May 13, 2025
73d654d
Add log statement to see it work
smcvb May 13, 2025
d0c7f01
Update src/main/java/io/axoniq/axonserver/connector/AxonServerConnect…
m1l4n54v1c May 13, 2025
eebfea6
Update src/main/java/io/axoniq/axonserver/connector/event/DcbEventCha…
m1l4n54v1c May 13, 2025
449655a
Update src/main/java/io/axoniq/axonserver/connector/event/DcbEventCha…
m1l4n54v1c May 13, 2025
3d08ed0
Update src/main/java/io/axoniq/axonserver/connector/event/impl/DcbEve…
m1l4n54v1c May 13, 2025
b698419
getSequenceAt issues
schananas May 13, 2025
0a1f4ae
getSequenceAt integration tests
schananas May 14, 2025
ad0ddc2
Merge remote-tracking branch 'origin/feature/dcb' into feature/dcb
schananas May 14, 2025
c12a811
getSequenceAt integration tests
schananas May 14, 2025
2b2dc21
getSequenceAt integration tests
schananas May 14, 2025
782c57f
- Removed unnecessary println.
m1l4n54v1c May 15, 2025
b2163ad
- Removed unnecessary GetHeadRequest and GetTailParameters.
m1l4n54v1c May 15, 2025
c5c24c2
- Streamlined startTransaction API
m1l4n54v1c May 15, 2025
e3b1818
- Collect stream buffers on creation so they can be closed on reconne…
m1l4n54v1c May 15, 2025
54190c5
- Changed the default values for buffer size and refill batch.
m1l4n54v1c May 15, 2025
c60aba8
- Changed the api of the stream method to allow customization of buff…
m1l4n54v1c May 15, 2025
58e28dd
- Simplified tagsFor API.
m1l4n54v1c May 15, 2025
4ea6e78
Update src/main/java/io/axoniq/axonserver/connector/event/DcbEventCha…
m1l4n54v1c May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Set Axon Server Image environment variable
id: step_one
run: |
echo "AXON_SERVER_IMAGE=${{ secrets.AXON_SERVER_IMAGE }}" >> "$GITHUB_ENV"

- name: Build and Test with Sonar Analysis
if: matrix.sonar-enabled
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Set Axon Server Image environment variable
id: step_one
run: |
echo "AXON_SERVER_IMAGE=${{ secrets.AXON_SERVER_IMAGE }}" >> "$GITHUB_ENV"

- name: Build and Test with Sonar Analysis
if: matrix.sonar-enabled
run: |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<sonar.organization>axoniq</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

<axonserver.api.version>2024.1.0</axonserver.api.version>
<axonserver.api.version>2025.1.0-SNAPSHOT</axonserver.api.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to make sure that we construct a pull request for this Axon Server API before we can go ahead with this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to merge it even to have a snapshot right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, exactly!


<grpc.version>1.69.0</grpc.version>
<protobuf.version>4.30.2</protobuf.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.axoniq.axonserver.connector.admin.AdminChannel;
import io.axoniq.axonserver.connector.command.CommandChannel;
import io.axoniq.axonserver.connector.control.ControlChannel;
import io.axoniq.axonserver.connector.event.DcbEventChannel;
import io.axoniq.axonserver.connector.event.EventChannel;
import io.axoniq.axonserver.connector.event.transformation.EventTransformationChannel;
import io.axoniq.axonserver.connector.query.QueryChannel;
Expand Down Expand Up @@ -80,6 +81,14 @@ public interface AxonServerConnection {
*/
EventChannel eventChannel();

/**
* Returns the channel on which Event related interactions can be performed with Axon Server using the Dynamic
* Consistency Boundary concept.
*
* @return the channel for Event messaging
*/
DcbEventChannel dcbEventChannel();

/**
* Returns the channel on which Query related interactions can be performed with AxonServer.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/*
* Copyright (c) 2020-2024. AxonIQ
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.axoniq.axonserver.connector.event;

import io.axoniq.axonserver.connector.ResultStream;
import io.axoniq.axonserver.grpc.event.dcb.AppendEventsResponse;
import io.axoniq.axonserver.grpc.event.dcb.ConsistencyCondition;
import io.axoniq.axonserver.grpc.event.dcb.GetHeadRequest;
import io.axoniq.axonserver.grpc.event.dcb.GetHeadResponse;
import io.axoniq.axonserver.grpc.event.dcb.GetSequenceAtRequest;
import io.axoniq.axonserver.grpc.event.dcb.GetSequenceAtResponse;
import io.axoniq.axonserver.grpc.event.dcb.GetTagsRequest;
import io.axoniq.axonserver.grpc.event.dcb.GetTagsResponse;
import io.axoniq.axonserver.grpc.event.dcb.GetTailRequest;
import io.axoniq.axonserver.grpc.event.dcb.GetTailResponse;
import io.axoniq.axonserver.grpc.event.dcb.SourceEventsRequest;
import io.axoniq.axonserver.grpc.event.dcb.SourceEventsResponse;
import io.axoniq.axonserver.grpc.event.dcb.StreamEventsRequest;
import io.axoniq.axonserver.grpc.event.dcb.StreamEventsResponse;
import io.axoniq.axonserver.grpc.event.dcb.TaggedEvent;

import java.util.Collection;
import java.util.concurrent.CompletableFuture;

/**
* Communication channel for Event related interaction with Axon Server based on the Dynamic Consistency Boundaries
* concept.
*
* @author Milan Savic
* @since 2025.1.0
*/
public interface DcbEventChannel {

/**
* Starts a new transaction to append events.
*
* @return the transaction reference onto which to register events to append along with the condition
*/
AppendEventsTransaction startTransaction();

/**
* Provides an infinite stream of events.
*
* @param request the request used to filter events
* @return an infinite stream of events
*/
ResultStream<StreamEventsResponse> stream(StreamEventsRequest request);

/**
* Provides a finite stream of events used to eventsource a model.
*
* @param request the query used to filter out events for sourcing
* @return the response containing events to source a model and a consistency marker to be used when trying to
* append new events to the event store
*/
ResultStream<SourceEventsResponse> source(SourceEventsRequest request);

/**
* Provides tags for an event at the given global sequence.
*
* @param request the sequence of an event
* @return the tags fo the event
*/
CompletableFuture<GetTagsResponse> tagsFor(GetTagsRequest request);

/**
* Provides the head of the event store.
*
* @param request empty request
* @return the head of the event store
*/
CompletableFuture<GetHeadResponse> head(GetHeadRequest request);

/**
* Provides the tail of the event store.
*
* @param request empty request
* @return the tail of the event store
*/
CompletableFuture<GetTailResponse> tail(GetTailRequest request);

/**
* Provides the sequence number of the event closest to the given timestamp.
* If the timestamp is before the first event, returns the tail sequence.
* If the timestamp is after the last event, returns the head sequence.
*
* @param request the request containing the timestamp to find the sequence for
* @return the sequence at the given timestamp
*/
CompletableFuture<GetSequenceAtResponse> getSequenceAt(GetSequenceAtRequest request);

/**
* Provides operations to interact with a Transaction to append events and a condition onto the Event Store.
*/
interface AppendEventsTransaction {

/**
* Sets the Consistency Condition for the transaction. Axon Server will validate this condition against the
* Event Store and based on the validation outcome will accept or reject the transaction.
*
* @param condition the Consistency Condition used to validate the Transaction
* @return this Transaction for fluency
*/
AppendEventsTransaction condition(ConsistencyCondition condition);

/**
* Appends this {@code taggedEvent} to this transaction.
*
* @param taggedEvent the event to be appended
* @return this Transaction for fluency
*/
AppendEventsTransaction append(TaggedEvent taggedEvent);

/**
* Appends all events from the collection of {@code taggedEvents} to this transaction
*
* @param taggedEvents the collection of events to be appended
* @return this Transaction for fluency
*/
default AppendEventsTransaction appendAll(Collection<TaggedEvent> taggedEvents) {
taggedEvents.forEach(this::append);
return this;
}

/**
* Commits this Transaction.
*
* @return the future that completes once the Axon Server commits this Transaction, containing the append events response as a result.
*/
CompletableFuture<AppendEventsResponse> commit();

/**
* Rolls back the transaction.
*/
void rollback();
}
}
Loading