Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 2.38 KB

README.md

File metadata and controls

78 lines (57 loc) · 2.38 KB

vert.x-memcache

License: Apache 2 Travis Build Maven Artifact

This is an async library for sending commands to Memcache.

Usage

Configuration for Memcache Verticle:

{
    "memcacheClusterConfig": {
        "eventBusAddressPrefix": "address_where_memcache_handler_is_registered",
        "clusters": {
            "cluster_name_here": {
                "servers": ["hostname:11211"],
                "namespace": "memcache-namespace"
            }
        }
    }
}

Setting up a client and calling a simple get:

MemcacheClusterConfig memcacheConfig = new MemcacheClusterConfig(container.config().getObject("memcacheClusterConfig"));
MemcacheClusterClientFactory clientFactory = new MemcacheClusterClientFactory(vertx.eventBus(), memcacheConfig);
MemcacheClient memcacheClient = clientFactory.getClient("cluster_name_here");
Future<JsonObject> result = memcacheClient.get("some-key");

The JsonObject in the future result will be in a Jsend format. In the case of the get call above it will be similar to:

{
    "status": "success",
    "data": {
        "some-key": "value"
    }
}

Results in the data block will vary based on the Memcache method being called.

Building

Prerequisites:

Building:

vertx-memcache> mvn verify

To use the local version you must first install it locally:

vertx-memcache> mvn install

You can determine the version of the local build from the pom file. Using the local version is intended only for testing or development.

License

Published under Apache Software License 2.0, see LICENSE

© Groupon Inc., 2014