Skip to content

PhonePe/aerospike-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Aerospike Bundle

A Dropwizard bundle for seamless Aerospike integration with metrics, interceptors, and dual-mode operations.

Build SonarCloud Quality Gate Status Coverage Bugs Vulnerabilities Code Smells Technical Debt Duplicated Lines (%) Reliability Rating Security Rating Maintainability Rating License Maven Central Java

Overview

Aerospike Bundle is a Java library that provides a production-ready Dropwizard bundle for connecting to Aerospike clusters. It handles client lifecycle, policy configuration, health checks, metrics, pluggable interceptors, and multi-cluster routing out of the box.

Features

  • Dropwizard Integration -- lifecycle-managed Aerospike client
  • Configurable Policies -- read, write, scan, query, batch
  • Health Checks -- automatic cluster health monitoring
  • Metrics & Interceptors -- built-in metric collection with a pluggable interceptor chain
  • Dual-Mode Operations -- route reads/writes to different clusters
  • TLS Support -- configurable TLS policies and protocols
  • Namespace Management -- tag-based namespace resolution
  • XDR Lag Monitoring -- cross-datacenter replication lag visibility

Quick Start

1. Add Dependency

Maven

<dependency>
    <groupId>com.phonepe</groupId>
    <artifactId>aerospike-bundle</artifactId>
    <version>${aerospike-bundle.version}</version>
</dependency>

Note: Find the latest version on Maven Central.

2. Configure

aerospike:
  modeOfOperationType: DEFAULT_MODE
  aerospikeConfiguration:
    id: "primary"
    hosts:
      - host: "localhost"
        port: 3000
    retries: 5
    maxConnectionsPerNode: 10
    healthcheckEnabled: true

3. Register the Bundle

public class MyApplication extends Application<MyAppConfiguration> {

    private final AerospikeBundle<MyAppConfiguration> aerospikeBundle =
        new AerospikeBundle<MyAppConfiguration>() {
            @Override
            protected AerospikeBundleConfig configuration(MyAppConfiguration config) {
                return config.getAerospike();
            }
        };

    @Override
    public void initialize(Bootstrap<MyAppConfiguration> bootstrap) {
        bootstrap.addBundle(aerospikeBundle);
    }

    @Override
    public void run(MyAppConfiguration config, Environment environment) {
        IAerospikeClient client = aerospikeBundle.getAerospikeClient();
        // Use the client
    }
}

API Overview

Class Method Description
AerospikeBundle<T> getAerospikeClient() Get the configured client
registerInterceptor(...) Add custom interceptor
getXdrReplicationLag() Get XDR lag details
AerospikeConfiguration getNamespaceFor(tag) Resolve namespace by tag

Documentation

Full documentation is available at the project docs site.

Contributing

See CONTRIBUTING.md.

Code of Conduct

See CODE_OF_CONDUCT.md.

License

Distributed under the Apache 2.0 License.

About

Dropwizard bundle for seamless Aerospike integration with metrics, interceptors, and dual-mode operations

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages