Re: Camel 4.0.0-M3 with Velocity - Deprecation warning

2023-06-02 Thread Ramesh Venk
Thank you for an extremely fast response.
https://issues.apache.org/jira/browse/CAMEL-19410 has been opened.
--
Ramesh

On Fri, Jun 2, 2023 at 8:07 AM Andrea Cosentino  wrote:
>
> Please open an issue on camel Jira and we'll check.
>
> It's just a deprecation, nothing problematic
> Il ven 2 giu 2023, 14:44 Ramesh Venk  ha scritto:
>
> > Hello
> > I'm using Apache Camel 4.0.0-M3 with Quarkus 3.1.0.Final and using the
> > "camel-quarkus-velocity" to render a template. The template works
> > correctly, however, I see this message printed in the logs
> >
> > 2023-06-02 07:33:34,879 WARN  [org.apa.vel.deprecation] (Camel
> > (camel-1) thread #1 - timer://twoTimes) configuration key
> > 'resource.loader' has been deprecated in favor of 'resource.loaders'
> >
> > It looks like it has been fixed in 3.5.0 per this JIRA
> > (https://issues.apache.org/jira/browse/CAMEL-15240), however, in
> > 4.0.0-M3 it seems to still have this issue.
> >
> > What would need to be done in order to fix this? Thanks.
> >
> > --
> > Ramesh
> >


Re: Camel 4.0.0-M3 with Velocity - Deprecation warning

2023-06-02 Thread Andrea Cosentino
Please open an issue on camel Jira and we'll check.

It's just a deprecation, nothing problematic
Il ven 2 giu 2023, 14:44 Ramesh Venk  ha scritto:

> Hello
> I'm using Apache Camel 4.0.0-M3 with Quarkus 3.1.0.Final and using the
> "camel-quarkus-velocity" to render a template. The template works
> correctly, however, I see this message printed in the logs
>
> 2023-06-02 07:33:34,879 WARN  [org.apa.vel.deprecation] (Camel
> (camel-1) thread #1 - timer://twoTimes) configuration key
> 'resource.loader' has been deprecated in favor of 'resource.loaders'
>
> It looks like it has been fixed in 3.5.0 per this JIRA
> (https://issues.apache.org/jira/browse/CAMEL-15240), however, in
> 4.0.0-M3 it seems to still have this issue.
>
> What would need to be done in order to fix this? Thanks.
>
> --
> Ramesh
>


Camel 4.0.0-M3 with Velocity - Deprecation warning

2023-06-02 Thread Ramesh Venk
Hello
I'm using Apache Camel 4.0.0-M3 with Quarkus 3.1.0.Final and using the
"camel-quarkus-velocity" to render a template. The template works
correctly, however, I see this message printed in the logs

2023-06-02 07:33:34,879 WARN  [org.apa.vel.deprecation] (Camel
(camel-1) thread #1 - timer://twoTimes) configuration key
'resource.loader' has been deprecated in favor of 'resource.loaders'

It looks like it has been fixed in 3.5.0 per this JIRA
(https://issues.apache.org/jira/browse/CAMEL-15240), however, in
4.0.0-M3 it seems to still have this issue.

What would need to be done in order to fix this? Thanks.

--
Ramesh


Re: 3.20.4 Bug(?): Route's ErrorHandler not working if exception happens on Kamelet

2023-06-02 Thread Mikael Koskinen
Hi,

Thank you for the replies. It would be great if the Kamelets could
inherit the configuration as modifying the Kamelet specifications is
mostly out of the question as we're using the stock/built-in Kamelets,
like http-sink etc. I think this is quite a big issue (for me at least
:)) as it means that we really can't use the Kamelets from our routes
if we need to deal with errors in a specific way. And we do. The
documentation states that the Kamelet should act like a
direct-component but in this regard it doesn't.

Without knowing the internals of Apache Camel that well, I wonder if
this is something that could be changed on how the Kamelet Component
is implemented? Would it be possible to pass the route configuration
to the RouteDefinition, which is (I think) created in the
Kamelet.java/templateToRoute?

Best regards,
Mikael

pe 2. kesäk. 2023 klo 11.10 Andrea Cosentino (anco...@gmail.com) kirjoitti:
>
> But it's not with kamelets it's a plain route
>
> Il ven 2 giu 2023, 10:08 Andrea Cosentino  ha scritto:
>
> > There is one example in the camel-kamelets-example repo:
> >
> >
> > https://github.com/apache/camel-kamelets-examples/tree/main/jbang/error-handler
> >
> > Il ven 2 giu 2023, 10:03 Pasquale Congiusti 
> > ha scritto:
> >
> >> Hello,
> >> Error handler should be managed differently in Kamelets. Basically the
> >> problem is that a Kamelet is a RouteTemplate, so it is like a new Route
> >> and
> >> won't "inherit" the configuration you've defined in the original route. I
> >> think you need to define your error inside the Kamelet specification
> >> (which
> >> it's not a very nice design). In Camel K, we've created a layer on top of
> >> it inside the runtime, in order to let the user define the error handling
> >> in the Binding [1].
> >>
> >> We had some draft work [2] to enhance that, expecting a similar global
> >> mechanism in Camel. However, I haven't followed by near the recent
> >> developments in Camel 4 to tell you if this is going to be included in the
> >> new version or not.
> >>
> >> Regards,
> >> Pasquale.
> >>
> >> [1]
> >>
> >> https://camel.apache.org/camel-k/1.12.x/kamelets/kameletbindings-error-handler.html
> >> [2] https://github.com/apache/camel-k-runtime/pull/868
> >>
> >> On Fri, Jun 2, 2023 at 7:35 AM Mikael Koskinen 
> >> wrote:
> >>
> >> > Hey,
> >> >
> >> > I wonder if anyone has any info regarding this issue? It's possible
> >> > (and maybe quite likely!) that I'm using the
> >> > routeConfiguration/errorHandler incorrectly.
> >> >
> >> > Thanks in advance.
> >> >
> >> > Best regards,
> >> > Mikael
> >> >
> >> > pe 19. toukok. 2023 klo 15.24 Mikael Koskinen (mijap...@gmail.com)
> >> > kirjoitti:
> >> > >
> >> > > Hi,
> >> > >
> >> > > I'm encountering a problem where route configuration's error handler
> >> > > isn't run if the exception happens on a Kamelet. Here's the gist with
> >> > > tries to show the issue:
> >> > >
> >> >
> >> https://gist.githubusercontent.com/mikoskinen/4e3e3a8efdf891890a2a46dfddae1d48/raw/09055bcdc1c2252a77a069fcebd07d6f727db555/camel-yaml-kamelet-errorhandling.yaml
> >> > >
> >> > > More details:
> >> > >
> >> > >
> >> > > First, here's a (working) version with no Kamelets:
> >> > >
> >> > > - routeConfiguration:
> >> > > errorHandler:
> >> > >   deadLetterChannel:
> >> > > deadLetterUri: direct:errorHandler
> >> > > redeliveryPolicy:
> >> > >   maximumRedeliveries: 0
> >> > > - route:
> >> > > from:
> >> > >   uri: timer:timer
> >> > >   steps:
> >> > > - setBody:
> >> > > expression:
> >> > >   constant:
> >> > > expression: Hello World
> >> > > - marshal:
> >> > > json:
> >> > >   library: jackson
> >> > >   prettyPrint: true
> >> > > - to:
> >> > > uri:
> >> > https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
> >> > > - route:
> >> > > from:
> >> > >   uri: direct:errorHandler
> >> > >   steps:
> >> > > - log:
> >> > > message: Handling error
> >> > > loggingLevel: WARN
> >> > > description: Handle Error
> >> > >
> >> > > When run, this is what I see in the logs:
> >> > >
> >> > > 2023-05-19 15:14:13.783 WARN 20268 --- [- timer://timer]
> >> > > testing.camel.yaml:25 : Handling error
> >> > > 2023-05-19 15:14:14.626 WARN 20268 --- [- timer://timer]
> >> > > testing.camel.yaml:25 : Handling error
> >> > >
> >> > > It is working as I expected.
> >> > >
> >> > > Now, with a just one change where HTTP component is changed to Kamelet
> >> > > HTTP Sink and I'm getting completely different result.
> >> > >
> >> > > - routeConfiguration:
> >> > > errorHandler:
> >> > >   deadLetterChannel:
> >> > > deadLetterUri: direct:errorHandler
> >> > > redeliveryPolicy:
> >> > >   maximumRedeliveries: 0
> >> > > - route:
> >> > > from:
> >> > >   uri: timer:timer
> >> > >   steps:
> >> > > 

Re: 3.20.4 Bug(?): Route's ErrorHandler not working if exception happens on Kamelet

2023-06-02 Thread Andrea Cosentino
But it's not with kamelets it's a plain route

Il ven 2 giu 2023, 10:08 Andrea Cosentino  ha scritto:

> There is one example in the camel-kamelets-example repo:
>
>
> https://github.com/apache/camel-kamelets-examples/tree/main/jbang/error-handler
>
> Il ven 2 giu 2023, 10:03 Pasquale Congiusti 
> ha scritto:
>
>> Hello,
>> Error handler should be managed differently in Kamelets. Basically the
>> problem is that a Kamelet is a RouteTemplate, so it is like a new Route
>> and
>> won't "inherit" the configuration you've defined in the original route. I
>> think you need to define your error inside the Kamelet specification
>> (which
>> it's not a very nice design). In Camel K, we've created a layer on top of
>> it inside the runtime, in order to let the user define the error handling
>> in the Binding [1].
>>
>> We had some draft work [2] to enhance that, expecting a similar global
>> mechanism in Camel. However, I haven't followed by near the recent
>> developments in Camel 4 to tell you if this is going to be included in the
>> new version or not.
>>
>> Regards,
>> Pasquale.
>>
>> [1]
>>
>> https://camel.apache.org/camel-k/1.12.x/kamelets/kameletbindings-error-handler.html
>> [2] https://github.com/apache/camel-k-runtime/pull/868
>>
>> On Fri, Jun 2, 2023 at 7:35 AM Mikael Koskinen 
>> wrote:
>>
>> > Hey,
>> >
>> > I wonder if anyone has any info regarding this issue? It's possible
>> > (and maybe quite likely!) that I'm using the
>> > routeConfiguration/errorHandler incorrectly.
>> >
>> > Thanks in advance.
>> >
>> > Best regards,
>> > Mikael
>> >
>> > pe 19. toukok. 2023 klo 15.24 Mikael Koskinen (mijap...@gmail.com)
>> > kirjoitti:
>> > >
>> > > Hi,
>> > >
>> > > I'm encountering a problem where route configuration's error handler
>> > > isn't run if the exception happens on a Kamelet. Here's the gist with
>> > > tries to show the issue:
>> > >
>> >
>> https://gist.githubusercontent.com/mikoskinen/4e3e3a8efdf891890a2a46dfddae1d48/raw/09055bcdc1c2252a77a069fcebd07d6f727db555/camel-yaml-kamelet-errorhandling.yaml
>> > >
>> > > More details:
>> > >
>> > >
>> > > First, here's a (working) version with no Kamelets:
>> > >
>> > > - routeConfiguration:
>> > > errorHandler:
>> > >   deadLetterChannel:
>> > > deadLetterUri: direct:errorHandler
>> > > redeliveryPolicy:
>> > >   maximumRedeliveries: 0
>> > > - route:
>> > > from:
>> > >   uri: timer:timer
>> > >   steps:
>> > > - setBody:
>> > > expression:
>> > >   constant:
>> > > expression: Hello World
>> > > - marshal:
>> > > json:
>> > >   library: jackson
>> > >   prettyPrint: true
>> > > - to:
>> > > uri:
>> > https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
>> > > - route:
>> > > from:
>> > >   uri: direct:errorHandler
>> > >   steps:
>> > > - log:
>> > > message: Handling error
>> > > loggingLevel: WARN
>> > > description: Handle Error
>> > >
>> > > When run, this is what I see in the logs:
>> > >
>> > > 2023-05-19 15:14:13.783 WARN 20268 --- [- timer://timer]
>> > > testing.camel.yaml:25 : Handling error
>> > > 2023-05-19 15:14:14.626 WARN 20268 --- [- timer://timer]
>> > > testing.camel.yaml:25 : Handling error
>> > >
>> > > It is working as I expected.
>> > >
>> > > Now, with a just one change where HTTP component is changed to Kamelet
>> > > HTTP Sink and I'm getting completely different result.
>> > >
>> > > - routeConfiguration:
>> > > errorHandler:
>> > >   deadLetterChannel:
>> > > deadLetterUri: direct:errorHandler
>> > > redeliveryPolicy:
>> > >   maximumRedeliveries: 0
>> > > - route:
>> > > from:
>> > >   uri: timer:timer
>> > >   steps:
>> > > - setBody:
>> > > expression:
>> > >   constant:
>> > > expression: Hello World
>> > > - marshal:
>> > > json:
>> > >   library: jackson
>> > >   prettyPrint: true
>> > > - to:
>> > > uri: kamelet:http-sink
>> > > parameters:
>> > >   url:
>> > https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
>> > > - route:
>> > > from:
>> > >   uri: direct:errorHandler
>> > >   steps:
>> > > - log:
>> > > message: Handling error
>> > > loggingLevel: WARN
>> > > description: Handle Error
>> > >
>> > > Now when run I'm getting the stacktrace and there's no "Handling
>> > > error" to be found:
>> > >
>> > > 2023-05-19 15:20:22.084 INFO 17192 --- [ main]
>> > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.4 (tes
>> > > ting) started in 4s854ms (build:196ms init:3s906ms start:752ms
>> > JVM-uptime:8s)
>> > > 2023-05-19 15:20:23.165 ERROR 17192 --- [- timer://timer]
>> > > or.errorhandler.DefaultErrorHandler : Failed delivery for (Mes
>> > > sageId: 

Re: 3.20.4 Bug(?): Route's ErrorHandler not working if exception happens on Kamelet

2023-06-02 Thread Andrea Cosentino
There is one example in the camel-kamelets-example repo:

https://github.com/apache/camel-kamelets-examples/tree/main/jbang/error-handler

Il ven 2 giu 2023, 10:03 Pasquale Congiusti 
ha scritto:

> Hello,
> Error handler should be managed differently in Kamelets. Basically the
> problem is that a Kamelet is a RouteTemplate, so it is like a new Route and
> won't "inherit" the configuration you've defined in the original route. I
> think you need to define your error inside the Kamelet specification (which
> it's not a very nice design). In Camel K, we've created a layer on top of
> it inside the runtime, in order to let the user define the error handling
> in the Binding [1].
>
> We had some draft work [2] to enhance that, expecting a similar global
> mechanism in Camel. However, I haven't followed by near the recent
> developments in Camel 4 to tell you if this is going to be included in the
> new version or not.
>
> Regards,
> Pasquale.
>
> [1]
>
> https://camel.apache.org/camel-k/1.12.x/kamelets/kameletbindings-error-handler.html
> [2] https://github.com/apache/camel-k-runtime/pull/868
>
> On Fri, Jun 2, 2023 at 7:35 AM Mikael Koskinen  wrote:
>
> > Hey,
> >
> > I wonder if anyone has any info regarding this issue? It's possible
> > (and maybe quite likely!) that I'm using the
> > routeConfiguration/errorHandler incorrectly.
> >
> > Thanks in advance.
> >
> > Best regards,
> > Mikael
> >
> > pe 19. toukok. 2023 klo 15.24 Mikael Koskinen (mijap...@gmail.com)
> > kirjoitti:
> > >
> > > Hi,
> > >
> > > I'm encountering a problem where route configuration's error handler
> > > isn't run if the exception happens on a Kamelet. Here's the gist with
> > > tries to show the issue:
> > >
> >
> https://gist.githubusercontent.com/mikoskinen/4e3e3a8efdf891890a2a46dfddae1d48/raw/09055bcdc1c2252a77a069fcebd07d6f727db555/camel-yaml-kamelet-errorhandling.yaml
> > >
> > > More details:
> > >
> > >
> > > First, here's a (working) version with no Kamelets:
> > >
> > > - routeConfiguration:
> > > errorHandler:
> > >   deadLetterChannel:
> > > deadLetterUri: direct:errorHandler
> > > redeliveryPolicy:
> > >   maximumRedeliveries: 0
> > > - route:
> > > from:
> > >   uri: timer:timer
> > >   steps:
> > > - setBody:
> > > expression:
> > >   constant:
> > > expression: Hello World
> > > - marshal:
> > > json:
> > >   library: jackson
> > >   prettyPrint: true
> > > - to:
> > > uri:
> > https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
> > > - route:
> > > from:
> > >   uri: direct:errorHandler
> > >   steps:
> > > - log:
> > > message: Handling error
> > > loggingLevel: WARN
> > > description: Handle Error
> > >
> > > When run, this is what I see in the logs:
> > >
> > > 2023-05-19 15:14:13.783 WARN 20268 --- [- timer://timer]
> > > testing.camel.yaml:25 : Handling error
> > > 2023-05-19 15:14:14.626 WARN 20268 --- [- timer://timer]
> > > testing.camel.yaml:25 : Handling error
> > >
> > > It is working as I expected.
> > >
> > > Now, with a just one change where HTTP component is changed to Kamelet
> > > HTTP Sink and I'm getting completely different result.
> > >
> > > - routeConfiguration:
> > > errorHandler:
> > >   deadLetterChannel:
> > > deadLetterUri: direct:errorHandler
> > > redeliveryPolicy:
> > >   maximumRedeliveries: 0
> > > - route:
> > > from:
> > >   uri: timer:timer
> > >   steps:
> > > - setBody:
> > > expression:
> > >   constant:
> > > expression: Hello World
> > > - marshal:
> > > json:
> > >   library: jackson
> > >   prettyPrint: true
> > > - to:
> > > uri: kamelet:http-sink
> > > parameters:
> > >   url:
> > https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
> > > - route:
> > > from:
> > >   uri: direct:errorHandler
> > >   steps:
> > > - log:
> > > message: Handling error
> > > loggingLevel: WARN
> > > description: Handle Error
> > >
> > > Now when run I'm getting the stacktrace and there's no "Handling
> > > error" to be found:
> > >
> > > 2023-05-19 15:20:22.084 INFO 17192 --- [ main]
> > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.4 (tes
> > > ting) started in 4s854ms (build:196ms init:3s906ms start:752ms
> > JVM-uptime:8s)
> > > 2023-05-19 15:20:23.165 ERROR 17192 --- [- timer://timer]
> > > or.errorhandler.DefaultErrorHandler : Failed delivery for (Mes
> > > sageId: B24BA7702CBB985- on ExchangeId:
> > > B24BA7702CBB985-). Exhausted after delivery atte
> > > mpt: 1 caught: java.net.UnknownHostException: No such host is known
> > > (webhook.site)
> > >
> > > Message History
> > >
> >
> 

Re: 3.20.4 Bug(?): Route's ErrorHandler not working if exception happens on Kamelet

2023-06-02 Thread Pasquale Congiusti
Hello,
Error handler should be managed differently in Kamelets. Basically the
problem is that a Kamelet is a RouteTemplate, so it is like a new Route and
won't "inherit" the configuration you've defined in the original route. I
think you need to define your error inside the Kamelet specification (which
it's not a very nice design). In Camel K, we've created a layer on top of
it inside the runtime, in order to let the user define the error handling
in the Binding [1].

We had some draft work [2] to enhance that, expecting a similar global
mechanism in Camel. However, I haven't followed by near the recent
developments in Camel 4 to tell you if this is going to be included in the
new version or not.

Regards,
Pasquale.

[1]
https://camel.apache.org/camel-k/1.12.x/kamelets/kameletbindings-error-handler.html
[2] https://github.com/apache/camel-k-runtime/pull/868

On Fri, Jun 2, 2023 at 7:35 AM Mikael Koskinen  wrote:

> Hey,
>
> I wonder if anyone has any info regarding this issue? It's possible
> (and maybe quite likely!) that I'm using the
> routeConfiguration/errorHandler incorrectly.
>
> Thanks in advance.
>
> Best regards,
> Mikael
>
> pe 19. toukok. 2023 klo 15.24 Mikael Koskinen (mijap...@gmail.com)
> kirjoitti:
> >
> > Hi,
> >
> > I'm encountering a problem where route configuration's error handler
> > isn't run if the exception happens on a Kamelet. Here's the gist with
> > tries to show the issue:
> >
> https://gist.githubusercontent.com/mikoskinen/4e3e3a8efdf891890a2a46dfddae1d48/raw/09055bcdc1c2252a77a069fcebd07d6f727db555/camel-yaml-kamelet-errorhandling.yaml
> >
> > More details:
> >
> >
> > First, here's a (working) version with no Kamelets:
> >
> > - routeConfiguration:
> > errorHandler:
> >   deadLetterChannel:
> > deadLetterUri: direct:errorHandler
> > redeliveryPolicy:
> >   maximumRedeliveries: 0
> > - route:
> > from:
> >   uri: timer:timer
> >   steps:
> > - setBody:
> > expression:
> >   constant:
> > expression: Hello World
> > - marshal:
> > json:
> >   library: jackson
> >   prettyPrint: true
> > - to:
> > uri:
> https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
> > - route:
> > from:
> >   uri: direct:errorHandler
> >   steps:
> > - log:
> > message: Handling error
> > loggingLevel: WARN
> > description: Handle Error
> >
> > When run, this is what I see in the logs:
> >
> > 2023-05-19 15:14:13.783 WARN 20268 --- [- timer://timer]
> > testing.camel.yaml:25 : Handling error
> > 2023-05-19 15:14:14.626 WARN 20268 --- [- timer://timer]
> > testing.camel.yaml:25 : Handling error
> >
> > It is working as I expected.
> >
> > Now, with a just one change where HTTP component is changed to Kamelet
> > HTTP Sink and I'm getting completely different result.
> >
> > - routeConfiguration:
> > errorHandler:
> >   deadLetterChannel:
> > deadLetterUri: direct:errorHandler
> > redeliveryPolicy:
> >   maximumRedeliveries: 0
> > - route:
> > from:
> >   uri: timer:timer
> >   steps:
> > - setBody:
> > expression:
> >   constant:
> > expression: Hello World
> > - marshal:
> > json:
> >   library: jackson
> >   prettyPrint: true
> > - to:
> > uri: kamelet:http-sink
> > parameters:
> >   url:
> https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d
> > - route:
> > from:
> >   uri: direct:errorHandler
> >   steps:
> > - log:
> > message: Handling error
> > loggingLevel: WARN
> > description: Handle Error
> >
> > Now when run I'm getting the stacktrace and there's no "Handling
> > error" to be found:
> >
> > 2023-05-19 15:20:22.084 INFO 17192 --- [ main]
> > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.4 (tes
> > ting) started in 4s854ms (build:196ms init:3s906ms start:752ms
> JVM-uptime:8s)
> > 2023-05-19 15:20:23.165 ERROR 17192 --- [- timer://timer]
> > or.errorhandler.DefaultErrorHandler : Failed delivery for (Mes
> > sageId: B24BA7702CBB985- on ExchangeId:
> > B24BA7702CBB985-). Exhausted after delivery atte
> > mpt: 1 caught: java.net.UnknownHostException: No such host is known
> > (webhook.site)
> >
> > Message History
> >
> 
> > ---
> > Source ID Processor
> > Elapsed (ms)
> > testing.camel.yaml:9 route1/route1 from[timer://timer]
> > 2701025406
> > testing.camel.yaml:11 route1/setBody1 setBody[constant{Hello World}]
> > 2
> > testing.camel.yaml:15 route1/marshal1
> > marshal[org.apache.camel.model.dataformat.JsonDa
> >
> > A bug or do I have to configure something more to get the