- README.md: Updated documentation to reflect project scope and functionality
- pom.xml: logback bump, rem okhttp3, add javalin, brotli4j, minor beautification, version number
- logback-{docker, bare}.xml: Added additional rolling files for debug and trace
- SnowflakeService.java: Added documentation, removed orchestration, added webserver
- SnowflakeIDGenerator.java: added documentation, removed unused methods
- ConfigurationValues.java: added documentation
SnowflakeService
A tool/microservice to centrally generate snowflake IDs.
Acknowledgements
This utility uses:
- The format and name of Twitter's Snowflake IDs
- Javalin
- QOS.CH's Logback
- Google's gson
- hyperxpro's Brotli4j
- B00tLoad_'s ConfigurationUtilities
Installation
Docker (Recommended)
docker pull bootmediaalix/snowflakeservice
docker run bootmediaalix/snowflakeservice -e %{set required .env, see below} -p 95674:95674 -v /data/b00tload-services/snowflake:%desired path on host%
Containerless
A containerless installation is possible, although not supported. For development convenience the application base directory is located in ~/.b00tload-services/snowflake instead of /data/b00tload-services/snowflake.
If you want to work containerless you are on your own.
Environment Variables
To run this project, you may add the following environment variables to your .env file
EPOCH - the starting time of the snowflake (defaults to 01.01.2024 12:00 AM)
MACHINE_ID_BITS - the amount of bits used for the machine ID
SEQUENCE_BITS - the amount of bits used for the sequence counter
MACHINE_ID - the ID of the generator
API Reference
Get an ID
GET /generate
Response example:
{
"id": "50990430426234880"
}
Maintainer
License
Support
For support, open a ticket or email me at alix (at) ja-lol-ey (dot) de.