This repository has been archived on 2026-05-07 . You can view files and clone it. You cannot open issues or pull requests or push a commit.
b4510b30f54d98dd2619140dd34af4f43c69ccc8
pom.xml: Bump version, update dependencies Dockerfile: Added build step, Added healthcheck SnowflakeService.java: added endpoint for health check
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 -e %{set required .env, see below} -p 9567:9567 -v %{desired path on host}:/data/b00tload-tools/snowflake bootmediaalix/snowflakeservice
Containerless
A containerless installation is possible, although not supported. For development convenience the application base directory is located in ~/.b00tload-tools/snowflake instead of /data/b00tload-tools/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.