Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion docs/api/appending-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ Check the [Getting Started](getting-started.md) guide to learn how to configure

The simplest way to append an event to KurrentDB is to create an `EventData` object and call `appendToStream` method.

```java {32-43}
```java {38-49}
import io.kurrent.dbclient.AppendToStreamOptions;
import io.kurrent.dbclient.EventData;
import io.kurrent.dbclient.StreamState;

import java.util.UUID;

class OrderPlaced {
private String orderId;
private String customerId;
Expand Down
7 changes: 7 additions & 0 deletions docs/api/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ When connecting to an insecure instance, specify `tls=false` parameter. For exam
First, create a client and get it connected to the database.

```java
import io.kurrent.dbclient.KurrentDBClient;
import io.kurrent.dbclient.KurrentDBClientSettings;
import io.kurrent.dbclient.KurrentDBConnectionString;

KurrentDBClientSettings settings = KurrentDBConnectionString.parseOrThrow("kurrentdb://localhost:2113?tls=false");
KurrentDBClient client = KurrentDBClient.create(settings);
```
Expand All @@ -115,6 +119,9 @@ You can write anything to KurrentDB as events. The client needs a byte array as
The code snippet below creates an event object instance, serializes it, and adds it as a payload to the `EventData` structure, which the client can then write to the database.

```java
import io.kurrent.dbclient.EventData;
import com.fasterxml.jackson.databind.json.JsonMapper;

public class OrderPlaced {
private String orderId;
private String customerId;
Expand Down
Loading