Camel 2.0 - UID generator in Camel

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel 2.0 - UID generator in Camel

Claus Ibsen
Hi

I am wondering if we should consider changing the UID generator in Camel.
BTW: Is the UID generator code from ActiveMQ or where is it from?

Currently it uses / in the UID and this is not file friendly and it's tied to the local machine (hostname).

Shouldn't we have a 100% neutral ID?
We could maybe use java.rmi.server.UID to generate it
 
Maybe we could make it pluggable, as I have been wondering it would be nice for testing and development to use simple int counters so you can see from the exchange id that it's the 3th exchange etc.


Med venlig hilsen

Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

Reply | Threaded
Open this post in threaded view
|

Re: Camel 2.0 - UID generator in Camel

Bruce Snyder
On Sun, Oct 12, 2008 at 3:21 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> I am wondering if we should consider changing the UID generator in Camel.
> BTW: Is the UID generator code from ActiveMQ or where is it from?
>
> Currently it uses / in the UID and this is not file friendly and it's tied to the local machine (hostname).
>
> Shouldn't we have a 100% neutral ID?
> We could maybe use java.rmi.server.UID to generate it
>
> Maybe we could make it pluggable, as I have been wondering it would be nice for testing and development to use simple int counters so you can see from the exchange id that it's the 3th exchange etc.

Why not just wrap java.util.UUID? Pluggability sounds like a good idea.

Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/
Reply | Threaded
Open this post in threaded view
|

Re: Camel 2.0 - UID generator in Camel

jstrachan
In reply to this post by Claus Ibsen
2008/10/12 Claus Ibsen <[hidden email]>:
> Hi
>
> I am wondering if we should consider changing the UID generator in Camel.
> BTW: Is the UID generator code from ActiveMQ or where is it from?
>
> Currently it uses / in the UID and this is not file friendly and it's tied to the local machine (hostname).

The hostname & timestamp is used to try ensure its a globally unique ID.

We should be able to zap the / though pretty easily :)


> Shouldn't we have a 100% neutral ID?
> We could maybe use java.rmi.server.UID to generate it
>
> Maybe we could make it pluggable, as I have been wondering it would be nice for testing and development to use simple int counters so you can see from the exchange id that it's the 3th exchange etc.

IIRC the last part of the ID is a counter.

Maybe we just need to add other counters to make it easier to trace?

--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com