The Builder class of org.apache.tinkerpop.gremlin.driver.message.RequestMessage class sets its requestId field as UUID.randomUUID() by default.
But I think it should be fixed not to be set by default. The reasons are below;
- UUID.randomUUID() uses SecureRandom which grabs the lock at JVM level,
which means whole threads calling this API compete against each other.
- Getting random value from SecureRandom is somewhat CPU-intensive job.
- If a gremlin client sends requestId by itself, the costs above are useless.