Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

KurrentDB Java Client

License

NotificationsYou must be signed in to change notification settings

kurrent-io/KurrentDB-Client-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kurrent

KurrentDB Java Client

CI

KurrentDB is the event-native database, where business events are immutably stored and streamed. Designed for event-sourced, event-driven, and microservices architectures.

This repository contains anKurrentDB Client SDK written in Java for use with languages on the JVM. It iscompatible with Java 8 and above.

Note: This client is currently under active development and further API changes are expected. Feedback is very welcome.

Documentation

Access to binaries

Kurrent, Inc publishes GA (general availability) versions toMaven Central.

Snapshot versions

Snapshot versions are pushed on Sonatype Snapshots Repository every time a pull request is merged in the main branchtrunk.The snippet below shows how to use the Sonatype Snapshots Repository using the Gradle build tool.

repositories {...    maven {        url uri('https://oss.sonatype.org/content/repositories/snapshots')    }...}

Developing

The SDK is built usingGradle. Integration tests run against a server using Docker.

Run tests

Tests are written usingTestContainers and requireDocker to be installed.

Specific docker images can be specified via the environment variableEVENTSTORE_IMAGE.

Open Telemetry

Tracing is the only telemetry currently exported, specifically for theAppend andSubscribe (Catchup and Persistent) operations.

For more information about Open Telemetry, refer to theofficial documentation.

KurrentDB Server Compatibility

This client is compatible with version20.6.1 upwards.

Server setup instructions can be found in thedocs, follow the docker setup for the simplest configuration.

Example

The following snippet showcases a simple example where we form a connection, then write and read events from the server.

Note: If testing locally using--insecure the url should bekurrentdb://localhost:2113?tls=false.

classAccountCreated {privateUUIDid;privateStringlogin;publicUUIDgetId() {returnid;    }publicStringgetLogin() {returnlogin;    }publicvoidsetId(UUIDid) {this.id =id;    }publicvoidsetLogin(Stringlogin) {this.login =login;    }}
importio.kurrent.dbclient.KurrentDBClient;importio.kurrent.dbclient.KurrentDBClientSettings;importio.kurrent.dbclient.KurrentDBConnectionString;importio.kurrent.dbclient.EventData;importio.kurrent.dbclient.ReadStreamOptions;importio.kurrent.dbclient.ResolvedEvent;importio.kurrent.dbclient.WriteResult;importio.kurrent.dbclient.ReadResult;publicclassMain {publicstaticvoidmain(Stringargs[]) {KurrentDBClientSettingssetts =KurrentDBConnectionString.parseOrThrow("kurrentdb://localhost:2113");KurrentDBClientclient =KurrentDBClient.create(setts);AccountCreatedcreatedEvent =newAccountCreated();createdEvent.setId(UUID.randomUUID());createdEvent.setLogin("ouros");EventDataevent =EventData                .builderAsJson("account-created",createdEvent)                .build();WriteResultwriteResult =client                .appendToStream("accounts",event)                .get();ReadStreamOptionsreadStreamOptions =ReadStreamOptions.get()                .fromStart()                .notResolveLinkTos();ReadResultreadResult =client                .readStream("accounts",1,readStreamOptions)                .get();ResolvedEventresolvedEvent =readResult                .getEvents()                .get(0);AccountCreatedwrittenEvent =resolvedEvent.getOriginalEvent()                .getEventDataAs(AccountCreated.class);// Doing something productive...    }}

Projections

This client currently supports creating and getting the result of a continuous projection.

Create a projection:

KurrentDBClientSettingssetts =KurrentDBConnectionString.parseOrThrow("kurrentdb://localhost:2113");KurrentDBProjectionManagementClientclient =KurrentDBProjectionManagementClient.create(setts);client    .createContinuous(PROJECTION_NAME,PROJECTION_JS)    .get();

Define a class in which to deserialize the result:

publicclassCountResult {privateintcount;publicintgetCount() {returncount;    }publicvoidsetCount(finalintcount) {this.count =count;    }}

Get the result:

CountResultresult =client    .getResult(PROJECTION_NAME,CountResult.class)    .get();

For further details please seethe projection management tests.

Support

Information on support can be found on our website:Kurrent Support

Documentation

Documentation for KurrentDB can be found in thedocs.

Bear in mind that this client is not yet properly documented. We are working hard on a new version of the documentation.

Security

If you find a vulnerability in our software, please contact us. You can find how to reach out us and report it athttps://www.kurrent.io/security#securityThank you very much for supporting our software.

Communities

Contributing

All contributions to the SDK are made via GitHub Pull Requests, and must be licensed under the Apache 2.0 license. Pleasereview ourContributing Guide andCode of Conduct for more information.


[8]ページ先頭

©2009-2025 Movatter.jp