Announcement Announcement Module
No announcement yet.
optional id generator in place of java.util.UUID in MessageHeaders Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • optional id generator in place of java.util.UUID in MessageHeaders

    Within Spring Integration, is it possible to wire up an alternate Id Generator class with MessageHeaders instead of it defaulting to java.util.UUID.randomUUID() for message Id? It looks like there is provisioning for that in the MessageHeaders code but it's a private instance variable, I'm not sure how that would be config'd? The jre's UUID is slow as it dips down to os to generate secure random numbers which in my case is more robust than I need/want for uuids, a simple mac address/time variant based UUID would be something I'd like to substitute. The jre UUID ends up in a thread synch, which when running multiple consumer threads in a DefaultMessageListenerContainer, nips at overall throughput, I'm routinely seeing consumer threads go into BLOCK state in jconsole thread view pane:

    Name: mythreadid_1
    State: BLOCKED on [email protected] owned by: mythreadid_2
    Total blocked: 122,272 Total waited: 175,808

    Stack trace: java:433)
    org.springframework.integration.MessageHeaders.<in it>(
    org.springframework.integration.message.GenericMes sage.<init>(
    org.springframework.integration.history.MessageHis tory.write( ssageChannel.send( ssageChannel.send(

  • #2
    Yes, its a new undocumented feature that was introduced since 2.0.4. Look at this JIRA and let me know if you need more info:


    • #3
      Also, since you are looking for timebased UUID check out this code


      • #4
        Feel free to open a JIRA issue to have this documented. We originally introduced it quietly, but it seems like it might be a popular feature if we draw more attention to it.



        • #5
          cool, thanks for this info, it's exactly what I was looking for! I will try to file that jira for docs.