Skip to content

Commit

Permalink
Merge pull request #27 from vinted/chore/update-docs
Browse files Browse the repository at this point in the history
chore: add async connector example
  • Loading branch information
gintarasm authored Apr 5, 2024
2 parents 9905530 + e3b8b26 commit 04101dc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ var bigQuerySink = BigQueryStreamSink.<String>newBuilder()
.build();
```

Async connector for at least once delivery

```java
var credentials = new JsonCredentialsProvider("key");

var clientProvider = new AsyncClientProvider<String>(credentials,
WriterSettings.newBuilder()
.build()
);

var sink = AsyncBigQuerySink.builder()
.setRowSerializer(new NoOpRowSerializer<>())
.setClientProvider(clientProvider)
.setMaxBatchSize(30)
.setMaxBufferedRequests(10)
.setMaxBatchSizeInBytes(10000)
.setMaxInFlightRequests(4)
.setMaxRecordSizeInBytes(10000)
.build();
```

The sink takes in a batch of records. Batching happens outside the sink by opening a window. Batched records need to implement the BigQueryRecord interface.

```java
Expand Down

0 comments on commit 04101dc

Please sign in to comment.