Skip to content
/ j-id Public

The j-id is a distributed ID generator based on the snowflake algorithm, which relies on redis/zookeeper to determine the machine serial number.

Notifications You must be signed in to change notification settings

tripluo/j-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

j-id 提供 依托redis/zookeeper确定机器序号,基于snowflake算法的分布式ID生成器。

● require jdk 1.8+

● require slf4j

changelog

Maven:

<dependency>
    <groupId>net.jrouter</groupId>
    <artifactId>j-id</artifactId>
    <version>1.4</version>
</dependency>

spring-boot配置:

Sample application.properties

#id service properties (IdServiceProperties)
# default: true
net.jrouter.id.enable-local-file-storager=false
# default: /distributed.id
net.jrouter.id.local-file=localhost
# default: distributed.id
net.jrouter.id.redis-hash-key=distributed.id
# default: distributed.id
net.jrouter.id.zk-path=distributed.id
#default: redis, optional: (redis/zookeeper/local/manual)
net.jrouter.id.generator-type=redis
#default: 0, effective when "generatorType=manual"
net.jrouter.id.manual-worker-id=100

About

The j-id is a distributed ID generator based on the snowflake algorithm, which relies on redis/zookeeper to determine the machine serial number.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages