Re: How to properly remove a routeConfiguration

2023-10-07 Thread ski n
Yes, I think it's also present in Camel 3:

https://www.javadoc.io/static/org.apache.camel/camel-core-model/3.20.7/org/apache/camel/model/Model.html

There you have:

removeRouteConfiguration

Didn't found as the removeRoute is on the CamelContext, but
removeConfiguration only on the CamelModelContext.

Not sure if this is the best way, but following worked:

if(route.getConfigurationId()!=null){
ModelCamelContext modelContext = (ModelCamelContext) context;
RouteConfigurationDefinition routeConfigurationDefinition =
modelContext.getRouteConfigurationDefinition(route.getConfigurationId());
if(routeConfigurationDefinition!=null){
modelContext.removeRouteConfiguration(routeConfigurationDefinition);
}
}

Raymond

On Sat, Oct 7, 2023 at 9:59 AM Claus Ibsen  wrote:

> Hi
>
> You are using Camel 3 but there is API on Camel 4 (maybe also in 3 but I
> dont bother to check).
> Where you can remove via the model (def class). So you need to remove that
> way.
>
>
>
> On Tue, Oct 3, 2023 at 9:34 PM ski n  wrote:
>
> > I have a route and a routeConfiguration. I want to remove both from the
> > CamelContext.
> >
> > I tried it like this:
> >
> > String routeId = route.getId();
> > String routeConfigurationId = route.getConfigurationId();
> >
> > //remove route
> > routeController.stopRoute(routeId, 30, TimeUnit.SECONDS);
> > context.removeRoute(routeId);
> >
> > //remove routeConfiguration
> routeController.stopRoute(routeConfigurationId,
> > 30, TimeUnit.SECONDS);
> > context.removeRoute(routeConfigurationId);
> >
> > The route is removed and there are no errors. However, when I load the
> > route later again it says:
> >
> > "Route configuration already exists with id: 1234"
> >
> > The remove probably didn't work. There are no other routes using this
> > configuration.
> >
> > How to properly remove the routeConfiguration?
> >
> > Note: I use Camel 3.20.7
> > Note 2: When I do
> >
> > context.getRoutesSize();
> >
> > Before removal I get 1 and after removal I get 0.
> >
> > Note 3: On the CamelContext (context) there is:
> >
> > context.addRoutesConfigurations();
> >
> > But there are no methods like getRoutesConfigurations or
> > removeRouteConfiguration(routeId);
> >
> > Kind regards,
> >
> > Raymond
> >
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Re: How to properly remove a routeConfiguration

2023-10-07 Thread Claus Ibsen
Hi

You are using Camel 3 but there is API on Camel 4 (maybe also in 3 but I
dont bother to check).
Where you can remove via the model (def class). So you need to remove that
way.



On Tue, Oct 3, 2023 at 9:34 PM ski n  wrote:

> I have a route and a routeConfiguration. I want to remove both from the
> CamelContext.
>
> I tried it like this:
>
> String routeId = route.getId();
> String routeConfigurationId = route.getConfigurationId();
>
> //remove route
> routeController.stopRoute(routeId, 30, TimeUnit.SECONDS);
> context.removeRoute(routeId);
>
> //remove routeConfiguration routeController.stopRoute(routeConfigurationId,
> 30, TimeUnit.SECONDS);
> context.removeRoute(routeConfigurationId);
>
> The route is removed and there are no errors. However, when I load the
> route later again it says:
>
> "Route configuration already exists with id: 1234"
>
> The remove probably didn't work. There are no other routes using this
> configuration.
>
> How to properly remove the routeConfiguration?
>
> Note: I use Camel 3.20.7
> Note 2: When I do
>
> context.getRoutesSize();
>
> Before removal I get 1 and after removal I get 0.
>
> Note 3: On the CamelContext (context) there is:
>
> context.addRoutesConfigurations();
>
> But there are no methods like getRoutesConfigurations or
> removeRouteConfiguration(routeId);
>
> Kind regards,
>
> Raymond
>


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


Re: Camel 4 migration blog post - Feedback welcome

2023-10-07 Thread Claus Ibsen
On Fri, Oct 6, 2023 at 4:08 PM Mark Nuttall  wrote:

> one thing that got us was, since we were using kafka with security but not
> using Kafka idempotency, we had to add the following flag. As usual, kafka
> messages were not helpful.
>
> camel.component.kafka.enable-idempotence=false
>
>
Oh is this a default change in Kafka itself (eg upgrade of kafka-client) or
something thay may have changed in Camel 3 -> 4.
We can add a note about this in the 4.0 migration guide. You are welcome to
send a PR.




> On Fri, Oct 6, 2023 at 3:49 AM Claus Ibsen  wrote:
>
> > Hi
> >
> > If you have been migrating to Camel 4 already, then any feedback is
> > welcome.
> >
> > You can comment in the PR, or post here in the mailing list
> > https://github.com/apache/camel-website/pull/1071
> >
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>


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


Re: Camel 4 migration blog post - Feedback welcome

2023-10-07 Thread Claus Ibsen
Hi Raymon

Yes these are good observations about "why upgrade to v4 and what benefits
do I get".

Maybe we can write a blog post about this, and you are surely welcome to
help with this.
A blog post is just to do a PR for camel-website (you can copy an existing
blog post).
And then send as draft PR, then others can easily review and help with
sending updates etc.



On Fri, Oct 6, 2023 at 4:24 PM ski n  wrote:

>  Not being the typical Camel user, I see that as a compliment :)
>
> For the blog it may be also good to highlight not just how to upgrade
> (migration path), but also why to upgrade.
>
> There are technical reason like being up to date with Jakarta
> EE/Spring/Quarkus, but I think most users are even more interested in the
> functional improvements of the framework.
>
> Some technical and functional improvements were highlighted here:
>
> https://camel.apache.org/blog/2023/08/camel4-whatsnew/
>
> But some improvements are already refined in the coming 4.1 release, think
> of
>
> - Better support for Yaml DSL
> - Better support for XML DSL (xml-io improvements)
> - Better Kafka support (camel-kafka)
> - Jbang improvements
> - Better OpenTelemetry support
> - Improvements in dumping of routes
>
> Most Camel developers (at least here on the mailing list) are probably
> eager to migrate, but we also need to sell it to our colleagues or
> customers. The whole Jakarta thing says nothing to them, but better
> observability and better performance (like
> https://camel.apache.org/blog/2023/05/camel-4-performance-improvements/)
> is
> much better to communicate.
>
> Raymond
>
> On Fri, Oct 6, 2023 at 4:08 PM Mark Nuttall  wrote:
>
> > one thing that got us was, since we were using kafka with security but
> not
> > using Kafka idempotency, we had to add the following flag. As usual,
> kafka
> > messages were not helpful.
> >
> > camel.component.kafka.enable-idempotence=false
> >
> > On Fri, Oct 6, 2023 at 3:49 AM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > If you have been migrating to Camel 4 already, then any feedback is
> > > welcome.
> > >
> > > You can comment in the PR, or post here in the mailing list
> > > https://github.com/apache/camel-website/pull/1071
> > >
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> > >
> >
>


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