I've filed https://jira.springsource.org/browse/INT-1903. Although we'll keep the same default id generation strategy (random UUID), we'll expose the strategy to be provided by the end user.
Printable View
I've filed https://jira.springsource.org/browse/INT-1903. Although we'll keep the same default id generation strategy (random UUID), we'll expose the strategy to be provided by the end user.
As an update, for anyone who's interested... in order to "change" the default algorithm used by the UUID class, I wrote a bean that will inject a new SecureRandom("SHA1PRNG") instance into the static numberGenerator field of UUID using reflection, upon application startup, as per Dave's suggestion.
It's ugly, but it seems to work. Is there a better way to set the default Provider for a SecureRandom instance? A java system property perhaps?
As I stated before it will be handled as part of the https://jira.springsource.org/browse/INT-1903 shortly
The issue has finally been addressed. See details here: https://jira.springsource.org/browse/INT-1903
IN the nutshell all you need to do is implement MessageHeaders.IdGenerator
and configure it as a bean in the ApplicationContextCode:public static interface IdGenerator {
UUID generateId();
}
Please see the resolution comment of https://jira.springsource.org/browse/INT-1903 for more details.Code:<bean class="foo.bar.MyIdGenerator"/>
You can also check out this time-based UUID generator which gives you a 10-12 times performance boost with reasonable global uniqueness.
https://github.com/olegz/uuid