-
Couldn't load subscription status.
- Fork 14
Use UUID7 #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the fjage framework from using standard UUID4 to UUID7 for message IDs. UUID7 provides time-based sorting capabilities and embedded timestamps, which enables better message ordering and metrics collection.
Key changes:
- Implements UUID7 generation across all supported languages (Java, Python, JavaScript, C)
- Updates message creation to use UUID7 instead of UUID4
- Adjusts tests to accommodate UUID7's longer string format
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/org/arl/fjage/UUID7.java |
New Java implementation of UUID7 with timestamp extraction and UUID compatibility |
src/main/java/org/arl/fjage/Message.java |
Updated to use UUID7 for message ID generation |
gateways/python/fjagepy/__init__.py |
Updated Python gateway to use UUID7 for message IDs and request IDs |
gateways/python/fjagepy/UUID7.py |
New Python implementation of UUID7 with comparable interface |
gateways/js/test/spec/fjage.spec.js |
Updated test to handle UUID7's variable length format |
gateways/js/src/utils.js |
Added JavaScript UUID7 implementation |
gateways/js/src/message.js |
Updated JavaScript message creation to use UUID7 |
gateways/c/src/fjage.c |
Added C implementation of UUID7 and updated message/request ID generation |
Comments suppressed due to low confidence (1)
gateways/python/fjagepy/init.py:601
- The removal of UUID parsing logic in the dispatch function may cause issues if the system still receives UUID4 format IDs from older clients or during migration. The code should handle both UUID4 and UUID7 string formats.
rsp = dict()
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…essage.id in fjage Java implementation and also the JS, Python, and C gateways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we benchmarked the performance of UUID7 vs the Java UUID implementation we were using to know the impact? Also, we need to add this to Fjage.jl too.
No. I can do this, although I doubt it would be critical. |
|
I did a Java Micro Benchmark using the implementation in this PR and the attached JMH test harness. Results :
So if anything the UUID7 implementation is faster that the default JDK based one. |
We need UUID when creating new
Message.msgIDandJSONMessage.idfor fjage. Historically we used various UUID/GUID implementations mainly from standard library but sometimes custom. The main requirement is uniqueness across all messages send in a single fjage "universe".While the previous implementations of UUID/GUID were sufficient for that, the new (and upcoming) UUID7 standard has a couple of useful features.
msgID.See more : http://uuid7.com/