camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Jones <>
Subject Patterns for DRY Camel endpoints
Date Wed, 04 Feb 2015 09:55:17 GMT
Is there a standard pattern for defining Camel endpoints so that
commonly used endpoint settings do not need to be repeated in every
endpoint definition? For example, every RabbitMQ endpoint I declare
always repeats the same connection settings like the following:


I'm thinking of having an (immutable) endpoint URL builder that can be
reused by all route builders. Then I would only need to set the common
connection settings once (say, in my Spring configuration):

     UrlBuilder rmqEndpointUrlBuilder() {
         return new UrlBuilder()

That URL builder would be injected into my Camel route builder and can
be used like so:


Does this sound reasonable? Is there a simpler way to achieve this?

Taking the endpoint builder idea further may be interesting. If there
were endpoint builders specific to each component type then it would be
a lot easier to define endpoint URL parameters. Has this sort of thing
been considered before?

  - Nathan

View raw message