drtrang / zkconfig-resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zkconfig-resources Build Status

ZooKeeper节点缓存,基于CuratorFramework封装

  • 节点变更时,旧资源清理机制
  • 强类型泛型支持
  • 只支持Java8

Get Started

<dependency>
    <groupId>com.github.phantomthief</groupId>
    <artifactId>zkconfig-resources</artifactId>
    <version>1.1.21</version>
</dependency>
ZkBasedNodeResource<ShardedJedisPool> node = ZkBasedNodeResource.<ShardedJedisPool> newBuilder() //
                .withCacheFactory(ZKPaths.makePath("/redis", monitorPath), ZkClientHolder::get) //
                .withStringFactory(this::initObject) //
                .withCleanup(ShardedJedisPool::close) //
                .build();

ShardedJedisPool pool = node.get();                

About

License:Artistic License 2.0


Languages

Language:Java 94.3%Language:Kotlin 5.7%