Hello Ralf,
Use property placeholder for your endpoints, define the property configuration 
as automatically reloadable and change the URI by kafka cmd line, config file 
in etc/ or by JMX.
The context is restarted automatically after URI change.
The property should be changeable also programmatically by your event handler.
Best regards
Karsten

-----Original Message-----
From: Omar Al-Safi <omars...@gmail.com> 
Sent: Mittwoch, 16. Oktober 2019 09:58
To: users@camel.apache.org
Subject: Re: Dynamically restarting consumer routes with changed URI parameters

Hi Ralf,

If you have these routes as a RouteBuilder beans, I think you can utilize 
CamelContext APIs such `addRoute` to add the bean dynamically. Of course you 
will need to implement a way to hot reloading of your .class files whenever you 
deem to. You can take a look at this test for an example:
https://github.com/apache/camel/blob/b9a3117f19dd19abd2ea8b789c42c3e86fe4c488/core/camel-core/src/test/java/org/apache/camel/builder/AddRoutesAtRuntimeTest.java

Regards,
Omar

On Wed, 16 Oct 2019 at 09:28, Ralf Claussnitzer < 
ralf.claussnit...@slub-dresden.de> wrote:

> Hello all,
>
> is there a way to restart defined routes so that the from() URI gets 
> updated?
> We have tried several things using the "Controlbus" component, but we 
> cannot restart a defined and running route /with changed URI parameters/.
>
> Background (what do we want to achieve):
>
>     We have several Kafka Consumer routes which we want to restart with
>     different options depending on other events. In particular we want
>     to restart a running route and change the URI parameter "seekTo" to
>     trigger reprocessing past events.
>
> While reprocessing Kafka events is our main topic at the moment, we 
> imagine that restarting a route and recalculate the consumer URI might 
> be useful for other use cases as well. Let us know what you think!
>
> Regards,
> Ralf
>
>

Reply via email to