[ 
https://issues.apache.org/activemq/browse/CAMEL-2752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60155#action_60155
 ] 

Christian Mueller commented on CAMEL-2752:
------------------------------------------

The way I would implements this is:

- create a new Interface UuidGenerator
  - create DefaultUuidGenerator (Singleton) which implements UuidGenerator and 
use java.util.UUID
  - create SimpleUuidGenerator (Singleton) which implements UuidGenerator and 
use an internal counter
  - create ActiveMqUuidGenerator (Singleton) which implements UuidGenerator and 
use the ActiveMQUUID
    - I have to look how dis could be implemented without introducing a 
dependency from camel-core to activemq. May be this class should reside in 
camel-activemq? Or do you mean simply "copy & past" when you wrote "uses the 
same logic as AMQ"?

- add to the CamelContext two new methods:
  - void setUuidGenerator(UuidGenerator generator);
  - UuidGenerator getUuidGenerator();

- add a default implementation to DefaultCamelContext which use 
DefaultUuidGenerator if no UuidGenerator is specified

- change DefaultExchange, DefaultUnitOfWork and MessageSupport to use the 
shared UuidGenerator instance, looked up from the CamelContext

Sounds good for you?

Christian

> Pluggable UUID generator
> ------------------------
>
>                 Key: CAMEL-2752
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2752
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.3.0
>            Reporter: Claus Ibsen
>            Assignee: Christian Mueller
>             Fix For: 2.4.0
>
>
> To allow end users to use a customer ID generator.
> We should have out of the box
> - JavaUUID (default)
> - ActiveMQUUID which uses the same logic as AMQ
> - Sequence or something for testing purpose which just use a ID counter. 
> Makes it easier for testing to *spot* correlated messages in the logs etc.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to