Hi

A RouteBuilder is essentially just java, so you can create base
classes / abstract classes and have getter/setter (or what you prefer)
for configuration.

You can also use java's if .. else .. etc to add parts to the route if
you need. You can then put the routes together using the model classes
(the xxxDefinition).

But try to not make this to complex / confusing to maintain. You may
want to have special routes for splitter vs non splitter etc.


On Thu, Apr 20, 2017 at 11:04 AM, Burkard Stephan
<[email protected]> wrote:
> Hi Camel users
>
> Let's say I have this generic file to JMS route I would like to put in a 
> library.
>
> from(directory?options...)
>    .routeId("basicFileToJmsRoute")
>    .log(LoggingLevel.INFO, "[FILEREADER], file: ${in.header.CamelFileName}")
>    .to(queueEndpointUri);
>
>
> Then I would like to build multiple modules who use the route where each 
> module has its own configuration (directory, queue etc).
>
> But some of them have also additional requirements, for example split large 
> XML files:
>
> from(directory?options...)
>    .routeId("basicFileToJmsRoute")
>    .log(LoggingLevel.INFO, "[FILEREADER], file: ${in.header.CamelFileName}")
> =>   .split().tokenizeXML(SPLITTER_ELEMENT_NAME).streaming()
>    .to(queueEndpointUri);
>
>
> Is there a best practice approach to extend a basic route like this in 
> another module?
>
> Thanks
> Stephan
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to