Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Performance Improvements

  1. #11
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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.

  2. #12
    Join Date
    Apr 2008
    Posts
    24

    Default

    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?

  3. #13
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    As I stated before it will be handled as part of the https://jira.springsource.org/browse/INT-1903 shortly

  4. #14
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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
    Code:
    public static interface IdGenerator {
    	UUID generateId();
    }
    and configure it as a bean in the ApplicationContext
    Code:
    <bean class="foo.bar.MyIdGenerator"/>
    Please see the resolution comment of https://jira.springsource.org/browse/INT-1903 for more details.

    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
    Last edited by oleg.zhurakousky; May 17th, 2011 at 11:51 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •