Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.86 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.86 KB

Aerospike Reactive Java Client

Build

This repository provides reactive extensions for the Aerospike Java Client.

Reactor

Maven Central javadoc

Package

Aerospike Reactor Client - a Reactor interface extension for the Aerospike Java Client.

Usage

The documentation for this project can be found on javadoc.io.

This project can be added through Maven Central.

Create a Reactor client

// Create a ClientPolicy.
ClientPolicy policy = new ClientPolicy();
// Set event loops to use in asynchronous commands.
policy.eventLoops = new NioEventLoops(1);

// Instantiate an AerospikeReactorClient which embeds an AerospikeClient.
AerospikeClient client = new AerospikeClient(policy, "localhost", 3000);
AerospikeReactorClient reactorClient = new AerospikeReactorClient(client);

Write record bin(s) using the Reactor client

Key key = new Key("test", null, "k1");
reactorClient.put(key, new Bin("bin1", 100)).block();

Get the record using the Reactor client

reactorClient.get(key).block();

Delete the record using the Reactor client

reactorClient.delete(key).block();

Check the tests for more usage examples.

Prerequisites

  • Java 8 or greater.
  • Maven 3.0 or greater.

Build

mvn clean package