Re: camel init works - but leaves errors

2023-02-16 Thread Claus Ibsen
rg.apache.logging.log4j.core.appender.FileAppender for element
> File: java.lang.IllegalStateException: No factory method found for
> class org.apache.logging.log4j.core.appender.FileAppender
> java.lang.IllegalStateException: No factory method found for class
> org.apache.logging.log4j.core.appender.FileAppender
> at
> org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:260)
> at
> org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:136)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1133)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1058)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:659)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:257)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:303)
> at
> org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
> at
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
> at
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
> at
> org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
> at
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
> at
> org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
> at
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
> at
> org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
> at
> org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
> at
> org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
> at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
> at org.apache.camel.util.FileUtil.(FileUtil.java:39)
> at org.apache.camel.dsl.jbang.core.commands.Init.call(Init.java:85)
> at org.apache.camel.dsl.jbang.core.commands.Init.call(Init.java:44)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> at main.CamelJBang.main(CamelJBang.java:36)
>
> 2023-02-16 12:53:30,574 main ERROR Null object returned for File in
> Appenders.
> 2023-02-16 12:53:30,575 main ERROR Unable to locate appender "file"
> for logger config "root"
>


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


Re: Using Java processors/aggregators with YAML & Camel JBang

2023-02-15 Thread Claus Ibsen
You can try look at local beans with "script" where you can embed the java
code
https://camel.apache.org/manual/route-template.html#_binding_beans_to_route_templates_using_bean_types

However that is used for kamelets, but could potentially also work in
yaml-dsl, where you can declare beans as well

On Thu, Feb 16, 2023 at 7:27 AM Mikael Koskinen  wrote:

> Hey,
>
> Few minutes later...
>
> camel run aggregator.yaml Aggregator.java
>
> Seems to work. I kind of thought that the files given to the run
> command are just integration files but this is good.
>
> Now, if there's a possibility to include the Aggregator.java inside
> the aggregator.yaml somehow, that would be great :)
>
> Best regards,
> Mikael
>
> to 16. helmik. 2023 klo 8.21 Mikael Koskinen (mijap...@gmail.com)
> kirjoitti:
> >
> > Hi,
> >
> > I'm trying but failing to use Java processors/Java classes when
> > writing integrations with YAML and running them with Camel JBang.
> >
> > I started by cloning this example:
> >
> https://github.com/apache/camel-karavan/tree/main/karavan-demo/aggregator
> >
> > But running with using simple:
> >
> > camel run aggregator.yaml
> >
> > Gives an error:
> > Failed to create route route1 at: >>> PollEnrich[simple{file:file_src?noo
> > p=true}] <<< in route:
> > Route(route1)[From[timer:test?delay=1000=3000] -> [Se...
> > because of Cannot find Aggregatio
> > nStrategy in Registry with name: #aggregator
> >
> > So I checked the documentation and I found this mention:
> >
> >
> https://camel.apache.org/manual/camel-jbang.html#_using_java_beans_and_processors
> > ---
> > There is basic support for including regular Java source files
> > together with Camel routes, and let Camel JBang runtime compile the
> > Java source. This means you can include smaller utility classes,
> > POJOs, Camel Processors and whatnot that the application needs.
> > ---
> >
> > I think I could package the java-file into a jar and then use that as
> > a dependency but I would like to use java-files if possible. And if
> > possible, embedding them inside the YAML sounds interesting.
> >
> > I think I'm missing something simple as it is still early morning but
> > if anyone has any tips to offer, I'm happy for the assistance.
> >
> > Kind regards,
> > Mikael
>


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


Re: Using Java processors/aggregators with YAML & Camel JBang

2023-02-15 Thread Claus Ibsen
Hi

You need to run it with

camel run *

Or to specify each file ala

camel run file1 file2





On Thu, Feb 16, 2023 at 7:22 AM Mikael Koskinen  wrote:

> Hi,
>
> I'm trying but failing to use Java processors/Java classes when
> writing integrations with YAML and running them with Camel JBang.
>
> I started by cloning this example:
> https://github.com/apache/camel-karavan/tree/main/karavan-demo/aggregator
>
> But running with using simple:
>
> camel run aggregator.yaml
>
> Gives an error:
> Failed to create route route1 at: >>> PollEnrich[simple{file:file_src?noo
> p=true}] <<< in route:
> Route(route1)[From[timer:test?delay=1000=3000] -> [Se...
> because of Cannot find Aggregatio
> nStrategy in Registry with name: #aggregator
>
> So I checked the documentation and I found this mention:
>
>
> https://camel.apache.org/manual/camel-jbang.html#_using_java_beans_and_processors
> ---
> There is basic support for including regular Java source files
> together with Camel routes, and let Camel JBang runtime compile the
> Java source. This means you can include smaller utility classes,
> POJOs, Camel Processors and whatnot that the application needs.
> ---
>
> I think I could package the java-file into a jar and then use that as
> a dependency but I would like to use java-files if possible. And if
> possible, embedding them inside the YAML sounds interesting.
>
> I think I'm missing something simple as it is still early morning but
> if anyone has any tips to offer, I'm happy for the assistance.
>
> Kind regards,
> Mikael
>


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


Re: Smooks Component

2023-02-15 Thread Claus Ibsen
Hi

There has never been an smooks component from Apache Camel itself.
Its 3rd party and comes from Smooks itself. So you should ask in their
community
https://www.smooks.org/v2/documentation/#apache_camel

 org.smooks.cartridges 
smooks-camel-cartridge 2.0.0-RC1


On Wed, Feb 15, 2023 at 6:04 PM Michael Rambichler 
wrote:

> Hi Folks,
>
> do i miss something or why do i not find the smooks component under camel
> components?
> https://www.smooks.org/
> It was integrated but now i cannot find it anymore
>
> I am investigating EDIFact transformations (Migrate from Or*** B2B Suite)
>
> Thanks for your help
>  Michael
>


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


Re: Camel REST Component and Jersey to trigger Camel Routes withg Java DSL (without Springboot)

2023-02-15 Thread Claus Ibsen
No such example - we tend to have plain examples or for spring boot /
quarkus.

You can see unit test of camel-servlet that has tests with rest-dsl.



On Wed, Feb 15, 2023 at 3:09 PM Penagos Jaime <
jaime.pena...@ub.uni-muenchen.de> wrote:

> Is there any example in the camel examples git or in the camel website
> where I can see how is it done? Somehow I included the parameters in the
> web.xml and the context paths and it doesnt seem to work...
>
> Thank you so much for the advice
>
> -Ursprüngliche Nachricht-
> Von: Claus Ibsen 
> Gesendet: Mittwoch, 15. Februar 2023 14:53
> An: users@camel.apache.org
> Betreff: Re: Camel REST Component and Jersey to trigger Camel Routes withg
> Java DSL (without Springboot)
>
> Try with camel-servlet that can link to a servlet container - which I
> assume jersey maybe can do
>
> On Wed, Feb 15, 2023 at 2:46 PM Penagos Jaime <
> jaime.pena...@ub.uni-muenchen.de> wrote:
>
> > Hello everyone,
> >
> > I have a (what I think) might be a rookie mistake question about Camel
> > REST and Java DSL, and am looking for advice
> >
> > I created a basic RESTful webservice with a simple "hello world" (with
> > jersey 1.19), and would like to link that to the REST component in
> > camel, without using Springboot. It seems that the only documentation
> > I find online has to to with it... not sure how should I continue...
> > any advice? I am working with Camel 3.20.2, Java 11 and Tomcat 9.
> >
> > Thanks for your answer,
> >
> > Best regards
> > --
> > Jaime Penagos
> >
> >
> >
>
> --
> 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 REST Component and Jersey to trigger Camel Routes withg Java DSL (without Springboot)

2023-02-15 Thread Claus Ibsen
Try with camel-servlet that can link to a servlet container - which I
assume jersey maybe can do

On Wed, Feb 15, 2023 at 2:46 PM Penagos Jaime <
jaime.pena...@ub.uni-muenchen.de> wrote:

> Hello everyone,
>
> I have a (what I think) might be a rookie mistake question about Camel
> REST and Java DSL, and am looking for advice
>
> I created a basic RESTful webservice with a simple "hello world" (with
> jersey 1.19), and would like to link that to the REST component in camel,
> without using Springboot. It seems that the only documentation I find
> online has to to with it... not sure how should I continue... any advice? I
> am working with Camel 3.20.2, Java 11 and Tomcat 9.
>
> Thanks for your answer,
>
> Best regards
> --
> Jaime Penagos
>
>
>

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


Re: Manage and monitor a group of routes

2023-02-11 Thread Claus Ibsen
Hi

The camel-management already captures on
- context
- route
- processor

levels for each statistics. So you have how many messages are processed by
routes.
You can associate a route to a route. And you can see the route in the
statistics, so your monitoring systems can aggregate data together.

However I think it would also be nice if Camel can do that
https://issues.apache.org/jira/browse/CAMEL-19038

That is on a high level with statistics only (numbers).

For actual message tracing then you can use event notifier, route policy,
message history etc.

To start|stop a collection of routes (in a group) is not possible out of
the box, and you need to do that manually.
Like your pseudo code.





On Fri, Feb 10, 2023 at 6:13 PM ski n  wrote:

> Hi Cameleers,
>
> I'm wondering what the best way is to manage and monitor a group of routes
> as an integration ('a unit of work')?
> Through the mailing list, I try to gather some ideas on this topic.
>
>
> Background: Integration vs Routes
>
> Say I have three routes that together form my integration:
>
> http://camel.apache.org/schema/spring;>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> So, the work processing messages is split up into three routes, but from a
> high-level view it's just one integration.
>
> From a Camel point of view the order doesn't matter, so I can create the
> same routes also like this:
>
> http://camel.apache.org/schema/spring;>
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> Because the order doesn't matter for Camel the integration still works the
> same.
> So messages start at the quartz component and then flow through the others
> routes.
>
>
> What I am trying to achieve:
>
> I was wondering how to manage and monitoring such integrations (route
> groups) at once. Here is some pseudo-code how I imagine it:
>
> RoutesGroup myRoutesGroup = context.getRouteGroup("myRoutesGroup");
> myRoutesGroup.suspend(); //suspends all routes in a group
> myRoutesGroup.start(); //starts all routes in a group
> myRoutesGroup.stop(); //stops all routes in a group
> myRoutesGroup.status(); //get the status from group
>
> Besides managing the integration I also like to monitor it as a group. For
> example to get:
>
> 1. Number or Content of messages processed by a group (in and out messages)
> 2. Number or Content of messages processed by a single route in the group
> (in and out message).
>
> With the second, I mean messages on a route level. What message goes into a
> route and what messages go out. This in contrast to exchanges, because
> exchanges create events on a lower level. In this example I am using direct
> component, so that would create the following exchange events:
>
> 1. First route: ExchangeCreated, some ExchangeSending/ExchangeSent events
> 2. Second route: Only sending/sent events
> 3. Third route: Sending/sent events and the completed event.
>
> From an integration point of view, I am only interested in what goes in and
> out the integration and how many messages that are. Or I am interested
> what messages are going into and out a single route (as a processing step).
>
> Is there a way to work with integrations opposed to routes? What are the
> possibilities in Camel?
>
> Raymond
>


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


Re: Pausable Kafka Consumer Unit Test

2023-02-11 Thread Claus Ibsen
Hi

When there is a lack of reply then its often as many of us are busy and
dont always have time to help out when it takes longer time to do so.
No reply does not mean we have not read the mail.

At this time I can only suggest to look at the existing unit tests in
camel-kafka.

Otavio whom is working on camel-kafka is busy with other things at this
moment, but he and others can reply back here when they get more time again.


On Wed, Feb 8, 2023 at 4:36 PM Chris Deeney
 wrote:

> Hi there,
>
> I'm currently trying to write a unit test that simulates when an endpoint
> is down triggering the pausable state (via a ConnectException) however the
> Camel Context doesn't seem to be performing the 'pausable' poll loop
> (KafkaConsumerListener) i.e. "The consumer is not yet resumable". This is
> Camel version 3.18.1.
>
> Could you give an example of how to correctly implement a unit test for
> this scenario or any pointers in the right direction would be greatly
> appreciated!
>
> Many thanks!
>
> Chris.
>
> [Virgin Wines] <https://www.virginwines.co.uk>  Chris
> Deeney | Java Developer
>
> Tel: 0343 224 1001
> Email: chris.dee...@virginwines.co.uk chris.dee...@virginwines.co.uk>
>
>
> [Hand Picked by us, loved by you!]  [2022 Specialist
> Online Drinks Retailer of the Year]
>
> DRINKING IS ONLY FUN WHEN YOU DON’T OVERDO IT
> Learn more at: www.virginwines.co.uk/drinkresponsibly<
> https://www.virginwines.co.uk/drinkresponsibly>
> Virgin Wines, St. James' Mill, Whitefriars, Norwich NR3 1TN, UK Registered
> in England No 3800762. VAT No 394 8318 54
>
> E-MAIL DISCLAIMER: This e-mail and any files transmitted with it are
> confidential and are intended solely for the use of the individual or
> entity to whom they are addressed. If you are not the original recipient or
> the person responsible for delivering the e-mail to the intended recipient,
> be advised that you have received the e-mail in error and that any use,
> dissemination, forwarding, printing or copying of this e-mail are strictly
> prohibited. Virgin Wines will not be liable for direct, indirect or
> consequential damages arising from alterations of the contents of this
> message by a third party or as a result of any virus being passed on. If
> you have received this e-mail in error please notify
> postmas...@virginwines.co.uk | Company Name: Virgin Wine Online Ltd. |
> Company Registration No.: 03800762
>


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


Re: Camel Spring Boot unable to load routes from a jar file

2023-02-10 Thread Claus Ibsen
Hi

We have fixed something about loading from within fatjar's of spring boot,
but that is very likely in newer Camel releases.
yaml-dsl is also evolving over that period so using an old 3.9 version with
yaml is not recommended.

I suggest to use Java DSL if you must use that old version. Also note that
Camel 3.14.x supports Java 8, so you could maybe try that release.
I am however not sure if Camel 3.14.x runs on SB 2.1.x


On Fri, Feb 10, 2023 at 4:22 PM Harnish Patel  wrote:

> Yes, they are old, but currently we are restricted to Spring Boot
> 2.1.18.RELEASE (and Java 8) due to the internal platform version. We plan
> to upgrade Spring Boot later this year, but for now we have to go with this
> version.
>
> -Original Message-----
> From: Claus Ibsen 
> Sent: Friday, February 10, 2023 1:54 AM
> To: users@camel.apache.org
> Subject: Re: Camel Spring Boot unable to load routes from a jar file
>
> EXTERNAL MESSAGE
>
> 
> 
>
> Hi
>
> Are you sure about the versions as they are very old.
>
> On Fri, Feb 10, 2023 at 3:21 AM Harnish Patel 
> wrote:
>
> > Hey everyone,
> >
> > I have a spring boot app. in which I my routes defined in .yaml files
> > under /resources/camel/ folder.
> > Spring boot version: 2.1.18.RELEASE
> > Camel version: 3.9.0
> >
> > I have the specified following spring boot property in bootstrap.yml:
> > camel:
> >   springboot:
> > routes-include-pattern: classpath:camel/*.yaml
> >
> > This works fine and the routes get loaded successfully when I run this
> > locally. Log output:
> > 2023-02-09 17:28:42.796 DEBUG 34104 --- [   main]
> > o.a.c.s.boot.SpringBootRoutesCollector   : Loading additional
> RoutesBuilder
> > from: classpath:camel/*.yaml
> > 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Getting resource URL for
> > package: camel/ with classloader:
> > jdk.internal.loader.ClassLoaders$AppClassLoader@4d7e1886
> > 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : URL from classloader:
> > file:/C:/source/connectors-core/target/classes/camel/
> > 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Decoded urlPath:
> > /C:/source/connectors-core/target/classes/camel/ with protocol: file
> > 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Scanning for resources in:
> > /C:/source/connectors-core/target/classes/camel/ matching pattern: *.yaml
> > 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Loading from directory
> > using
> > file: C:\source\connectors-core\target\classes\camel
> > 2023-02-09 17:28:42.798 DEBUG 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Found resource: route1.yaml
> > matching pattern: *.yaml -> true
> > 2023-02-09 17:28:42.801 TRACE 34104 --- [   main]
> > .e.DefaultResourceResolvers$FileResolver : Creating resource:
> > C:\source\connectors-core\target\classes\camel\route1.yaml from file
> system
> > 2023-02-09 17:28:42.801 DEBUG 34104 --- [   main]
> > c.i.e.DefaultPackageScanResourceResolver : Found resource: route2.yaml
> > matching pattern: *.yaml -> true
> > 2023-02-09 17:28:42.801 TRACE 34104 --- [   main]
> > .e.DefaultResourceResolvers$FileResolver : Creating resource:
> > C:\source\connectors-core\target\classes\camel\route2.yaml from file
> > system
> >
> > But, it doesn't load these routes when deploying the app. as a jar file.
> > Log output:
> > Loading additional RoutesBuilder from: classpath:camel/*.yaml
> > 16:46:52.490
> > Getting resource URL for package: camel/ with classloader:
> > org.springframework.boot.loader.LaunchedURLClassLoader@254989ff
> > 16:46:52.490
> > URL from classloader:
> > jar:file:/opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/work
> > er.jar!/BOOT-INF/classes!/camel/
> > 16:46:52.491
> > Decoded urlPath:
> > file:/opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.j
> > ar!/BOOT-INF/classes!/camel/
> > with protocol: jar
> > 16:46:52.491
> > Scanning for resources in:
> > /opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar
> > matching pattern: *.yaml
> > 16:46:52.491
> > Loading from jar using file:
> > /opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar
> > 16:4

Re: Camel Spring Boot unable to load routes from a jar file

2023-02-09 Thread Claus Ibsen
Hi

Are you sure about the versions as they are very old.

On Fri, Feb 10, 2023 at 3:21 AM Harnish Patel  wrote:

> Hey everyone,
>
> I have a spring boot app. in which I my routes defined in .yaml files
> under /resources/camel/ folder.
> Spring boot version: 2.1.18.RELEASE
> Camel version: 3.9.0
>
> I have the specified following spring boot property in bootstrap.yml:
> camel:
>   springboot:
> routes-include-pattern: classpath:camel/*.yaml
>
> This works fine and the routes get loaded successfully when I run this
> locally. Log output:
> 2023-02-09 17:28:42.796 DEBUG 34104 --- [   main]
> o.a.c.s.boot.SpringBootRoutesCollector   : Loading additional RoutesBuilder
> from: classpath:camel/*.yaml
> 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Getting resource URL for
> package: camel/ with classloader:
> jdk.internal.loader.ClassLoaders$AppClassLoader@4d7e1886
> 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : URL from classloader:
> file:/C:/source/connectors-core/target/classes/camel/
> 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Decoded urlPath:
> /C:/source/connectors-core/target/classes/camel/ with protocol: file
> 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Scanning for resources in:
> /C:/source/connectors-core/target/classes/camel/ matching pattern: *.yaml
> 2023-02-09 17:28:42.797 TRACE 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Loading from directory using
> file: C:\source\connectors-core\target\classes\camel
> 2023-02-09 17:28:42.798 DEBUG 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Found resource: route1.yaml
> matching pattern: *.yaml -> true
> 2023-02-09 17:28:42.801 TRACE 34104 --- [   main]
> .e.DefaultResourceResolvers$FileResolver : Creating resource:
> C:\source\connectors-core\target\classes\camel\route1.yaml from file system
> 2023-02-09 17:28:42.801 DEBUG 34104 --- [   main]
> c.i.e.DefaultPackageScanResourceResolver : Found resource: route2.yaml
> matching pattern: *.yaml -> true
> 2023-02-09 17:28:42.801 TRACE 34104 --- [   main]
> .e.DefaultResourceResolvers$FileResolver : Creating resource:
> C:\source\connectors-core\target\classes\camel\route2.yaml from file system
>
> But, it doesn't load these routes when deploying the app. as a jar file.
> Log output:
> Loading additional RoutesBuilder from: classpath:camel/*.yaml
> 16:46:52.490
> Getting resource URL for package: camel/ with classloader:
> org.springframework.boot.loader.LaunchedURLClassLoader@254989ff
> 16:46:52.490
> URL from classloader:
> jar:file:/opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar!/BOOT-INF/classes!/camel/
> 16:46:52.491
> Decoded urlPath:
> file:/opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar!/BOOT-INF/classes!/camel/
> with protocol: jar
> 16:46:52.491
> Scanning for resources in:
> /opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar
> matching pattern: *.yaml
> 16:46:52.491
> Loading from jar using file:
> /opt/wf/vds-data/workers/app/c.w.c/connectors-core/1.0.0/worker.jar
> 16:46:53.094
> No additional RoutesBuilder discovered from: classpath:camel/*.yaml
>
> If I specify the spring boot property to be a single file (route1.yaml),
> then the route is loaded fine. But specifying it as "*.yaml" doesn't work.
>
> Appreciate any pointers on how to resolve this issue.
>
> Thanks,
> Harnish Patel
>
>

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


Re: Milo Component throws " Skipping validation for certificate"

2023-02-07 Thread Claus Ibsen
On Wed, Feb 8, 2023 at 6:06 AM KARTHIK PRABHU N 
wrote:

> Hello Claus,
>
> Thank you for the information.
>
> Could you please tag someone from Milo team. Or let us know how we can
> reache out to them.
>
>
No you need to reach out to them yourself, its the Eclipse Milo project


>
> Thanks,
> Karthik
>
>
>
> On Thu, 2 Feb, 2023, 3:30 pm Claus Ibsen,  wrote:
>
> > Hi
> >
> > Not so much we can help, try upgrading to 3.20.1.
> > I dont know so much about Eclipse Milo. You can also try to reach out to
> > that team.
> >
> > Otherwise there are companies that offer commercial support for Camel and
> > therefore also its components.
> >
> >
> > On Thu, Feb 2, 2023 at 10:17 AM KARTHIK PRABHU N <
> > karthikprabh...@gmail.com>
> > wrote:
> >
> > > Hello ,
> > >
> > > 3.18.2
> > >
> > >
> > > Thanks ,
> > > Karthik
> > >
> > >
> > > On Wed, 1 Feb, 2023, 9:01 pm Claus Ibsen, 
> wrote:
> > >
> > > > Hi
> > > >
> > > > What version of Camel do you use?
> > > >
> > > > On Wed, Feb 1, 2023 at 12:12 PM KARTHIK PRABHU N <
> > > > karthikprabh...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hello All,
> > > > >
> > > > > Hope you are doing fine!
> > > > >
> > > > > Milo component which connects OPC UA server is throwing warning
> > message
> > > > > “Skipping validation for certificate “.  To understand this issue,
> I
> > > > tried
> > > > > to go through the milo stack and client library, but I somehow lost
> > in
> > > > > between understanding the logic.
> > > > >
> > > > > Could please let us know at which scenario this issue encountered.
> > > > >
> > > > >
> > > > > Thank you for the support,
> > > > >
> > > > > N. KP
> > > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> > >
> >
> >
> > --
> > 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: Easier Content-based dynamic routing

2023-02-06 Thread Claus Ibsen
Look at simple language with toD, or use a java bean method to calculate
the uri with recipient list (its also dynamic)


On Tue, Feb 7, 2023 at 6:14 AM Yash Ganthe  wrote:

> Hi,
>
> The toD will help in setting the destination. How do we get the value of
> the destination from the records?
> I looked at
> https://camel.apache.org/components/3.20.x/dataformats/csv-dataformat.html
>
> The unmarshall does give out a List>. How can we use the 3rd
> field in the toD ?
> E.g. Can we do something like this?
> from("file://rider/csvfiles")
> .unmarshal().csv()
> .split(body()).toD("jms:queue:csv.record[2]");
>
> -Yash
>
> On Mon, 6 Feb 2023 at 20:41, Claus Ibsen  wrote:
>
> > Hi
> >
> > Yes, look at toD which is a dynamic "to".
> >
> >
> > On Mon, Feb 6, 2023 at 4:04 PM Yash Ganthe  wrote:
> >
> > > Hi,
> > >
> > > I have a text file that looks like:
> > > my data, 342342, Q1
> > > my data2, 342342, Q2
> > > my data3, 342342, Q1
> > > 
> > >
> > > I would like to read each line, read the third field and use it as the
> > name
> > > of the queue to which the first and second field are written.
> > > E.g.
> > > from("file://myfile.txt").to("jmsqueue:"+Line[2])
> > >
> > > Is something like this possible with Camel?
> > >
> > > -Yash
> > >
> >
> >
> > --
> > 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: Easier Content-based dynamic routing

2023-02-06 Thread Claus Ibsen
Hi

Yes, look at toD which is a dynamic "to".


On Mon, Feb 6, 2023 at 4:04 PM Yash Ganthe  wrote:

> Hi,
>
> I have a text file that looks like:
> my data, 342342, Q1
> my data2, 342342, Q2
> my data3, 342342, Q1
> 
>
> I would like to read each line, read the third field and use it as the name
> of the queue to which the first and second field are written.
> E.g.
> from("file://myfile.txt").to("jmsqueue:"+Line[2])
>
> Is something like this possible with Camel?
>
> -Yash
>


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


Re: Components in 4.0

2023-02-06 Thread Claus Ibsen
Hi

1)
Many of those have already been deprecated. A few in that list are
potentially adding back if they become JakartaEE compatible before 4.0 GA.

2)
rabbitmq -> camel-spring-rabbitmq

Yes you are welcome to work on a table/section with that.
PRs is welcome.



On Mon, Feb 6, 2023 at 8:38 AM ski n  wrote:

> Currently, there are around 26 components planned that will be removed from
> Camel 4.0:
>
> https://camel.apache.org/manual/camel-4-migration-guide.html
>
> Maybe something to consider:
>
> 1. Deprecate those components already in 3.21.x
> 2. If the component has been renamed or has an alternative (say ActiveMQ
> --> SJMS, RabbitMQ --> AMQP) then it would be nice if they are listed in a
> table and this is mentioned in a separate column with a link to the
> alternative component.
>
> This will make upgrading easier for a lot of people.
>
> Raymond
>


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


Re: Milo Component throws " Skipping validation for certificate"

2023-02-02 Thread Claus Ibsen
Hi

Not so much we can help, try upgrading to 3.20.1.
I dont know so much about Eclipse Milo. You can also try to reach out to
that team.

Otherwise there are companies that offer commercial support for Camel and
therefore also its components.


On Thu, Feb 2, 2023 at 10:17 AM KARTHIK PRABHU N 
wrote:

> Hello ,
>
> 3.18.2
>
>
> Thanks ,
> Karthik
>
>
> On Wed, 1 Feb, 2023, 9:01 pm Claus Ibsen,  wrote:
>
> > Hi
> >
> > What version of Camel do you use?
> >
> > On Wed, Feb 1, 2023 at 12:12 PM KARTHIK PRABHU N <
> > karthikprabh...@gmail.com>
> > wrote:
> >
> > > Hello All,
> > >
> > > Hope you are doing fine!
> > >
> > > Milo component which connects OPC UA server is throwing warning message
> > > “Skipping validation for certificate “.  To understand this issue, I
> > tried
> > > to go through the milo stack and client library, but I somehow lost in
> > > between understanding the logic.
> > >
> > > Could please let us know at which scenario this issue encountered.
> > >
> > >
> > > Thank you for the support,
> > >
> > > N. KP
> > >
> >
> >
> > --
> > 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: CamelBlueprintTestSupport / strange OSGi context

2023-02-01 Thread Claus Ibsen
Hi

CamelBlueprintTestSupport is not testing in a real osgi system, but uses
apache felix pojosr (afair) that has some kind of mocked/simulated osgi
that is limited.
You can use pax exam for testing with a real osgi system.



On Wed, Feb 1, 2023 at 5:19 PM Ephemeris Lappis 
wrote:

> Hello.
>
> I've observed that tests based on CamelBlueprintTestSupport have a
> strange OSGi context : the "FrameworkUtil" class doesn't work as
> expected and returns null.
>
> For some parts of our application code, where optional information is
> not required, we can handle the null value. But we can't do it for
> example for Liquibase that detects the OSGi context, but fails reading
> bundle information.
>
> Here is the code of Liquibase that fails :
>
> Boolean osgiPlatform =
> Scope.getCurrentScope().get(Scope.Attr.osgiPlatform, Boolean.class);
> if (Boolean.TRUE.equals(osgiPlatform)) {
> Bundle bundle =
> FrameworkUtil.getBundle(LiquibaseUtil.class);
> URL propURL =
> bundle.getEntry("liquibase.build.properties");
>
> As the returned bundle is null, Liquibase fails, and all the
> application code too.
>
> Could someone explain why the OSGi context of the test fails
> retrieving bundles, while it seems to work for all the rest ?
>
> Can we do something in the test setting to enable the expected behavior ?
>
> Thanks in advance for explanations and help !
>
> Regards.
>


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


Re: Camel-JBang - File -> Split -> File

2023-02-01 Thread Claus Ibsen
Hi

Upgrade to Camel 3.20.1

On Thu, Feb 2, 2023 at 12:46 AM Chirag  wrote:

> Hello Fellow Camelriders,
>
> https://camel.apache.org/components/3.20.x/eips/split-eip.html#_streaming_big_xml_payloads_using_xml_tokenize_language
>
> I tried using camel jbang to run XML Split with Streaming.
> Here is how my route is defined:
> 
> 
> 
>   //Batch
>   
> 
>
> 
>
> Stacktrace
>
> ---
> org.apache.camel.InvalidPayloadException: No body available of type:
> java.io.InputStream but has type:
> org.apache.camel.component.file.GenericFile on: Batch.xml. Caused by:
> No type converter available to convert from type:
> org.apache.camel.component.file.GenericFile to the required type:
> java.io.InputStream. Exchange[6D6CB32F70B1126-0007].
> Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
> type converter available to convert from type:
> org.apache.camel.component.file.GenericFile to the required type:
> java.io.InputStream]
> at
> org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
> ~[camel-support-3.19.0.jar:3.19.0]
> at
> org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.doEvaluate(XMLTokenExpressionIterator.java:151)
> ~[camel-stax-3.19.0.jar:3.19.0]
> at
> org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.evaluate(XMLTokenExpressionIterator.java:134)
> ~[camel-stax-3.19.0.jar:3.19.0]
> at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
> ~[camel-support-3.19.0.jar:3.19.0]
> at
> org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:143)
> ~[camel-core-processor-3.19.0.jar:3.19.0]
> at
> org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:295)
> ~[camel-core-processor-3.19.0.jar:3.19.0]
> at org.apache.camel.processor.Splitter.process(Splitter.java:136)
> ~[camel-core-processor-3.19.0.jar:3.19.0]
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
> ~[camel-core-processor-3.19.0.jar:3.19.0]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
> ~[camel-base-engine-3.19.0.jar:3.19.0]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> ~[camel-base-engine-3.19.0.jar:3.19.0]
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:175)
> ~[camel-core-processor-3.19.0.jar:3.19.0]
> at
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
> ~[camel-base-engine-3.19.0.jar:3.19.0]
> at
> org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:492)
> ~[camel-file-3.19.0.jar:3.19.0]
> at
> org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:245)
> ~[camel-file-3.19.0.jar:3.19.0]
> at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:206)
> ~[camel-file-3.19.0.jar:3.19.0]
> at
> org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:202)
> ~[camel-support-3.19.0.jar:3.19.0]
> at
> org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:116)
> ~[camel-support-3.19.0.jar:3.19.0]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
> ~[?:?]
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
> ~[?:?]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> ~[?:?]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
> ~[?:?]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
> ~[?:?]
> at java.lang.Thread.run(Thread.java:1589) ~[?:?]
> Caused by: org.apache.camel.NoTypeConversionAvailableException: No
> type converter available to convert from type:
> org.apache.camel.component.file.GenericFile to the required type:
> java.io.InputStream
> at
> org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:274)
> ~[camel-base-3.19.0.jar:3.19.0]
> at
> org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:123)
> ~[camel-support-3.19.0.jar:3.19.0]
> ... 22 more
>
> I am using camel 3.19.0.
>
> Is there a better way of doing this?
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>


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


Re: Milo Component throws " Skipping validation for certificate"

2023-02-01 Thread Claus Ibsen
Hi

What version of Camel do you use?

On Wed, Feb 1, 2023 at 12:12 PM KARTHIK PRABHU N 
wrote:

> Hello All,
>
> Hope you are doing fine!
>
> Milo component which connects OPC UA server is throwing warning message
> “Skipping validation for certificate “.  To understand this issue, I tried
> to go through the milo stack and client library, but I somehow lost in
> between understanding the logic.
>
> Could please let us know at which scenario this issue encountered.
>
>
> Thank you for the support,
>
> N. KP
>


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


Re: ProducerTemplate (or something similar) support in Camel JBang?

2023-01-31 Thread Claus Ibsen
Hi



On Wed, Feb 1, 2023 at 5:40 AM Mikael Koskinen  wrote:

> Hi,
>
> I've been wondering if it would be possible or a good idea to add
> something like the ProducerTemplate to Camel JBang? I mean the ability
> to send messages to running integrations using the CLI.
>
> Use case for me would be a scenario where I could start direct
> endpoints when our application starts and then in specific points use
> the CLI to send messages to these endpoints for processing.
>
> Best regards,
> Mikael
>

Yes I have thought about something like that as well.

We should also consider being able to use the running JVM to send message
to external endpoints, for example a kafka topic or JMS queue.
The Camel route may be

from jms:cheese
   to bean blah

And then you can to trigger this route by sending a message to jms:cheese.
Today you would do this manually or via JMS client tools.
This is of course a great way to do that to use the "real thing". But
sometimes you also want to be quick and if Camel can help, then send via
Camel.


You are welcome to create a JIRA.



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


Re: EventNotifier filters

2023-01-31 Thread Claus Ibsen
Yes the exchange has fromRouteId and other information you can use in your
filter.
There is also an isEnabled method you can implement for the filtering.

On Tue, Jan 31, 2023 at 8:54 AM ski n  wrote:

> I have a question about event notifiers.
>
> Currently, I collect events using EventNotifierSupport
>
>
> https://javadoc.io/doc/org.apache.camel/camel-support/latest/org/apache/camel/support/EventNotifierSupport.html
>
> There I get a "CamelEvent" as listed in this class.
>
>
> https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/spi/CamelEvent.html
>
> Question:
>
> It's already possible to ignore certain type of events. However is it also
> possible to restrict the collection of events to specific routes (for
> example based on the route id)?
>
> In Camel2/ServiceMix this could be achieved to add one or more routes to a
> CamelContext and then foreach CamelContext you could collect events.
>
> Is there still something similar possible?
>
> Or should I pass a filter to a constructor in the collector like this:
>
> public class MyCollector extends EventNotifierSupport {
>
> private String routeId;
>
> public MyCollector(String routeId){
> this.routeId = routeId;
> }
>
> @Override
> public void notify(CamelEvent event) throws Exception {
>
> //filter by instance of CamelEvent
> if(event instanceof CamelEvent.ExchangeCreatedEvent) {
>
> //Cast event to specific event
> CamelEvent.ExchangeCreatedEvent exchangeCreatedEvent =
> (CamelEvent.ExchangeCreatedEvent) event;
>
> //Get the message exchange from event
> Exchange exchange = exchangeCreatedEvent.getExchange();
>
> //Get the route id from exchange
> String fromRouteId = exchange.getFromRouteId();
>
> //filter by routeId
> if(fromRouteId!=null && fromRouteId.equals(routeId)){
>
> //Get message body from exchange
> String body = exchange.getMessage().getBody(String.class);
>
> System.out.println("Exchange " +
> exchange.getExchangeId() + " with routeid " + routeId + " has been
> created.")
> System.out.println("Message body=" + body);
>
>
> }
>
> }
>
> }
>
> }
>
>
> And then add the event notifier like this:
>
> MyCollector myCollector = new MyCollector("myRouteId");
> myCollector.setIgnoreCamelContextEvents(true);
> myCollector.setIgnoreCamelContextInitEvents(true);
> myCollector.setIgnoreRouteEvents(true);
> myCollector.setIgnoreServiceEvents(true);
> myCollector.setIgnoreStepEvents(true);
>
> context.getManagementStrategy().addEventNotifier(myCollector);
>
>
> Add event notifiers for each route (or a group route) like the above code.
> Or is there a smarter / better way? And are there performance requirements
> to take into account when using this in production?
>
> BTW I couldn't find a guide about the usage of event notifiers, so I only
> had the Javadoc's available, but then you need to know where to look
> at. Maybe it's good to add a guide about event notifiers to:
>
> https://camel.apache.org/camel-core/advanced-camel-core-guides/index.html
>
> Regards,
>
> Raymond
>


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


Re: Camel 3.20.1 // Events ExchangeCreated and ExchangeCompleted seem to be repeated

2023-01-30 Thread Claus Ibsen
It has always been like that, when an exchange is created an event is fired.
Multicast / split create exchange (sub exchanges) and thus events.

You can see if its a sub exchange as it has exchange property
CORRELATION_ID that points to its parent.
So if you only want parent exchanges, then filter based on CORRELATION_ID
is not present.


On Mon, Jan 30, 2023 at 3:07 PM Ephemeris Lappis 
wrote:

> Hello.
>
> After more tests I think I have more or less an idea of the origin of
> the events, but an explanation should be welcome.
>
> In some cases, the 3rd route produces two files, and in some of these
> cases, they use a multicast.
> The multicast seems to be the cause of the repeated events.
>
> I've tried setting the multicast to use the same unit of work, as I
> suppose that the same UoW ualo uses the same exchange, but it doesn't
> change events.
>
> @Claus Ibsen Could you please explain what occurs when multicast is
> used, with or without setting the unit of work ?
>
> The same 3 routes without multicast are realized with 3 exchanges, and
> the expected events.
>
> Thanks for your help.
>
> Regards.
>
> Le lun. 30 janv. 2023 à 14:16, Claus Ibsen  a
> écrit :
> >
> > Hi
> >
> > This is expected as you use seda, that creates a new exchange
> > If you use direct then no exchange is created
> >
> > On Mon, Jan 30, 2023 at 1:51 PM Ephemeris Lappis <
> ephemeris.lap...@gmail.com>
> > wrote:
> >
> > > Hello.
> > >
> > > Debugging some routes with an EventNotifier it seems that the event
> > > ExchangecReated and ExchangeCompleted are repeated twice (I mean 3
> > > times instead of 1).
> > >
> > > My tested application routes are all on the same pattern :
> > > - route 1 : from JMS queue1 to JMS queue2
> > > - route 2 : from JMS queue2 to seda
> > > - route 3 : from seda to file
> > >
> > > In route 1 and 2 events are fired only once, but in route 3, I have 3
> > > events fired while the route is executed only once with only one file
> > > produced (and logs confirm I reach this part of the route only once).
> > > The ExchangeSent is fired only on the last exchange ID.
> > >
> > > All the exchange IDs are incremented as usual. Below, the logs :
> > > 13:01:42.540 [Camel (bbbmmm002-f002_context) thread #1 -
> > > JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts created exchange : 1 [ID=29A6D5065A7A1B6- /
> > > route=acq_bbbmmm002-f002]
> > > 13:01:42.579 [Camel (bbbmmm002-f002_context) thread #2 -
> > > JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts created exchange : 2 [ID=29A6D5065A7A1B6-0001 /
> > > route=trf_bbbmmm002-f002]
> > > 13:01:42.585 [Camel (bbbmmm002-f002_context) thread #1 -
> > > JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts completed exchange : 2 [ID=29A6D5065A7A1B6- /
> > > route=acq_bbbmmm002-f002]
> > > 13:01:42.751 [Camel (bbbmmm002-f002_context) thread #2 -
> > > JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts completed exchange : 2 [ID=29A6D5065A7A1B6-0001 /
> > > route=trf_bbbmmm002-f002]
> > > 13:01:43.406 [Camel (bbbmmm002-f002_context) thread #3 -
> > > seda://diff_bbbmmm002-f002] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts created exchange : 3 [ID=29A6D5065A7A1B6-0002 /
> > > route=diff_bbbmmm002-f002]
> > > 13:01:43.414 [Camel (bbbmmm002-f002_context) thread #3 -
> > > seda://diff_bbbmmm002-f002] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts created exchange : 4 [ID=29A6D5065A7A1B6-0003 /
> > > route=diff_bbbmmm002-f002]
> > > 13:01:43.441 [Camel (bbbmmm002-f002_context) thread #3 -
> > > seda://diff_bbbmmm002-f002] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> > > counts completed exchange : 4 [ID=29A6D5065A7A1B6-0003 /
> > > route=diff_bbbmmm002-f002]
> > > 13:01:43.442 [Camel (bbbmmm002-f002_context) thread #3 -
> > > seda://diff_bbbmmm002-f002] INFO
> > > info.isocel.alice.com.caterpillar.testing.SpyEv

Re: Camel 3.20.1 // Events ExchangeCreated and ExchangeCompleted seem to be repeated

2023-01-30 Thread Claus Ibsen
Hi

This is expected as you use seda, that creates a new exchange
If you use direct then no exchange is created

On Mon, Jan 30, 2023 at 1:51 PM Ephemeris Lappis 
wrote:

> Hello.
>
> Debugging some routes with an EventNotifier it seems that the event
> ExchangecReated and ExchangeCompleted are repeated twice (I mean 3
> times instead of 1).
>
> My tested application routes are all on the same pattern :
> - route 1 : from JMS queue1 to JMS queue2
> - route 2 : from JMS queue2 to seda
> - route 3 : from seda to file
>
> In route 1 and 2 events are fired only once, but in route 3, I have 3
> events fired while the route is executed only once with only one file
> produced (and logs confirm I reach this part of the route only once).
> The ExchangeSent is fired only on the last exchange ID.
>
> All the exchange IDs are incremented as usual. Below, the logs :
> 13:01:42.540 [Camel (bbbmmm002-f002_context) thread #1 -
> JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts created exchange : 1 [ID=29A6D5065A7A1B6- /
> route=acq_bbbmmm002-f002]
> 13:01:42.579 [Camel (bbbmmm002-f002_context) thread #2 -
> JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts created exchange : 2 [ID=29A6D5065A7A1B6-0001 /
> route=trf_bbbmmm002-f002]
> 13:01:42.585 [Camel (bbbmmm002-f002_context) thread #1 -
> JmsConsumer[bbbmmm002-f002.from.alice.queue]] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts completed exchange : 2 [ID=29A6D5065A7A1B6- /
> route=acq_bbbmmm002-f002]
> 13:01:42.751 [Camel (bbbmmm002-f002_context) thread #2 -
> JmsConsumer[bbbmmm002-f002.internal.queue]] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts completed exchange : 2 [ID=29A6D5065A7A1B6-0001 /
> route=trf_bbbmmm002-f002]
> 13:01:43.406 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts created exchange : 3 [ID=29A6D5065A7A1B6-0002 /
> route=diff_bbbmmm002-f002]
> 13:01:43.414 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts created exchange : 4 [ID=29A6D5065A7A1B6-0003 /
> route=diff_bbbmmm002-f002]
> 13:01:43.441 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts completed exchange : 4 [ID=29A6D5065A7A1B6-0003 /
> route=diff_bbbmmm002-f002]
> 13:01:43.442 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts created exchange : 5 [ID=29A6D5065A7A1B6-0004 /
> route=diff_bbbmmm002-f002]
> 13:01:43.453 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts completed exchange : 5 [ID=29A6D5065A7A1B6-0004 /
> route=diff_bbbmmm002-f002]
> 13:01:43.455 [Camel (bbbmmm002-f002_context) thread #3 -
> seda://diff_bbbmmm002-f002] INFO
> info.isocel.alice.com.caterpillar.testing.SpyEventNotifier - Spy
> counts completed exchange : 5 [ID=29A6D5065A7A1B6-0002 /
> route=diff_bbbmmm002-f002]
>
> Is it a bug, or what is the real expected behavior of these events ?
> Does it come from the seda component ?
>
> Thanks for your help.
>
> Regards.
>


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


Re: Jira Source Kamelet / Jira component & 3.20.1: Could not find artifact com.atlassian.sal:sal-api:jar:4.4.2 in central (https://repo1.maven.org/maven2)/

2023-01-29 Thread Claus Ibsen
Hi

Yeah a good idea to see if we can do this automatic for camel-jira with
camel-jbang
https://issues.apache.org/jira/browse/CAMEL-18983




On Sat, Jan 28, 2023 at 7:48 PM Mikael Koskinen  wrote:

> Hi,
>
> Thank you for the quick response and for the help!
>
> I wonder if it would be possible for the tooling (Camel JBang?) to
> handle the cases where additional Maven repositories are needed? As a
> person who mainly uses Karavan to create the integrations and Camel
> JBang as the tool to run them, I was quite clueless of what was going
> on.
>
> Couple quick ideas come to mind:
> * Maybe a quick dirty mapping directly coded into the tooling: If Jira
> is needed, automatically add Atlassian repo etc.
> * Some new metadata in the Kamelets / Components could be used to give
> the tooling the required information of additional repositories.
>
> I wonder, given there are hundreds of components, is the
> Jira/Atlassian a special case or are there some other component &
> repositories that will have the similar issues?
>
> Thanks again and have a nice weekend.
>
> Best regards,
> Mikael
>
> la 28. tammik. 2023 klo 19.40 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> >
> > atlassian does not release to maven central so you need to add their
> maven
> > repo to jbang or have it pre downloaded.
> >
> > lør. 28. jan. 2023 kl. 17.54 skrev Mikael Koskinen :
> >
> > > Hi,
> > >
> > > I'm trying to get the Jira component to work but without success. The
> > > error I'm getting is:
> > >
> > > Caused by: java.lang.IllegalArgumentException: Cannot find component
> > > with name: jira. Did you mean: gora, irc, jcr, jpa, mina
> > >
> > > And from the stacktrace I can see the following:
> > >
> > > Caused by: org.eclipse.aether.resolution.ArtifactResolutionException:
> > > The following artifacts could not be resolved:
> > > com.atlassian.sal:sal-api:jar:4.4.2, com.atlassian.jira:j
> > > ira-rest-java-client-api:jar:5.2.4,
> > > com.atlassian.jira:jira-rest-java-client-core:jar:5.2.4: Could not
> > > find artifact com.atlassian.sal:sal-api:jar:4.4.2 in central
> > > (https://r
> > > epo1.maven.org/maven2)
> > > at
> > >
> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
> > > ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> > > at
> > >
> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
> > > ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> > > at
> > >
> org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:357)
> > > ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> > > at
> > >
> org.apache.camel.main.download.MavenDependencyDownloader.resolveDependenciesViaAether(MavenDependencyDownloader.java:1190)
> > > ~[camel-kamelet-main-3.20.1.jar:3.20.1]
> > > at
> > >
> org.apache.camel.main.download.MavenDependencyDownloader.lambda$doDownloadDependency$0(MavenDependencyDownloader.java:365)
> > > ~[camel-kamelet-main-3.20.1.jar:3.20.1]
> > >
> > >
> > > Here's a simple YAML to reproduce the issue:
> > >
> > > apiVersion: camel.apache.org/v1
> > > kind: Integration
> > > metadata:
> > >   name: logger-test
> > > spec:
> > >   flows:
> > > - route:
> > >     from:
> > >   uri: jira:WATCHUPDATES
> > >   parameters:
> > > jiraUrl: https://company.atlassian.net/jira
> > > jql: project=CamelTest
> > >   steps:
> > > - to:
> > > uri: >-
> > >
> > > http://https://webhook.site/73458678-284f-4c01-a8b8-d3c09a7df
> > >
> > > And here's one way to run it:
> > >
> > > jbang run "-Dcamel.jbang.version=3.20.1" --fresh camel@apache/camel
> > > run example.yaml
> > >
> > > Best regards,
> > > Mikael
> > >
> > --
> > 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: Jira Source Kamelet / Jira component & 3.20.1: Could not find artifact com.atlassian.sal:sal-api:jar:4.4.2 in central (https://repo1.maven.org/maven2)/

2023-01-28 Thread Claus Ibsen
atlassian does not release to maven central so you need to add their maven
repo to jbang or have it pre downloaded.

lør. 28. jan. 2023 kl. 17.54 skrev Mikael Koskinen :

> Hi,
>
> I'm trying to get the Jira component to work but without success. The
> error I'm getting is:
>
> Caused by: java.lang.IllegalArgumentException: Cannot find component
> with name: jira. Did you mean: gora, irc, jcr, jpa, mina
>
> And from the stacktrace I can see the following:
>
> Caused by: org.eclipse.aether.resolution.ArtifactResolutionException:
> The following artifacts could not be resolved:
> com.atlassian.sal:sal-api:jar:4.4.2, com.atlassian.jira:j
> ira-rest-java-client-api:jar:5.2.4,
> com.atlassian.jira:jira-rest-java-client-core:jar:5.2.4: Could not
> find artifact com.atlassian.sal:sal-api:jar:4.4.2 in central
> (https://r
> epo1.maven.org/maven2)
> at
> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
> ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> at
> org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
> ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> at
> org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:357)
> ~[maven-resolver-impl-1.8.2.jar:1.8.2]
> at
> org.apache.camel.main.download.MavenDependencyDownloader.resolveDependenciesViaAether(MavenDependencyDownloader.java:1190)
> ~[camel-kamelet-main-3.20.1.jar:3.20.1]
> at
> org.apache.camel.main.download.MavenDependencyDownloader.lambda$doDownloadDependency$0(MavenDependencyDownloader.java:365)
> ~[camel-kamelet-main-3.20.1.jar:3.20.1]
>
>
> Here's a simple YAML to reproduce the issue:
>
> apiVersion: camel.apache.org/v1
> kind: Integration
> metadata:
>   name: logger-test
> spec:
>   flows:
> - route:
> from:
>   uri: jira:WATCHUPDATES
>   parameters:
> jiraUrl: https://company.atlassian.net/jira
> jql: project=CamelTest
>   steps:
> - to:
> uri: >-
>
> http://https://webhook.site/73458678-284f-4c01-a8b8-d3c09a7dfaaaa
>
> And here's one way to run it:
>
> jbang run "-Dcamel.jbang.version=3.20.1" --fresh camel@apache/camel
> run example.yaml
>
> Best regards,
> Mikael
>
-- 
Claus Ibsen
-
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: BUG - RouteDefinition doesnt have routeId when using REST DSL

2023-01-27 Thread Claus Ibsen
Camel 3.19 (CAMEL-18057) added routeId in rest-dsl.


On Fri, Jan 27, 2023 at 12:17 PM Nikola Glidzic 
wrote:

> Hi Claus,
>
> Thanks for answer.
>
> Actually, you can't do that anymore, because writing a route part in REST
> DSL is not possible anymore and routeId("myId") comes from RouteDefinition,
> but not from RestDefinition.
>
> We used Camel version 3.15.0 before and there we utilized route() and
> routeId("myId") in REST DSL, now we switched to 3.18.4 and there is only
> .id("myId") option for REST DSL.
> That big change for REST DSL happened somewhere between versions 3.15.0
> and 3.18.0. You can inspect that in RestDefinition class.
>
> So currently, the problem explained in my first email exists.
>
> Kind Regards,
> Nikola Glidzic
>


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


Re: BUG - RouteDefinition doesnt have routeId when using REST DSL

2023-01-26 Thread Claus Ibsen
Hi

In rest-dsl you can/should use routeId("myId") anot not id("myId") to
specify the route id



On Mon, Jan 23, 2023 at 2:11 PM Nikola Glidzic 
wrote:

> Hello Camel crew,
>
> I will explain in details what I have discovered, how to reproduce it and
> potential idea for fixing the issue. I am using Camel version 3.18.4.
>
> In my code, I have Camel unit tests where I extend CamelTestSupport. I am
> testing routes from one single RouteBuilder object which has some simple
> routes, but it has also routes created with REST DSL.
> What I am doing in this test is simply mocking these REST DSL routes in my
> test, hence I am using AdviceWith:
>
> AdviceWith.adviceWith( "myRestRouteId", context, new
> AdviceWithRouteBuilder() {
>   @Override
>   public void configure() throws Exception {
> replaceFromWith("direct: myRestRouteIdTesting");
>   }
> });
>
> The problem is that Advice will search for a RouteDefinition with given id
> "myRestRouteId", but it can't find it and I get following exception:
> java.lang.IllegalArgumentException: Cannot advice route as route with id:
> myRestRouteId does not exists This exception happens only for REST DSL
> routes.
>
> I have an explanation what happens and what should be a fix. Let me
> explain:
>
> Before starting the routes in the Camel context, what happens first is
> that all RouteDefinitions will be collected. But REST DSL routes will be
> collected as VerbDefinition-s. So at the beginning given routeId will be
> stored in a VerbDefinition object. After that in a class RestDefinition
> there is a method asRouteDefinition() which calls addRouteDefinition()
> method.
> Then addRouteDefinition() will actually loop through all VerbDefinition-s
> and will transform them one by one in RouteDefinition-s. But here it is
> missed to set routeId for RouteDefinition.
>
> My proposal for fix would be just to add a single line in mentioned
> transformation loop:  route.setId(verb.getId());
>
> All of this happens before Camel Context starts the routes. Problem was
> well hidden because later during the route starting phase, there is
> forceAssignIds() method in RouteDefinitionHelper class, which will take
> routeId from VerbDefinition and assign it to proper RouteDefinition. And
> then at the end as final result, when all routes are started, you will have
> your route id for your REST DSL route.
> But semantically looking, route id should be assigned to RouteDefinition
> earlier, during lets call it "reading and building RouteDefinitions phase".
>
> Anyway the problem exists when you try to test routes and use AdviceWith.
> I think this is a bug and fix is necessary since AdviceWith currently
> doesn't work for all routes.
>
> What you think about this? Should I open Jira ticket for this?
> Just to mention that I already tried this fix and AdviceWith worked as
> expected.
>
> Kind Regards,
> Nikola Glidzic
>


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


Re: [VOTE] Release Apache Camel Kamelets 3.20.1.1

2023-01-26 Thread Claus Ibsen
+1 (binding)

On Thu, Jan 26, 2023 at 7:43 AM Andrea Cosentino  wrote:

> Hello all:
>
> This is a vote for releasing camel-kamelets 3.20.1.1
>
> The release contains fixes and it's updated to Camel 3.20.1.1
>
> It's mainly related to this issue:
> https://github.com/apache/camel-kamelets/issues/1252
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/3.20.1.1
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1520
> Kamelets Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-kamelets.git;a=shortlog;h=refs/tags/v3.20.1.1
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 3.20.1.1
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> Here's my +1.
>
> Thanks,
> Andrea Cosentino
>


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


Re: [VOTE] Release Apache Camel K 1.11.1

2023-01-26 Thread Claus Ibsen
+1 (binding)

On Tue, Jan 24, 2023 at 6:51 PM Andrea Cosentino  wrote:

> Hello,
>
> This is a combined vote to release Apache Camel K 1.11.1
>
> Camel K 1.11.1 wasn't supposed to be an LTS release, but since OpenJDK
> image for JDK 11 has been discontinued (and suddenly removed from Docker
> hub), we are upgrading the base image from openjdk for JDK 11 to Temurin
> JDK11 (since Openjdk won't release JDK 11 image anymore).
>
> Essentially, a fresh installation of Camel k 1.11.0 won't work OOTB, there
> will need to be some env variables tuning. That's reason behind this
> non-LTS patch release.
>
> Camel K release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-k/1.11.1/
> Camel K Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-k.git;a=shortlog;h=refs/tags/v1.11.1
>
> Staging container image repository:
> https://hub.docker.com/r/camelk/camel-k/tags
>
> It's possible to install all staging artifacts with a single command:
>
> kamel install --operator-image=camelk/camel-k:1.11.1 --olm=false
>
> Please test this release candidate and cast your vote.
>
> [ ] +1 Release the binary as Apache Camel K 1.11.1
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> Here's my +1.
>
> Thanks,
> Andrea Cosentino
>


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


Re: [VOTE] Release Apache Camel K 1.10.4 and Camel Kamelets 0.9.4

2023-01-26 Thread Claus Ibsen
+1 (binding)

On Tue, Jan 24, 2023 at 6:34 PM Andrea Cosentino  wrote:

> Hello,
>
> This is a combined vote to release Apache Camel K 1.10.4 and Camel Kamelets
> 0.9.4
>
> We are upgrading the base image from openjdk for JDK 11 to Temurin JDK11
> (since Openjdk won't release JDK 11 image anymore), plus some fixes on
> camel-k and camel-kamelets
>
> Camel K release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-k/1.10.4/
> Camel K Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-k.git;a=shortlog;h=refs/tags/v1.10.4
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/0.9.4
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1519
> Kamelets Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-kamelets.git;a=shortlog;h=refs/tags/v0.9.4
>
> Staging container image repository:
> https://hub.docker.com/r/camelk/camel-k/tags
>
> It's possible to install all staging artifacts with a single command:
>
> kamel install --operator-image=camelk/camel-k:1.10.4 --maven-repository=
> https://repository.apache.org/content/repositories/orgapachecamel-1519
>  --olm=false
>
> Please test this release candidate and cast your vote.
>
> [ ] +1 Release the binary as Apache Camel K 1.10.4 and
> Apache Camel Kamelets 0.9.4
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> Here's my +1.
>
> Thanks,
> Andrea Cosentino
>


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


Re: connectionsPerRoute has no impact on Connection when using http component

2023-01-26 Thread Claus Ibsen
Hi

Try with a newer Camel version such as 3.20.1, or 3.18.x.
We do not support old Camel versions which are EOL.


On Thu, Jan 26, 2023 at 4:29 PM Rohan Emmanuel 
wrote:

> hi Claus,
> thanks for responding.
> i tried setting the connections per route configuration as a component
> option, but still, i see only 2 connections being established to HTTP
> service.
> these 2 connections are the httpClient library's default value. camel is
> not able to overwrite this. i am on camel 3.7.0.
>   i have added the component option below, can you please point out if I
> have missed out anything?
>
> 
> 
> 
> 
>
> On Fri, Jan 20, 2023 at 4:03 PM Claus Ibsen  wrote:
>
> > Hi
> >
> > It looks like setDefaultMaxPerRoute is invoked later that changes this
> > value.
> > Also you should not use query parameter as the http client may be
> > already created if you use http component elsewhere, favour set the value
> > on the component level
> >
> > On Fri, Jan 20, 2023 at 11:18 AM Rohan Emmanuel <
> > rohan.emmanue...@gmail.com>
> > wrote:
> >
> > > hi,
> > > In my camel route i am using http component to connect to a HTTP
> > service, I
> > > have the  connectionsPerRoute query parameters set on the url as per
> the
> > > documentation. but I see that always 2 connections are established to
> the
> > > HTTP service even though I am sending many concurrent requests to the
> > > route.
> > >
> > > I added a couple of print statements to get pool stats for every
> > >  connect() call, I always see 2 connections getting established, I also
> > > verified there is always 2 number of connections in the ESTABLISHED
> state
> > > on the HTTP service side.
> > >
> > > PoolStats-->[total kept alive: 0; route allocated: 2 of 2; total
> > allocated:
> > > 2 of 20]
> > >
> > >
> > > in the PoolingHttpClientConnectionManager code, I see that the CPool is
> > > initialized with defaultMaxPerRoute as 2.
> > >
> > >
> > > this.pool = new CPool((ConnFactory)new
> > > InternalConnectionFactory(this.configData, connFactory), 2, 20,
> > > timeToLive, timeUnit);
> > >
> > >
> > > Shouldnt this be overridden with the connectionsPerRoute value? is
> > > there any way to configure thie connections Per route configuration?
> > >
> > > any help would be appreciated.
> > >
> > >
> > > --
> > > Regards,
> > > Rohan Emmanuel
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Regards,
> Rohan Emmanuel
>


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


Re: Empty stream for gzipped response

2023-01-20 Thread Claus Ibsen
Can you put together a reproducer example and either put that on github
with readme how to run, or create a JIRA and attach it as .zip.
This makes it easier for us to investigate

On Fri, Jan 20, 2023 at 10:38 AM Dmitri T  wrote:

> BTW, it seems that behavior comes from "The type converter from
> InputStream to byte[] will now close the input stream after the
> conversion" (
> https://camel.apache.org/manual/camel-3x-upgrade-guide-3_18.html)
>
> чт, 19 янв. 2023 г. в 17:42, Dmitri T :
> >
> > Hi.
> >
> > This fix does not work. Reset method just sets pos = mark, but it is
> > already 0 (stream is empty).
> >
> > чт, 19 янв. 2023 г. в 15:57, Claus Ibsen :
> > >
> > > Hi
> > >
> > > Okay can you try with adding reset to stream cache such as and give
> that a
> > > test locally.
> > >
> > > Object body = exchange.getIn().getBody();
> > > // reset the stream cache if the body is the instance of StreamCache
> > > if (body instanceof StreamCache) {
> > > ((StreamCache) body).reset();
> > > }
> > > if (body instanceof InputStream) {
> > > InputStream is = (InputStream) body;
> > > if (LOG.isDebugEnabled()) {
> > > LOG.debug("Streaming GZIP response in chunked mode with buffer
> > > size {}", response.getBufferSize());
> > > }
> > >
> > >
> > >
> > > On Wed, Jan 18, 2023 at 10:22 AM Claus Ibsen 
> wrote:
> > >
> > > >
> > > >
> > > > On Tue, Jan 17, 2023 at 3:16 PM Dmitri T 
> wrote:
> > > >
> > > >> Sure.
> > > >> The Server is jetty from camel-jetty.
> > > >> Message body is:
> > > >> org.apache.camel.converter.stream.InputStreamCache for
> > > >> exchange.getIn().getBody() (empty)
> > > >> org.apache.camel.converter.stream.ByteArrayInputStreamCache for
> > > >> message.getBody() (not empty)
> > > >>
> > > >>
> > > > Thanks for reporting this. You are welcome to create a JIRA so we
> can work
> > > > on a fix.
> > > > I think we need to check for StreamCache in that part of the code.
> > > >
> > > >
> > > >
> > > >> вт, 17 янв. 2023 г. в 16:59, Claus Ibsen :
> > > >> >
> > > >>
> > > >
> > > >
> > > >
> > > >
> > > >> > Hi
> > > >> >
> > > >> > Thanks for reporting. Can you tell a bit more about what HTTP
> server you
> > > >> > are using? And what class type the message body is at that moment
> in
> > > >> > doWriteGZIPResponse?
> > > >> > If the body is not an instance of InputStream then what type is
> that
> > > >> body
> > > >> > of yours?
> > > >> >
> > > >> >
> > > >> > On Tue, Jan 17, 2023 at 1:03 PM Dmitri T 
> wrote:
> > > >> >
> > > >> > > Hello.
> > > >> > > After upgrading from Camel 3.7.x to the recent version, gzipped
> > > >> > > response (Content-Encoding: gzip) from a route comes empty. I
> have
> > > >> > > found an issue CAMEL-13092 (fixed in Camel 3.10) which caused
> that in
> > > >> > >
> > > >> > >
> > > >>
> camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
> > > >> > > (line 602 doWriteGZIPResponse method): Object body =
> > > >> > > exchange.getIn().getBody();
> > > >> > > I debugged and found. that stream was not empty, if that line
> was
> > > >> > > replaced by Object body = message.getBody(InputStream.class);,
> like it
> > > >> > > was done for plain non-gzipped response in doWriteDirectResponse
> > > >> > > method.
> > > >> > > I have tested this change with ServletStreamingGzipChunkedTest
> > > >> > > successfully.
> > > >> > > Is this an issue and could be fixed in the next Camel release?
> > > >> > >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > Claus Ibsen
> > > >> > -
> > > >> > @davsclaus
> > > >> > Camel in Action 2: https://www.manning.com/ibsen2
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Best regards,
> > > >> Dmitri
> > > >>
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> >
> >
> >
> > --
> > Best regards,
> > Dmitri
>
>
>
> --
> Best regards,
> Dmitri
>


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


Re: connectionsPerRoute has no impact on Connection when using http component

2023-01-20 Thread Claus Ibsen
Hi

It looks like setDefaultMaxPerRoute is invoked later that changes this
value.
Also you should not use query parameter as the http client may be
already created if you use http component elsewhere, favour set the value
on the component level

On Fri, Jan 20, 2023 at 11:18 AM Rohan Emmanuel 
wrote:

> hi,
> In my camel route i am using http component to connect to a HTTP service, I
> have the  connectionsPerRoute query parameters set on the url as per the
> documentation. but I see that always 2 connections are established to the
> HTTP service even though I am sending many concurrent requests to the
> route.
>
> I added a couple of print statements to get pool stats for every
>  connect() call, I always see 2 connections getting established, I also
> verified there is always 2 number of connections in the ESTABLISHED state
> on the HTTP service side.
>
> PoolStats-->[total kept alive: 0; route allocated: 2 of 2; total allocated:
> 2 of 20]
>
>
> in the PoolingHttpClientConnectionManager code, I see that the CPool is
> initialized with defaultMaxPerRoute as 2.
>
>
> this.pool = new CPool((ConnFactory)new
> InternalConnectionFactory(this.configData, connFactory), 2, 20,
> timeToLive, timeUnit);
>
>
> Shouldnt this be overridden with the connectionsPerRoute value? is
> there any way to configure thie connections Per route configuration?
>
> any help would be appreciated.
>
>
> --
> Regards,
> Rohan Emmanuel
>


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


Re: Empty stream for gzipped response

2023-01-19 Thread Claus Ibsen
Hi

Okay can you try with adding reset to stream cache such as and give that a
test locally.

Object body = exchange.getIn().getBody();
// reset the stream cache if the body is the instance of StreamCache
if (body instanceof StreamCache) {
((StreamCache) body).reset();
}
if (body instanceof InputStream) {
InputStream is = (InputStream) body;
if (LOG.isDebugEnabled()) {
LOG.debug("Streaming GZIP response in chunked mode with buffer
size {}", response.getBufferSize());
}



On Wed, Jan 18, 2023 at 10:22 AM Claus Ibsen  wrote:

>
>
> On Tue, Jan 17, 2023 at 3:16 PM Dmitri T  wrote:
>
>> Sure.
>> The Server is jetty from camel-jetty.
>> Message body is:
>> org.apache.camel.converter.stream.InputStreamCache for
>> exchange.getIn().getBody() (empty)
>> org.apache.camel.converter.stream.ByteArrayInputStreamCache for
>> message.getBody() (not empty)
>>
>>
> Thanks for reporting this. You are welcome to create a JIRA so we can work
> on a fix.
> I think we need to check for StreamCache in that part of the code.
>
>
>
>> вт, 17 янв. 2023 г. в 16:59, Claus Ibsen :
>> >
>>
>
>
>
>
>> > Hi
>> >
>> > Thanks for reporting. Can you tell a bit more about what HTTP server you
>> > are using? And what class type the message body is at that moment in
>> > doWriteGZIPResponse?
>> > If the body is not an instance of InputStream then what type is that
>> body
>> > of yours?
>> >
>> >
>> > On Tue, Jan 17, 2023 at 1:03 PM Dmitri T  wrote:
>> >
>> > > Hello.
>> > > After upgrading from Camel 3.7.x to the recent version, gzipped
>> > > response (Content-Encoding: gzip) from a route comes empty. I have
>> > > found an issue CAMEL-13092 (fixed in Camel 3.10) which caused that in
>> > >
>> > >
>> camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
>> > > (line 602 doWriteGZIPResponse method): Object body =
>> > > exchange.getIn().getBody();
>> > > I debugged and found. that stream was not empty, if that line was
>> > > replaced by Object body = message.getBody(InputStream.class);, like it
>> > > was done for plain non-gzipped response in doWriteDirectResponse
>> > > method.
>> > > I have tested this change with ServletStreamingGzipChunkedTest
>> > > successfully.
>> > > Is this an issue and could be fixed in the next Camel release?
>> > >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -
>> > @davsclaus
>> > Camel in Action 2: https://www.manning.com/ibsen2
>>
>>
>>
>> --
>> Best regards,
>> Dmitri
>>
>
>
> --
> 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: Empty stream for gzipped response

2023-01-18 Thread Claus Ibsen
On Tue, Jan 17, 2023 at 3:16 PM Dmitri T  wrote:

> Sure.
> The Server is jetty from camel-jetty.
> Message body is:
> org.apache.camel.converter.stream.InputStreamCache for
> exchange.getIn().getBody() (empty)
> org.apache.camel.converter.stream.ByteArrayInputStreamCache for
> message.getBody() (not empty)
>
>
Thanks for reporting this. You are welcome to create a JIRA so we can work
on a fix.
I think we need to check for StreamCache in that part of the code.



> вт, 17 янв. 2023 г. в 16:59, Claus Ibsen :
> >
>




> > Hi
> >
> > Thanks for reporting. Can you tell a bit more about what HTTP server you
> > are using? And what class type the message body is at that moment in
> > doWriteGZIPResponse?
> > If the body is not an instance of InputStream then what type is that body
> > of yours?
> >
> >
> > On Tue, Jan 17, 2023 at 1:03 PM Dmitri T  wrote:
> >
> > > Hello.
> > > After upgrading from Camel 3.7.x to the recent version, gzipped
> > > response (Content-Encoding: gzip) from a route comes empty. I have
> > > found an issue CAMEL-13092 (fixed in Camel 3.10) which caused that in
> > >
> > >
> camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
> > > (line 602 doWriteGZIPResponse method): Object body =
> > > exchange.getIn().getBody();
> > > I debugged and found. that stream was not empty, if that line was
> > > replaced by Object body = message.getBody(InputStream.class);, like it
> > > was done for plain non-gzipped response in doWriteDirectResponse
> > > method.
> > > I have tested this change with ServletStreamingGzipChunkedTest
> > > successfully.
> > > Is this an issue and could be fixed in the next Camel release?
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Best regards,
> Dmitri
>


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


Re: Empty stream for gzipped response

2023-01-17 Thread Claus Ibsen
Hi

Thanks for reporting. Can you tell a bit more about what HTTP server you
are using? And what class type the message body is at that moment in
doWriteGZIPResponse?
If the body is not an instance of InputStream then what type is that body
of yours?


On Tue, Jan 17, 2023 at 1:03 PM Dmitri T  wrote:

> Hello.
> After upgrading from Camel 3.7.x to the recent version, gzipped
> response (Content-Encoding: gzip) from a route comes empty. I have
> found an issue CAMEL-13092 (fixed in Camel 3.10) which caused that in
>
> camel-http-common/src/main/java/org/apache/camel/http/common/DefaultHttpBinding.java
> (line 602 doWriteGZIPResponse method): Object body =
> exchange.getIn().getBody();
> I debugged and found. that stream was not empty, if that line was
> replaced by Object body = message.getBody(InputStream.class);, like it
> was done for plain non-gzipped response in doWriteDirectResponse
> method.
> I have tested this change with ServletStreamingGzipChunkedTest
> successfully.
> Is this an issue and could be fixed in the next Camel release?
>


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


Re: Upgrading from 2.24.2 to 3.14.7 - xtokenize performance

2023-01-16 Thread Claus Ibsen
st group took: 1013 millis which is: 32,245.805
> messages per second. average: 31,397.756
> 2022-12-29 11:35:33.185  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 30866 new messages, with total
> 405818 so far. Last group took: 997 millis which is: 30,958.877
> messages per second. average: 31,363.938
> 2022-12-29 11:35:34.176  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 31511 new messages, with total
> 437329 so far. Last group took: 991 millis which is: 31,797.175
> messages per second. average: 31,394.76
> 2022-12-29 11:35:35.181  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 30706 new messages, with total
> 468035 so far. Last group took: 1005 millis which is: 30,553.234
> messages per second. average: 31,338.132
> 2022-12-29 11:35:36.179  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 4183 new messages, with total
> 472218 so far. Last group took: 998 millis which is: 4,191.383
> messages per second. average: 29,637.733
> 2022-12-29 11:35:37.179  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 0 new messages, with total
> 472218 so far. Last group took: 1000 millis which is: 0 messages per
> second. average: 27,887.439
> 2022-12-29 11:35:38.174  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 0 new messages, with total
> 472218 so far. Last group took: 995 millis which is: 0 messages per
> second. average: 26,339.692
> 2022-12-29 11:35:39.173  INFO 11444 --- [hroughputLogger] DELTA
> : Received: 0 new messages, with total
> 472218 so far. Last group took: 999 millis which is: 0 messages per
> second. average: 24,949.437
> 2022-12-29 11:35:39.973  INFO 11444 --- [ionShutdownHook]
> o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.20.0
> (camel-1) is shutting down (timeout:45s)
> 2022-12-29 11:35:39.978  INFO 11444 --- [ionShutdownHook]
> o.a.c.impl.engine.AbstractCamelContext   : Routes stopped (stopped:1)
> 2022-12-29 11:35:39.979  INFO 11444 --- [ionShutdownHook]
> o.a.c.impl.engine.AbstractCamelContext   : Stopped route1
> (file://C:/dev/temp)
> 2022-12-29 11:35:39.980  INFO 11444 --- [ionShutdownHook]
> o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.20.0
> (camel-1) shutdown in 7ms (uptime:20s)
>
> Process finished with exit code 130
>


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


Re: Objects not propagated to Camel Kafka 3.18.4

2023-01-16 Thread Claus Ibsen
I created a JIRA to not forget
https://issues.apache.org/jira/browse/CAMEL-18938

On Fri, Jan 6, 2023 at 10:06 AM Claus Ibsen  wrote:

> You can also use string uri instead of endpoint dsl, then you can refer to
> the via kafka:?additionalProperties=#myMapBeanId
>
> So we may need for endpoint dsl to include a fluent builder for Map that
> is a string value to use for bean reference lookup
>
> On Fri, Jan 6, 2023 at 9:31 AM Claus Ibsen  wrote:
>
>>
>>
>> On Fri, Jan 6, 2023 at 9:17 AM Martin Pelikán  wrote:
>>
>>> Hi Claus,
>>>
>>> I tested your approach but wasn't successful. Reference is stored in
>>> Properties as text. I confirmed bean is registered in Spring context
>>> with the proper BeanID.
>>>
>>> @Bean(name = "tokenCredential")
>>> public TokenCredential tokenCredential() {...create an instance}
>>>
>>> in debugger (simplified) ->
>>> camelContext.registry.lookupByName("tokenCredential") -> returns valid
>>> object
>>> .
>>> .additionalProperties("schema.registry.credential", "#tokenCredential")
>>>
>>> results into
>>> "schema.registry.credential" = "#tokenCredential"
>>>
>>> I guess the hash reference notation works only for Camel-specific
>>> fields, like
>>> .headerDeserializer("#customKafkaHeaderDeserializer") or
>>> .headerFilterStrategy("#customHeaderFilterStrategy")   // verified, works
>>>
>>> Any ideas?
>>>
>>
>> Okay so we should make this possible for additional properties as well.
>> You are welcome to create a JIRA.
>>
>>
>>
>>>
>>> čt 5. 1. 2023 v 18:22 odesílatel Claus Ibsen 
>>> napsal:
>>> >
>>> > You cannot use complex object types, only string literal, numbers,
>>> booleans
>>> > etc.
>>> >
>>> > So what you need to do is to create those objects with some bean id
>>> (spring
>>> > boot @Bean stuff) and then refer to them via their bean id.
>>> >
>>> > Something ala
>>> >
>>> >
>>> > .additionallProperties("xxx", "#myBeanId")
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Jan 5, 2023 at 6:10 PM Martin Pelikán 
>>> wrote:
>>> >
>>> > > My case is related to connecting to Azure EventHubs Avro Schema
>>> Registry.
>>> > >
>>> > > TokenCredential cred = new
>>> > >
>>> > >
>>> ClientSecretCredentialBuilder().tenantId("xxx").clientId("xxx").clientSecret("xx").build();
>>> > > props.put("schema.registry.credential", cred);
>>> > >
>>> > > Another case that comes to my mind is with OAUTHBEARER
>>> authentication.
>>> > > Users could supply instantiated AuthenticateCallbackHandler class to
>>> > > the  sasl.login.callback.handler.class property.
>>> > >
>>> > > TokenCredential as part of Properties works with
>>> > > org.apache.kafka.clients.consumer.KafkaConsumer.
>>> > >
>>> > > čt 5. 1. 2023 v 17:59 odesílatel Claus Ibsen 
>>> > > napsal:
>>> > > >
>>> > > > Whats the real world use-case for additional properties as Object
>>> or Map.
>>> > > > What would kafka understand and use these for?
>>> > > >
>>> > > > On Thu, Jan 5, 2023 at 5:12 PM Martin Pelikán 
>>> > > wrote:
>>> > > >
>>> > > > > Hi Camel experts,
>>> > > > >
>>> > > > > I am struggling with a Kafka component and passing in parameters
>>> via
>>> > > > > additionalProperties. I am not able to propagate an Object. I
>>> tested
>>> > > > > only Endpoint DSL. According to the Camel docs and APIs, I am
>>> allowed
>>> > > > > to pass in an instance of Map
>>> > > > >
>>> > > > >  Camel version: 3.18.4
>>> > > > >
>>> > > > > Pseudocode-
>>> > > > >
>>> > > > > @Configuration
>>> > > > > Class SpringConfig
>>> > > > >
>>> > > > > @Bean(name = "autowiredMap")
>>> &

Re: How to transfer messages, each at a specific time?

2023-01-13 Thread Claus Ibsen
On Fri, Jan 13, 2023 at 9:47 AM Yash Ganthe  wrote:

> Hi,
>
> Thanks for pointing it out. Does Camel make it easier to inject the
> messages on MQ with a delivery delay? Does the code become more structured
> with Camel as compared with using JMS directly?
>
>
Have you used Camel before?
If you have then you will start to understand how it abstracts a lot of
complexity and underlying APIs in a structured way.

In Artemis you set a header as follows
https://activemq.apache.org/components/artemis/documentation/latest/scheduled-messages.html

And in AMQ classic
https://activemq.apache.org/delay-and-schedule-message-delivery

If you only need JMS then you may just want to use JMS directly and program.

However when you need multiple systems to be integrated and structure this
using integration patterns, and reduce coding.
Then Camel can be something to consider.

Also Camel is becoming more and more powerful for low-code and non Java
developers, so they would also be able to design integrations,
and with little coding in other languages (or some java).

If these folks were to use JMS API and Java programming then they would
feel like they are gone back 10 years to the J2EE days.



> Regards,
> Yash
>
> On Fri, 13 Jan 2023 at 11:37, Claus Ibsen  wrote:
>
> > Hi
> >
> > ActiveMQ has scheduled message delivery, take a look at that.
> >
> >
> >
> > On Fri, Jan 13, 2023 at 5:34 AM Yash Ganthe  wrote:
> >
> > > Hi,
> > >
> > > I have about 10K messages in a CSV file. Each message has an associated
> > > timestamp for it. When the time is reached, I want the message
> delivered
> > to
> > > an MQ. The timestamps are not uniformly spread. Is this possible with
> > > Apache Camel? Which components need to be used to achieve this?
> > >
> > > Regards,
> > > Yash
> > >
> >
> >
> > --
> > 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: How to transfer messages, each at a specific time?

2023-01-12 Thread Claus Ibsen
Hi

ActiveMQ has scheduled message delivery, take a look at that.



On Fri, Jan 13, 2023 at 5:34 AM Yash Ganthe  wrote:

> Hi,
>
> I have about 10K messages in a CSV file. Each message has an associated
> timestamp for it. When the time is reached, I want the message delivered to
> an MQ. The timestamps are not uniformly spread. Is this possible with
> Apache Camel? Which components need to be used to achieve this?
>
> Regards,
> Yash
>


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


Re: How to get docker stats ?

2023-01-12 Thread Claus Ibsen
Hi

A producer to get status would be nice as well, as its easier to do with
just to docker:status?...

On Wed, Jan 11, 2023 at 7:56 PM Mark Webb  wrote:

> That worked.  Thank you.
>
>
>
> On Wed, Jan 11, 2023 at 10:43 AM Mikael Koskinen 
> wrote:
>
> > Hey,
> >
> > Can you use PollEnrich to work around this? Here's an example in YAML:
> >
> > - route:
> > from:
> >   uri: timer:test
> >   steps:
> > - pollEnrich:
> > expression:
> >   constant:
> > expression: docker:stats?containerId=fa05264a1bed
> > - to:
> > uri: log:logger
> >   parameters:
> > period: '5000'
> >
> > Best regards,
> > Mikael
> >
> > ke 11. tammik. 2023 klo 17.02 Mark Webb (elihusma...@gmail.com)
> kirjoitti:
> > >
> > > Yes, you are correct.  I had the consumer/producer backwards in my
> email.
> > >
> > > I'll look into writing up a PR.
> > >
> > > Thanks,
> > > Mark
> > >
> > >
> > >
> > > On Wed, Jan 11, 2023 at 9:18 AM Claus Ibsen 
> > wrote:
> > >
> > > > Hi
> > > >
> > > > I think you swap the camel consumer vs producer.
> > > >
> > > > from = consumer
> > > > to = producer
> > > >
> > > > So you want a on-demand get status in a producer (eg to)
> > > >
> > > > to docker:status?id=aaa
> > > >
> > > > If so then maybe see if you can add that to the camel-docer and send
> a
> > PR
> > > > and create a JIRA
> > > >
> > > > On Wed, Jan 11, 2023 at 2:42 PM Mark Webb 
> > wrote:
> > > >
> > > > > I have a Docker instance running multiple containers.  I'm trying
> to
> > > > figure
> > > > > out how to get stats for each container.  The problem I've run in
> to
> > is
> > > > > that the Docker stats operation is only a producer so I can only
> use
> > the
> > > > > "from" in a route.  So if I don't know the container ID at build
> > time,
> > > > how
> > > > > can I inject the container ID in a "from" line to follow the
> > > > producer-only
> > > > > requirement to get Docker container stats.
> > > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> >
>


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


[Follow/Help] - Apache Camel v4 work in progress

2023-01-12 Thread Claus Ibsen
Hi

We have created a room on zulip chat where you can follow and participate
with the work for Camel v4 that just started this week

https://camel.zulipchat.com/#narrow/stream/364655-camel-v4-work-in-progress

We can use the chat room to coordinate what help is needed and chances for
you to help or follow what goes on.



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


Re: How to get docker stats ?

2023-01-11 Thread Claus Ibsen
Hi

I think you swap the camel consumer vs producer.

from = consumer
to = producer

So you want a on-demand get status in a producer (eg to)

to docker:status?id=aaa

If so then maybe see if you can add that to the camel-docer and send a PR
and create a JIRA

On Wed, Jan 11, 2023 at 2:42 PM Mark Webb  wrote:

> I have a Docker instance running multiple containers.  I'm trying to figure
> out how to get stats for each container.  The problem I've run in to is
> that the Docker stats operation is only a producer so I can only use the
> "from" in a route.  So if I don't know the container ID at build time, how
> can I inject the container ID in a "from" line to follow the producer-only
> requirement to get Docker container stats.
>


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


Re: elegant error handling with temporary replyTo ?

2023-01-10 Thread Claus Ibsen
Hi

A ticket to tweak the noisy logging
https://issues.apache.org/jira/browse/CAMEL-18875

To handle the exception you can configure an exception listener on the jms
component

On Fri, Jan 6, 2023 at 12:39 PM Claus Ibsen  wrote:

> You can send a PR to tweak the log to not output the stacktrace. We could
> potentially log including stacktrace in DEBUG mode so end users can turn on
> that logging level in case the stacktrace is needed during troubleshooting
>
> On Fri, Jan 6, 2023 at 12:22 PM Mark Webb  wrote:
>
>> Sure, I could tweak the logger.  I was hoping to not have the stack trace
>> get logged, but a more user-friendly log generated.
>>
>> On Fri, Jan 6, 2023 at 12:56 AM Claus Ibsen 
>> wrote:
>>
>> > Hi
>> >
>> > Do you want that WARN to not be logged - or the logging to NOT include
>> the
>> > stacktrace?
>> > The log is hardcoded and it can happened when using temporary reply
>> queues.
>> >
>> > You can tweak the logger to set logging level to ERROR
>> > for TemporaryQueueReplyManager etc
>> >
>> >
>> > On Thu, Jan 5, 2023 at 8:51 PM Mark Webb  wrote:
>> >
>> > > I'm starting up a project that will use the request/response with
>> > ActiveMQ
>> > > AMQP.  When I try to send a message that I expect a response to and
>> > > ActiveMQ is down, I can't seem to catch or prevent the stack trace
>> from
>> > > getting logged for the TemporaryQueueReplyManager.  The error is:
>> > >
>> > > Exception inside the DMLC for Temporary ReplyTo Queue for destination
>> > ,
>> > > refreshing ReplyTo destination
>> > >
>> > > How can I go about handling this error in the temporary response
>> > > processing?  Any help would be appreciated.
>> > >
>> > > Thanks,
>> > > Mark
>> > >
>> >
>> >
>> > --
>> > Claus Ibsen
>> > -
>> > @davsclaus
>> > Camel in Action 2: https://www.manning.com/ibsen2
>> >
>>
>
>
> --
> 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: Questions regarding Graceful shutdown

2023-01-10 Thread Claus Ibsen
Hi

Okay so spring-main is using camel-main to run Camel standalone (not Spring
Boot etc) and therefore it comes with its own shutdown strategy
to ensure the entire JVM shutdown cleanly.

You cannot use  to define a custom strategy in this situation.

You can configure the spring main instance where you have a
getShutdownStrategy() method where you can configure it from java code.



On Tue, Jan 10, 2023 at 2:58 PM Gaurav Kumar 
wrote:

> I am using camel-spring-main, i will try changing to camel-main and see if
> DefaultShudownStrategy comes into action.
>
> On Tue, 10 Jan 2023, 17:30 Claus Ibsen,  wrote:
>
> > How do you start and run Camel? Do you use camel-main / camel-spring-main
> > or some other way?
> > As it indicate that if you do then it comes with its own shutdown
> strategy.
> >
> >
> > On Tue, Jan 10, 2023 at 11:42 AM Gaurav Kumar 
> > wrote:
> >
> > > Thanks  for your response.
> > >
> > > I have tried setting up in context
> > > context.setShutdownStrategy(new DefaultShutdownStrategy());
> > > and it is not working.
> > >
> > > I have configured the strategy in configuration as below
> > >
> > > * > > "org.apace.camel.impl.engine.DefaultShutdownStrategy ">*
> > > *< property name ="timeout" value ="30"*
> > > **
> > >
> > > I am running camel using spring but not Spring Boot.  Problem is I can
> > see
> > > the instance of  DefaultShutdownStrategy via JMX console but when I
> stop
> > > the application it is not getting called, instead I can see the below
> in
> > > logs.
> > >
> > >  *2022-12-05 02:43:49,424 DEBUG
> > > org.apache.camel.main.DefaultMainShutdownStrategy:75 - Received hangup
> > > signal, stopping the main instance.*
> > >
> > >
> > >
> > > On Tue, 10 Jan 2023 at 13:53, Claus Ibsen 
> wrote:
> > >
> > > > How do you run Camel? Spring Boot or some other way.
> > > >
> > > > Also you should 99% not implement your own shutdown strategy but just
> > > > configure the out of the box.
> > > >
> > > > On Tue, Jan 10, 2023 at 8:38 AM Gaurav Kumar <
> kumargaura...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi Team
> > > > > I am using camel version 3.14.4 and trying to implement clean
> > shutdown.
> > > > As
> > > > > per the link below
> > > > > https://camel.apache.org/manual/graceful-shutdown.html , I can
> > > implement
> > > > > Graceful shutdown by implementing  DefaultShutdownStrategy.
> > > > > I have added it in configuration and can see that bean has been
> > created
> > > > but
> > > > > when I shutdown the VM then I can see in the logs that
> > > > > SimpleMainShutdownStrategy  and DefaultMainShutdown Strategy is
> > getting
> > > > > called instead of  DefaultShutdownStrategy.
> > > > >
> > > > > Can you please let me know what could be the issue or any
> alternative
> > > to
> > > > > implement graceful shutdown. Basically I want to process all the
> > > > in-flight
> > > > > messages (in camel VM queues) before shutting down the VM.
> > > > >
> > > > > --
> > > > > Regards
> > > > > Gaurav
> > > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> > >
> > >
> > > --
> > > Regards
> > > Gaurav
> > >
> >
> >
> > --
> > 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: Questions regarding Graceful shutdown

2023-01-10 Thread Claus Ibsen
How do you start and run Camel? Do you use camel-main / camel-spring-main
or some other way?
As it indicate that if you do then it comes with its own shutdown strategy.


On Tue, Jan 10, 2023 at 11:42 AM Gaurav Kumar 
wrote:

> Thanks  for your response.
>
> I have tried setting up in context
> context.setShutdownStrategy(new DefaultShutdownStrategy());
> and it is not working.
>
> I have configured the strategy in configuration as below
>
> * "org.apace.camel.impl.engine.DefaultShutdownStrategy ">*
> *< property name ="timeout" value ="30"*
> **
>
> I am running camel using spring but not Spring Boot.  Problem is I can see
> the instance of  DefaultShutdownStrategy via JMX console but when I stop
> the application it is not getting called, instead I can see the below in
> logs.
>
>  *2022-12-05 02:43:49,424 DEBUG
> org.apache.camel.main.DefaultMainShutdownStrategy:75 - Received hangup
> signal, stopping the main instance.*
>
>
>
> On Tue, 10 Jan 2023 at 13:53, Claus Ibsen  wrote:
>
> > How do you run Camel? Spring Boot or some other way.
> >
> > Also you should 99% not implement your own shutdown strategy but just
> > configure the out of the box.
> >
> > On Tue, Jan 10, 2023 at 8:38 AM Gaurav Kumar 
> > wrote:
> >
> > > Hi Team
> > > I am using camel version 3.14.4 and trying to implement clean shutdown.
> > As
> > > per the link below
> > > https://camel.apache.org/manual/graceful-shutdown.html , I can
> implement
> > > Graceful shutdown by implementing  DefaultShutdownStrategy.
> > > I have added it in configuration and can see that bean has been created
> > but
> > > when I shutdown the VM then I can see in the logs that
> > > SimpleMainShutdownStrategy  and DefaultMainShutdown Strategy is getting
> > > called instead of  DefaultShutdownStrategy.
> > >
> > > Can you please let me know what could be the issue or any alternative
> to
> > > implement graceful shutdown. Basically I want to process all the
> > in-flight
> > > messages (in camel VM queues) before shutting down the VM.
> > >
> > > --
> > > Regards
> > > Gaurav
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Regards
> Gaurav
>


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


Re: [VOTE] Release Apache Camel Kamelets 3.20.1

2023-01-10 Thread Claus Ibsen
+1 (binding)

On Tue, Jan 10, 2023 at 11:46 AM Andrea Cosentino  wrote:

> Hello all:
>
> This is a vote for releasing camel-kamelets 3.20.1
>
> The release contains fixes and it's updated to Camel 3.20.1
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/3.20.1
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1514
> Kamelets Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-kamelets.git;a=shortlog;h=refs/tags/v3.20.1
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 3.20.1
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> Here's my +1.
>
> Thanks,
> Andrea Cosentino
>


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


Re: Questions regarding Graceful shutdown

2023-01-10 Thread Claus Ibsen
How do you run Camel? Spring Boot or some other way.

Also you should 99% not implement your own shutdown strategy but just
configure the out of the box.

On Tue, Jan 10, 2023 at 8:38 AM Gaurav Kumar 
wrote:

> Hi Team
> I am using camel version 3.14.4 and trying to implement clean shutdown. As
> per the link below
> https://camel.apache.org/manual/graceful-shutdown.html , I can implement
> Graceful shutdown by implementing  DefaultShutdownStrategy.
> I have added it in configuration and can see that bean has been created but
> when I shutdown the VM then I can see in the logs that
> SimpleMainShutdownStrategy  and DefaultMainShutdown Strategy is getting
> called instead of  DefaultShutdownStrategy.
>
> Can you please let me know what could be the issue or any alternative to
> implement graceful shutdown. Basically I want to process all the in-flight
> messages (in camel VM queues) before shutting down the VM.
>
> --
> Regards
> Gaurav
>


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


Re: Camel 3.X / Custom event notifier : expected events are not recieved

2023-01-09 Thread Claus Ibsen
Yes just ignore the sending event

On Mon, Jan 9, 2023 at 7:02 PM Ephemeris Lappis 
wrote:

> Hello.
>
> So the best way to get my expected events is with my settings, and
> just ignoring "ExchangeSendingEvent", right ?
> Could you please confirm that no other event type that I had not
> already seen in my tests is linked to the selected ones ?
>
> Thanks for your help.
>
> Regards.
>
> Le lun. 9 janv. 2023 à 18:57, Claus Ibsen  a écrit
> :
> >
> > Its optimized in core for these to be paired
> >
> > On Mon, Jan 9, 2023 at 6:38 PM Ephemeris Lappis <
> ephemeris.lap...@gmail.com>
> > wrote:
> >
> > > Hello.
> > >
> > > Still working on porting old code from Camel 2.X to Camel 3.X, I have
> > > a new issue. The EventNotifier in Camel 3.X is slightly refactored,
> > > and I can't get the events I expect although my settings seem correct.
> > >
> > > I'd like to get only event of Type :
> > > - ExchangeCreated
> > > - ExchangeFailed
> > > - ExchangeCompleted
> > > - ExchangeSent
> > >
> > > I understand that for Exchange* events I have to accept ExchangeEvent.
> > > But When I try to exclude ExchangeSending, ExchangeSent is not fired
> > > anymore.
> > >
> > > Here is my class :
> > >
> > > public class MyEventNotifier extends EventNotifierSupport {
> > >
> > > private Logger logger = LoggerFactory.getLogger(MyEventNotifier.class);
> > >
> > > public MyEventNotifier() {
> > > setIgnoreCamelContextInitEvents(true);
> > > setIgnoreCamelContextEvents(true);
> > > setIgnoreRouteEvents(true);
> > > setIgnoreExchangeAsyncProcessingStartedEvents(true);
> > > //  setIgnoreExchangeSendingEvents(true);
> > > }
> > >
> > > I've looked at the super classes, and I don't understand why Sent and
> > > Sending should be linked...
> > >
> > > Any ideas ? FYI I've tested it with 3.20.0 and 3.20.1, and both fail...
> > >
> > > For now I can ignore ExchangeSending events, but I'd prefer to
> > > understand how it works...
> > >
> > > Thanks for your help.
> > >
> > > Regards.
> > >
> >
> >
> > --
> > 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 3.X / Custom event notifier : expected events are not recieved

2023-01-09 Thread Claus Ibsen
Its optimized in core for these to be paired

On Mon, Jan 9, 2023 at 6:38 PM Ephemeris Lappis 
wrote:

> Hello.
>
> Still working on porting old code from Camel 2.X to Camel 3.X, I have
> a new issue. The EventNotifier in Camel 3.X is slightly refactored,
> and I can't get the events I expect although my settings seem correct.
>
> I'd like to get only event of Type :
> - ExchangeCreated
> - ExchangeFailed
> - ExchangeCompleted
> - ExchangeSent
>
> I understand that for Exchange* events I have to accept ExchangeEvent.
> But When I try to exclude ExchangeSending, ExchangeSent is not fired
> anymore.
>
> Here is my class :
>
> public class MyEventNotifier extends EventNotifierSupport {
>
> private Logger logger = LoggerFactory.getLogger(MyEventNotifier.class);
>
> public MyEventNotifier() {
> setIgnoreCamelContextInitEvents(true);
> setIgnoreCamelContextEvents(true);
> setIgnoreRouteEvents(true);
> setIgnoreExchangeAsyncProcessingStartedEvents(true);
> //  setIgnoreExchangeSendingEvents(true);
> }
>
> I've looked at the super classes, and I don't understand why Sent and
> Sending should be linked...
>
> Any ideas ? FYI I've tested it with 3.20.0 and 3.20.1, and both fail...
>
> For now I can ignore ExchangeSending events, but I'd prefer to
> understand how it works...
>
> Thanks for your help.
>
> Regards.
>


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


Re: elegant error handling with temporary replyTo ?

2023-01-06 Thread Claus Ibsen
You can send a PR to tweak the log to not output the stacktrace. We could
potentially log including stacktrace in DEBUG mode so end users can turn on
that logging level in case the stacktrace is needed during troubleshooting

On Fri, Jan 6, 2023 at 12:22 PM Mark Webb  wrote:

> Sure, I could tweak the logger.  I was hoping to not have the stack trace
> get logged, but a more user-friendly log generated.
>
> On Fri, Jan 6, 2023 at 12:56 AM Claus Ibsen  wrote:
>
> > Hi
> >
> > Do you want that WARN to not be logged - or the logging to NOT include
> the
> > stacktrace?
> > The log is hardcoded and it can happened when using temporary reply
> queues.
> >
> > You can tweak the logger to set logging level to ERROR
> > for TemporaryQueueReplyManager etc
> >
> >
> > On Thu, Jan 5, 2023 at 8:51 PM Mark Webb  wrote:
> >
> > > I'm starting up a project that will use the request/response with
> > ActiveMQ
> > > AMQP.  When I try to send a message that I expect a response to and
> > > ActiveMQ is down, I can't seem to catch or prevent the stack trace from
> > > getting logged for the TemporaryQueueReplyManager.  The error is:
> > >
> > > Exception inside the DMLC for Temporary ReplyTo Queue for destination
> > ,
> > > refreshing ReplyTo destination
> > >
> > > How can I go about handling this error in the temporary response
> > > processing?  Any help would be appreciated.
> > >
> > > Thanks,
> > > Mark
> > >
> >
> >
> > --
> > 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: Objects not propagated to Camel Kafka 3.18.4

2023-01-06 Thread Claus Ibsen
You can also use string uri instead of endpoint dsl, then you can refer to
the via kafka:?additionalProperties=#myMapBeanId

So we may need for endpoint dsl to include a fluent builder for Map that is
a string value to use for bean reference lookup

On Fri, Jan 6, 2023 at 9:31 AM Claus Ibsen  wrote:

>
>
> On Fri, Jan 6, 2023 at 9:17 AM Martin Pelikán  wrote:
>
>> Hi Claus,
>>
>> I tested your approach but wasn't successful. Reference is stored in
>> Properties as text. I confirmed bean is registered in Spring context
>> with the proper BeanID.
>>
>> @Bean(name = "tokenCredential")
>> public TokenCredential tokenCredential() {...create an instance}
>>
>> in debugger (simplified) ->
>> camelContext.registry.lookupByName("tokenCredential") -> returns valid
>> object
>> .
>> .additionalProperties("schema.registry.credential", "#tokenCredential")
>>
>> results into
>> "schema.registry.credential" = "#tokenCredential"
>>
>> I guess the hash reference notation works only for Camel-specific fields,
>> like
>> .headerDeserializer("#customKafkaHeaderDeserializer") or
>> .headerFilterStrategy("#customHeaderFilterStrategy")   // verified, works
>>
>> Any ideas?
>>
>
> Okay so we should make this possible for additional properties as well.
> You are welcome to create a JIRA.
>
>
>
>>
>> čt 5. 1. 2023 v 18:22 odesílatel Claus Ibsen 
>> napsal:
>> >
>> > You cannot use complex object types, only string literal, numbers,
>> booleans
>> > etc.
>> >
>> > So what you need to do is to create those objects with some bean id
>> (spring
>> > boot @Bean stuff) and then refer to them via their bean id.
>> >
>> > Something ala
>> >
>> >
>> > .additionallProperties("xxx", "#myBeanId")
>> >
>> >
>> >
>> >
>> > On Thu, Jan 5, 2023 at 6:10 PM Martin Pelikán 
>> wrote:
>> >
>> > > My case is related to connecting to Azure EventHubs Avro Schema
>> Registry.
>> > >
>> > > TokenCredential cred = new
>> > >
>> > >
>> ClientSecretCredentialBuilder().tenantId("xxx").clientId("xxx").clientSecret("xx").build();
>> > > props.put("schema.registry.credential", cred);
>> > >
>> > > Another case that comes to my mind is with OAUTHBEARER authentication.
>> > > Users could supply instantiated AuthenticateCallbackHandler class to
>> > > the  sasl.login.callback.handler.class property.
>> > >
>> > > TokenCredential as part of Properties works with
>> > > org.apache.kafka.clients.consumer.KafkaConsumer.
>> > >
>> > > čt 5. 1. 2023 v 17:59 odesílatel Claus Ibsen 
>> > > napsal:
>> > > >
>> > > > Whats the real world use-case for additional properties as Object
>> or Map.
>> > > > What would kafka understand and use these for?
>> > > >
>> > > > On Thu, Jan 5, 2023 at 5:12 PM Martin Pelikán 
>> > > wrote:
>> > > >
>> > > > > Hi Camel experts,
>> > > > >
>> > > > > I am struggling with a Kafka component and passing in parameters
>> via
>> > > > > additionalProperties. I am not able to propagate an Object. I
>> tested
>> > > > > only Endpoint DSL. According to the Camel docs and APIs, I am
>> allowed
>> > > > > to pass in an instance of Map
>> > > > >
>> > > > >  Camel version: 3.18.4
>> > > > >
>> > > > > Pseudocode-
>> > > > >
>> > > > > @Configuration
>> > > > > Class SpringConfig
>> > > > >
>> > > > > @Bean(name = "autowiredMap")
>> > > > > public Map autowiredMap() {
>> > > > > var map = new HashMap();
>> > > > > map.put("testStringKey3", "testStringValue3");
>> > > > > map.put("testObjectKey3", new Object());
>> > > > > }
>> > > > >
>> > > > > ---
>> > > > >
>> > > > > Class MainRoute extends RouteBuilder()
>> > > > >
>> > > > > @Autowired
>> > > > >

Re: Objects not propagated to Camel Kafka 3.18.4

2023-01-06 Thread Claus Ibsen
On Fri, Jan 6, 2023 at 9:17 AM Martin Pelikán  wrote:

> Hi Claus,
>
> I tested your approach but wasn't successful. Reference is stored in
> Properties as text. I confirmed bean is registered in Spring context
> with the proper BeanID.
>
> @Bean(name = "tokenCredential")
> public TokenCredential tokenCredential() {...create an instance}
>
> in debugger (simplified) ->
> camelContext.registry.lookupByName("tokenCredential") -> returns valid
> object
> .
> .additionalProperties("schema.registry.credential", "#tokenCredential")
>
> results into
> "schema.registry.credential" = "#tokenCredential"
>
> I guess the hash reference notation works only for Camel-specific fields,
> like
> .headerDeserializer("#customKafkaHeaderDeserializer") or
> .headerFilterStrategy("#customHeaderFilterStrategy")   // verified, works
>
> Any ideas?
>

Okay so we should make this possible for additional properties as well. You
are welcome to create a JIRA.



>
> čt 5. 1. 2023 v 18:22 odesílatel Claus Ibsen 
> napsal:
> >
> > You cannot use complex object types, only string literal, numbers,
> booleans
> > etc.
> >
> > So what you need to do is to create those objects with some bean id
> (spring
> > boot @Bean stuff) and then refer to them via their bean id.
> >
> > Something ala
> >
> >
> > .additionallProperties("xxx", "#myBeanId")
> >
> >
> >
> >
> > On Thu, Jan 5, 2023 at 6:10 PM Martin Pelikán 
> wrote:
> >
> > > My case is related to connecting to Azure EventHubs Avro Schema
> Registry.
> > >
> > > TokenCredential cred = new
> > >
> > >
> ClientSecretCredentialBuilder().tenantId("xxx").clientId("xxx").clientSecret("xx").build();
> > > props.put("schema.registry.credential", cred);
> > >
> > > Another case that comes to my mind is with OAUTHBEARER authentication.
> > > Users could supply instantiated AuthenticateCallbackHandler class to
> > > the  sasl.login.callback.handler.class property.
> > >
> > > TokenCredential as part of Properties works with
> > > org.apache.kafka.clients.consumer.KafkaConsumer.
> > >
> > > čt 5. 1. 2023 v 17:59 odesílatel Claus Ibsen 
> > > napsal:
> > > >
> > > > Whats the real world use-case for additional properties as Object or
> Map.
> > > > What would kafka understand and use these for?
> > > >
> > > > On Thu, Jan 5, 2023 at 5:12 PM Martin Pelikán 
> > > wrote:
> > > >
> > > > > Hi Camel experts,
> > > > >
> > > > > I am struggling with a Kafka component and passing in parameters
> via
> > > > > additionalProperties. I am not able to propagate an Object. I
> tested
> > > > > only Endpoint DSL. According to the Camel docs and APIs, I am
> allowed
> > > > > to pass in an instance of Map
> > > > >
> > > > >  Camel version: 3.18.4
> > > > >
> > > > > Pseudocode-
> > > > >
> > > > > @Configuration
> > > > > Class SpringConfig
> > > > >
> > > > > @Bean(name = "autowiredMap")
> > > > > public Map autowiredMap() {
> > > > > var map = new HashMap();
> > > > > map.put("testStringKey3", "testStringValue3");
> > > > > map.put("testObjectKey3", new Object());
> > > > > }
> > > > >
> > > > > ---
> > > > >
> > > > > Class MainRoute extends RouteBuilder()
> > > > >
> > > > > @Autowired
> > > > > @Qualifier("autowiredMap")
> > > > > Map autowiredMap;
> > > > >
> > > > > var map = new HashMap();
> > > > > map.put("testStringKey1", "testStringValue1");
> > > > > map.put("testObjectKey1", new Object());
> > > > >
> > > > > from(kafka(…basic configuration works)
> > > > > .schemaRegistryURL(http://original.com)
> > > > > .additionalProperties(map)
> > > > > .additionalProperties("testStringKey2", "testStringValue2")
> > > > > .additionalProperties("testObjectKey1", new Object())
> > > > > .additionalP

Re: elegant error handling with temporary replyTo ?

2023-01-05 Thread Claus Ibsen
Hi

Do you want that WARN to not be logged - or the logging to NOT include the
stacktrace?
The log is hardcoded and it can happened when using temporary reply queues.

You can tweak the logger to set logging level to ERROR
for TemporaryQueueReplyManager etc


On Thu, Jan 5, 2023 at 8:51 PM Mark Webb  wrote:

> I'm starting up a project that will use the request/response with ActiveMQ
> AMQP.  When I try to send a message that I expect a response to and
> ActiveMQ is down, I can't seem to catch or prevent the stack trace from
> getting logged for the TemporaryQueueReplyManager.  The error is:
>
> Exception inside the DMLC for Temporary ReplyTo Queue for destination ,
> refreshing ReplyTo destination
>
> How can I go about handling this error in the temporary response
> processing?  Any help would be appreciated.
>
> Thanks,
> Mark
>


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


Re: Objects not propagated to Camel Kafka 3.18.4

2023-01-05 Thread Claus Ibsen
You cannot use complex object types, only string literal, numbers, booleans
etc.

So what you need to do is to create those objects with some bean id (spring
boot @Bean stuff) and then refer to them via their bean id.

Something ala


.additionallProperties("xxx", "#myBeanId")




On Thu, Jan 5, 2023 at 6:10 PM Martin Pelikán  wrote:

> My case is related to connecting to Azure EventHubs Avro Schema Registry.
>
> TokenCredential cred = new
>
> ClientSecretCredentialBuilder().tenantId("xxx").clientId("xxx").clientSecret("xx").build();
> props.put("schema.registry.credential", cred);
>
> Another case that comes to my mind is with OAUTHBEARER authentication.
> Users could supply instantiated AuthenticateCallbackHandler class to
> the  sasl.login.callback.handler.class property.
>
> TokenCredential as part of Properties works with
> org.apache.kafka.clients.consumer.KafkaConsumer.
>
> čt 5. 1. 2023 v 17:59 odesílatel Claus Ibsen 
> napsal:
> >
> > Whats the real world use-case for additional properties as Object or Map.
> > What would kafka understand and use these for?
> >
> > On Thu, Jan 5, 2023 at 5:12 PM Martin Pelikán 
> wrote:
> >
> > > Hi Camel experts,
> > >
> > > I am struggling with a Kafka component and passing in parameters via
> > > additionalProperties. I am not able to propagate an Object. I tested
> > > only Endpoint DSL. According to the Camel docs and APIs, I am allowed
> > > to pass in an instance of Map
> > >
> > >  Camel version: 3.18.4
> > >
> > > Pseudocode-
> > >
> > > @Configuration
> > > Class SpringConfig
> > >
> > > @Bean(name = "autowiredMap")
> > > public Map autowiredMap() {
> > > var map = new HashMap();
> > > map.put("testStringKey3", "testStringValue3");
> > > map.put("testObjectKey3", new Object());
> > > }
> > >
> > > ---
> > >
> > > Class MainRoute extends RouteBuilder()
> > >
> > > @Autowired
> > > @Qualifier("autowiredMap")
> > > Map autowiredMap;
> > >
> > > var map = new HashMap();
> > > map.put("testStringKey1", "testStringValue1");
> > > map.put("testObjectKey1", new Object());
> > >
> > > from(kafka(…basic configuration works)
> > > .schemaRegistryURL(http://original.com)
> > > .additionalProperties(map)
> > > .additionalProperties("testStringKey2", "testStringValue2")
> > > .additionalProperties("testObjectKey1", new Object())
> > > .additionalProperties("schema.registry.url",
> http://overwritten.com)
> > > .additionalProperties(autowiredMap)...
> > >
> > > Expected:
> > >
> > > All properties from all additionalProperties methods are propagated to
> > > the Kafka Properties configuration object.
> > >
> > > In reality, Properties will contain the following:
> > > schema.registry.url=http://overwritten.com
> > > testStringKey1=testStringValue1
> > > testStringKey2=testStringValue2
> > >
> > > Non-string values are not propagated at all. Values from autowired Map
> > > are not propagated at all. Autowired map is treated as
> > > additionalProperties.autowiredMap=HashMap@123456
> > >
> > > I can see those String values being added to the Kafka Endpoint URI:
> > >
> > >
> kafka://additionalProperties.testStringKey1=xxx=xxx=xxx..
> > >
> > > Is it a bug in Camel or did I understand the documentation wrong? I
> > > can prepare a test case later
> > >
> > > Best regards,
> > >
> > > Martin
> > >
> >
> >
> > --
> > 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: Objects not propagated to Camel Kafka 3.18.4

2023-01-05 Thread Claus Ibsen
Whats the real world use-case for additional properties as Object or Map.
What would kafka understand and use these for?

On Thu, Jan 5, 2023 at 5:12 PM Martin Pelikán  wrote:

> Hi Camel experts,
>
> I am struggling with a Kafka component and passing in parameters via
> additionalProperties. I am not able to propagate an Object. I tested
> only Endpoint DSL. According to the Camel docs and APIs, I am allowed
> to pass in an instance of Map
>
>  Camel version: 3.18.4
>
> Pseudocode-
>
> @Configuration
> Class SpringConfig
>
> @Bean(name = "autowiredMap")
> public Map autowiredMap() {
> var map = new HashMap();
> map.put("testStringKey3", "testStringValue3");
> map.put("testObjectKey3", new Object());
> }
>
> ---
>
> Class MainRoute extends RouteBuilder()
>
> @Autowired
> @Qualifier("autowiredMap")
> Map autowiredMap;
>
> var map = new HashMap();
> map.put("testStringKey1", "testStringValue1");
> map.put("testObjectKey1", new Object());
>
> from(kafka(…basic configuration works)
> .schemaRegistryURL(http://original.com)
> .additionalProperties(map)
> .additionalProperties("testStringKey2", "testStringValue2")
> .additionalProperties("testObjectKey1", new Object())
> .additionalProperties("schema.registry.url", http://overwritten.com)
> .additionalProperties(autowiredMap)...
>
> Expected:
>
> All properties from all additionalProperties methods are propagated to
> the Kafka Properties configuration object.
>
> In reality, Properties will contain the following:
> schema.registry.url=http://overwritten.com
> testStringKey1=testStringValue1
> testStringKey2=testStringValue2
>
> Non-string values are not propagated at all. Values from autowired Map
> are not propagated at all. Autowired map is treated as
> additionalProperties.autowiredMap=HashMap@123456
>
> I can see those String values being added to the Kafka Endpoint URI:
>
> kafka://additionalProperties.testStringKey1=xxx=xxx=xxx..
>
> Is it a bug in Camel or did I understand the documentation wrong? I
> can prepare a test case later
>
> Best regards,
>
> Martin
>


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


Re: Camel JBang OpenAPI to REST DSL generator issue with enums: Unsupported field: allowableValues

2022-12-30 Thread Claus Ibsen
Hi

Okay I have fixed this for 3.20.1 onwards

allowableValues:
  - available
  - pending
  - sold

On Thu, Dec 29, 2022 at 8:50 PM Claus Ibsen  wrote:

>
>
> On Thu, Dec 29, 2022 at 8:46 PM Mikael Koskinen 
> wrote:
>
>> Hey,
>>
>> Unfortunately I don't have the ASF Jira account and the registration
>> to Jira is disabled so I can't submit the ticket.
>>
>>
> The guide how to create ASF account is linked in the text in the top, eg
> its
> https://infra.apache.org/jira-guidelines.html#who
>
>
>> Best regards,
>> Mikael
>>
>> to 29. jouluk. 2022 klo 21.12 Claus Ibsen (claus.ib...@gmail.com)
>> kirjoitti:
>> >
>> > Hi
>> >
>> > Yeah it smells like a yaml-dsl bug, can you create a JIRA ticket
>> >
>> > On Thu, Dec 29, 2022 at 10:24 AM Mikael Koskinen 
>> wrote:
>> >
>> > > Hey,
>> > >
>> > > Just a quick update: Here's a minimal gist which shows the issue:
>> > >
>> > > camel run
>> > > https://gist.github.com/mikoskinen/dccfffd7b6fa6d95f5a0bce66e491765
>> > >
>> > > Hope this helps.
>> > >
>> > > Best regards,
>> > > Mikael
>> > >
>> > > to 29. jouluk. 2022 klo 11.08 Mikael Koskinen (mijap...@gmail.com)
>> > > kirjoitti:
>> > > >
>> > > > Hi,
>> > > >
>> > > > I'm testing the Camel JBang 3.20 OpenAPI to REST generator and
>> > > > encountering some issues with enums when trying to run the generated
>> > > > file. The schema in the error message looks peculiar when trying to
>> > > > run the XML DSL as it points to spring but I'm not sure if it should
>> > > > look like that.
>> > > >
>> > > > Error with XML Rest DSL:
>> > > > org.apache.camel.RuntimeCamelException:
>> > > > org.apache.camel.xml.io.XmlPullParserException: Unexpected element
>> > > > '{http://camel.apache.org/schema/spring}allowableValues'
>> > > >
>> > > > Error with YAML Rest DSL:
>> > > > Unsupported field: allowableValues
>> > > >  in file:myroutes.yaml, line 124, column 11:
>> > > >   value:
>> > > >
>> > > > More information follows:
>> > > >
>> > > > I'm using the PetStore OpenAPI 3 spec:
>> > > >
>> > >
>> https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
>> > > >
>> > > > I'm generating the REST DSL using:
>> > > >
>> > > > camel generate rest -i openapi.yaml -o myroutes.yaml
>> > > >
>> > > > The generation goes through without errors. But Camel isn't able to
>> > > > parse the generated file when trying to run the routes using camel
>> run
>> > > > myroutes.yaml:
>> > > >
>> > > > ---
>> > > > Unsupported field: allowableValues
>> > > >  in file:myroutes.yaml, line 124, column 11:
>> > > >   value:
>> > > >   ^
>> > > >
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$1.construct(YamlDeserializationContext.java:171)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asType(YamlDeserializerSupport.java:344)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:322)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatCollection(YamlDeserializerSupport.java:298)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatList(YamlDeserializerSupport.java:277)
>> > > > at
>> > >
>> org.apache.camel.dsl.yaml.deserializers.Model

Re: Camel JBang OpenAPI to REST DSL generator issue with enums: Unsupported field: allowableValues

2022-12-29 Thread Claus Ibsen
On Thu, Dec 29, 2022 at 8:46 PM Mikael Koskinen  wrote:

> Hey,
>
> Unfortunately I don't have the ASF Jira account and the registration
> to Jira is disabled so I can't submit the ticket.
>
>
The guide how to create ASF account is linked in the text in the top, eg its
https://infra.apache.org/jira-guidelines.html#who


> Best regards,
> Mikael
>
> to 29. jouluk. 2022 klo 21.12 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> >
> > Hi
> >
> > Yeah it smells like a yaml-dsl bug, can you create a JIRA ticket
> >
> > On Thu, Dec 29, 2022 at 10:24 AM Mikael Koskinen 
> wrote:
> >
> > > Hey,
> > >
> > > Just a quick update: Here's a minimal gist which shows the issue:
> > >
> > > camel run
> > > https://gist.github.com/mikoskinen/dccfffd7b6fa6d95f5a0bce66e491765
> > >
> > > Hope this helps.
> > >
> > > Best regards,
> > > Mikael
> > >
> > > to 29. jouluk. 2022 klo 11.08 Mikael Koskinen (mijap...@gmail.com)
> > > kirjoitti:
> > > >
> > > > Hi,
> > > >
> > > > I'm testing the Camel JBang 3.20 OpenAPI to REST generator and
> > > > encountering some issues with enums when trying to run the generated
> > > > file. The schema in the error message looks peculiar when trying to
> > > > run the XML DSL as it points to spring but I'm not sure if it should
> > > > look like that.
> > > >
> > > > Error with XML Rest DSL:
> > > > org.apache.camel.RuntimeCamelException:
> > > > org.apache.camel.xml.io.XmlPullParserException: Unexpected element
> > > > '{http://camel.apache.org/schema/spring}allowableValues'
> > > >
> > > > Error with YAML Rest DSL:
> > > > Unsupported field: allowableValues
> > > >  in file:myroutes.yaml, line 124, column 11:
> > > >   value:
> > > >
> > > > More information follows:
> > > >
> > > > I'm using the PetStore OpenAPI 3 spec:
> > > >
> > >
> https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
> > > >
> > > > I'm generating the REST DSL using:
> > > >
> > > > camel generate rest -i openapi.yaml -o myroutes.yaml
> > > >
> > > > The generation goes through without errors. But Camel isn't able to
> > > > parse the generated file when trying to run the routes using camel
> run
> > > > myroutes.yaml:
> > > >
> > > > ---
> > > > Unsupported field: allowableValues
> > > >  in file:myroutes.yaml, line 124, column 11:
> > > >   value:
> > > >   ^
> > > >
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$1.construct(YamlDeserializationContext.java:171)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asType(YamlDeserializerSupport.java:344)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:322)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatCollection(YamlDeserializerSupport.java:298)
> > > > at
> > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatList(YamlDeserializerSupport.java:277)
> > > > at
> > >
> org.apache.camel.dsl.yaml.deserializers.ModelDeserializers$GetDefinitionDeserializer.setProperty(ModelDeserializers.java:5563)
> > > > ---
> > > >
> > > > The generated file contains this which based on the error is failing:
> > > >
> > > > get:
> > > > - id: "findPetsByStatus"
> > > >   path: "/pet/findByStatus"
> > > >   description: "Multiple status values can be provided with comma
> > > > separated strings"
> > > >   produces: "application/xml,application/json"
> > > >   param:
> > > &

Re: Camel JBang OpenAPI to REST DSL generator issue with enums: Unsupported field: allowableValues

2022-12-29 Thread Claus Ibsen
Hi

Okay so if you use as a workaround (its due to the model being special -
and it may even cause XML DSL to be wrong as well)

@XmlElementWrapper(name = "allowableValues")
@XmlElement(name = "value")
private List allowableValues;

value:
  - available
  - pending
  - sold




On Thu, Dec 29, 2022 at 8:11 PM Claus Ibsen  wrote:

> Hi
>
> Yeah it smells like a yaml-dsl bug, can you create a JIRA ticket
>
> On Thu, Dec 29, 2022 at 10:24 AM Mikael Koskinen 
> wrote:
>
>> Hey,
>>
>> Just a quick update: Here's a minimal gist which shows the issue:
>>
>> camel run
>> https://gist.github.com/mikoskinen/dccfffd7b6fa6d95f5a0bce66e491765
>>
>> Hope this helps.
>>
>> Best regards,
>> Mikael
>>
>> to 29. jouluk. 2022 klo 11.08 Mikael Koskinen (mijap...@gmail.com)
>> kirjoitti:
>> >
>> > Hi,
>> >
>> > I'm testing the Camel JBang 3.20 OpenAPI to REST generator and
>> > encountering some issues with enums when trying to run the generated
>> > file. The schema in the error message looks peculiar when trying to
>> > run the XML DSL as it points to spring but I'm not sure if it should
>> > look like that.
>> >
>> > Error with XML Rest DSL:
>> > org.apache.camel.RuntimeCamelException:
>> > org.apache.camel.xml.io.XmlPullParserException: Unexpected element
>> > '{http://camel.apache.org/schema/spring}allowableValues'
>> >
>> > Error with YAML Rest DSL:
>> > Unsupported field: allowableValues
>> >  in file:myroutes.yaml, line 124, column 11:
>> >   value:
>> >
>> > More information follows:
>> >
>> > I'm using the PetStore OpenAPI 3 spec:
>> >
>> https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml
>> >
>> > I'm generating the REST DSL using:
>> >
>> > camel generate rest -i openapi.yaml -o myroutes.yaml
>> >
>> > The generation goes through without errors. But Camel isn't able to
>> > parse the generated file when trying to run the routes using camel run
>> > myroutes.yaml:
>> >
>> > ---
>> > Unsupported field: allowableValues
>> >  in file:myroutes.yaml, line 124, column 11:
>> >   value:
>> >   ^
>> >
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$1.construct(YamlDeserializationContext.java:171)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asType(YamlDeserializerSupport.java:344)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asCollection(YamlDeserializerSupport.java:322)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatCollection(YamlDeserializerSupport.java:298)
>> > at
>> org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asFlatList(YamlDeserializerSupport.java:277)
>> > at
>> org.apache.camel.dsl.yaml.deserializers.ModelDeserializers$GetDefinitionDeserializer.setProperty(ModelDeserializers.java:5563)
>> > ---
>> >
>> > The generated file contains this which based on the error is failing:
>> >
>> > get:
>> > - id: "findPetsByStatus"
>> >   path: "/pet/findByStatus"
>> >   description: "Multiple status values can be provided with comma
>> > separated strings"
>> >   produces: "application/xml,application/json"
>> >   param:
>> >   - dataType: "string"
>> > defaultValue: "available"
>> > description: "Status values that need to be considered for
>> filter"
>> > name: "status"
>> > required: false
>> > type: "query"
>> > allowableValues:
>> >   value:
>> >   - "available"
>> >   - "pending"
>> >   - "sold"
>> >   to: "direct:findPetsByStatus"
>> >
>> > The original OpenAPI spec has this:
>> >
>> >   /pe

Re: Camel JBang OpenAPI to REST DSL generator issue with enums: Unsupported field: allowableValues

2022-12-29 Thread Claus Ibsen
 I also tried generating XML DSL and it gives the following error when
> running:
> >
> > org.apache.camel.RuntimeCamelException:
> > org.apache.camel.xml.io.XmlPullParserException: Unexpected element
> > '{http://camel.apache.org/schema/spring}allowableValues'
> >
> > I tried to find the relevant parts from the Apache Camel's source code
> > and AFAIK it tries to handle allowableValues. The schema in the XML
> > error looks strange though with a reference to spring. Should that be
> > rest instead?
> >
> > Everything works OK with a simpler schema
> > (
> https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore.yaml
> )
> >
> > Is this a known issue or is there some setting I could change to make
> > things work? Thanks in advance!
> >
> > Best regards,
> > Mikael
>


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


Re: Camel JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-28 Thread Claus Ibsen
On Wed, Dec 28, 2022 at 5:11 PM Mikael Koskinen  wrote:

> Hi,
>
> Ok, thanks! In the future I'm happy to submit pull requests. Just need
> to get the Camel development environment up and running.
>
> The reason for turning off "remove all routes" was that I was trying
> to see if it was possible to live reload just the changed route, not
> all. I created five routes each in its own file, using YAML. I then
> enabled live reload and by default changing one of the files caused
> all the routes to reload. Turning off "remove all routes" seemed to
> give the desired result where only the changed route was reloaded.
>
>
Ah thanks, yeah that works when you have assigned route ids.

Its a bit more tricky if all 5 routes are in the same file, then currently
we do not know which routes have changed or not.
It depends a bit what kind of DSL you use (YAML, XML, Java, Groovy) whether
we in the future would be able to known eacty which
parts of the file were changed and can then calculate which routes.

However that can be a bit overkill for a feature like this for development
purposes.


> Thanks again!
>
> ti 27. jouluk. 2022 klo 15.03 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> >
> > Hi
> >
> > I have just fixed that to be !route so the WARN is only logged when
> no
> > custom id has been set.
> >
> > On Mon, Dec 26, 2022 at 4:08 PM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > Ah yeah it should be NOT custom id assigned.
> > > You are welcome to send a PR
> > >
> > > BTW is there a reason you turn off remove all routes?
> > >
> > >
> > > So the code should be like:
> > >
> > > if (!route.isCustomId()) {
> > >
> > >
> > >
> > > On Mon, Dec 26, 2022 at 2:40 PM Mikael Koskinen 
> > > wrote:
> > >
> > >> Hi again,
> > >>
> > >> I checked the source code of RouteWatcherReloadStrategy from here:
> > >>
> > >>
> https://github.com/apache/camel/blob/00526e77bfa88bc20bcde640487cf7d83629e49d/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java#L274
> > >>
> > >> To me it looks like the warning "Routes with no id's detected"... is
> > >> always printed if there are routes with custom ids:
> > >>
> > >> for (String id : ids) {
> > >> Route route = getCamelContext().getRoute(id);
> > >> if (route.isCustomId()) {
> > >> sj.add(route.getEndpoint().getEndpointUri());
> > >> }
> > >> }
> > >> if (sj.length() > 0) {
> > >> LOG.warn(
> > >> "Routes with no id's detected. Its
> > >> recommended to assign route id's to your routes so Camel can reload
> > >> the routes correctly.\nUnassigned routes:\n{}",
> > >> sj);
> > >> }
> > >>
> > >> ma 26. jouluk. 2022 klo 15.30 Mikael Koskinen (mijap...@gmail.com)
> > >> kirjoitti:
> > >> >
> > >> > Hey,
> > >> >
> > >> > Hmm, I'm not sure. The unit test you linked seems to use the "id"
> > >> > field like I used when defining the route. But the assert uses
> > >> > "routeId".  For example the test:
> > >> >
> > >> > when:
> > >> > loadRoutes '''
> > >> > - route:
> > >> > id: demo-route < Here's the "id" field
> > >> > def "load route inlined camelCase"() {
> > >> >
> > >> > But in the assert:
> > >> >
> > >> > context.routeDefinitions.size() == 1
> > >> >
> > >> > with(context.routeDefinitions[0], RouteDefinition) {
> > >> > routeId == 'demo-route' <- Here's routeId instead of "id"
> > >> >
> > >> > But as I previously tested, Karavan uses "id".
> > >> >
> > >> > In the first message I posted the log seems to state that "id" is
> the
> > >> > way to go as Camel reports when starting the route:
> > >> >
> > >> > 2022-12-26 11:28:42.504  INFO 79551 --- [
> > >> > main]e.camel.impl.engine.AbstractCamelContext : Start

Re: Camel errorHandler doesn't log before or after sending message to the dead letter channel

2022-12-28 Thread Claus Ibsen
On Tue, Dec 27, 2022 at 9:14 PM Burcu Egri 
wrote:

> Thank you, Claus, for this important caution but we didn't notice this in
> Camel documentation.
> We are newly developing our projects with Camel, and it is important for
> us to use most promising ways.
> Which DSL is most valuable for future use cases?
> Is there any roadmap for Camel? I found some old roadmaps.
>
>
Camel v4 will be posted as a blog next month.
And there is JIRA which has fix-version assigned to tickets so you can
follow what comes in next release(s).



> My other question is about your DLQ route suggestion.
> We found a way for logging in errorHandler by using onPrepareFailureRef
> attribute.
> Which way is good a new DLQ route or onPrepareFailureRef?
>
>
onPrepare is very good, but it requires you to write a Camel Java processor
and do the logging via java code.

A route allows you to use Camel DSL and you can do a lot more. But its
often overkill, and you also should
keep the route small and simple as you want to ensure the message gets
routed to the DLQ.




> Thanks again,
> Burcu
>
> -Original Message-
> From: Claus Ibsen 
> Sent: Tuesday, December 27, 2022 3:44 PM
> To: users@camel.apache.org
> Subject: Re: Camel errorHandler doesn't log before or after sending
> message to the dead letter channel
>
> CAUTION: This email originated from outside of the organisation. Do not
> click links or open attachments unless you recognise the sender and know
> the content is safe.
>
>
> Hi
>
> Just a caution that using camel-spring-xml with Spring XML is becoming
> legacy/deprecated.
> It is the very old XML DSL in Camel v1/v2.
>
> So what you can do is to use a route as DLQ that uses direct where you can
> then do
>
> from direct myDLQ
>log bla blah
> to jms:dead
>
> And then configure the error handler to use direct myDLQ
>
> Then you can do anything you like in the route
>
>
> On Tue, Dec 27, 2022 at 12:58 PM Burcu Egri 
> wrote:
>
> > Hi,
> > Thank you for your reply...
> >
> > Yes, I refer the  inside errorHandler.
> > Do you mean that
> > org.apache.camel.spring.xml.handler.ErrorHandlerDefinitionParser.doPar
> > se
> > should parse ?
> >
> > I checked your suggestions, but the first 2 parameters are related
> > with the redeliveryPolicy and our aim is to log just after errorHandler
> started.
> > In the future we are planning to remove redeliveryPolicy part...
> >
> > I tried to set logName attribute in errorHandler but I am getting
> > below error message.
> >
> > Caused by: org.springframework.beans.NotWritablePropertyException:
> > Invalid property 'logName' of bean class
> > [org.apache.camel.builder.LegacyDeadLetterChannelBuilder]: Bean
> > property 'logName' is not writable or has an invalid setter method.
> > Does the parameter type of the setter match the return type of the
> getter?
> >
> > In addition to this I tried to set name from Java inside
> > CamelContextConfiguration. beforeApplicationStart
> > camelContext.getGlobalOptions().put(Exchange.LOG_EIP_NAME, "
> > com.mypackage ");
> >
> > but I am not sure how to set message because  is not parsed in
> > errorHandler. We need to find a way to set log message.
> >
> > Do you have any other suggestion?
> >
> > Best regards,
> > Burcu
> >
> > -Original Message-
> > From: Claus Ibsen 
> > Sent: Tuesday, December 27, 2022 1:44 PM
> > To: users@camel.apache.org
> > Subject: Re: Camel errorHandler doesn't log before or after sending
> > message to the dead letter channel
> >
> > CAUTION: This email originated from outside of the organisation. Do
> > not click links or open attachments unless you recognise the sender
> > and know the content is safe.
> >
> >
> > Hi
> >
> > If you refer to 
> >
> >  >   loggingLevel="ERROR" message="Pushing to backout
> > queue"/>
> >
> > As something that is supposed to be parsed by that spring code, then
> > that is not.
> > The  is Log EIP and not really part of the error handler.
> >
> > The following options is what configures how "verbose" the error
> > handler is when it executes and what it logs
> >
> > retryAttemptedLogLevel="WARN"
> > retriesExhaustedLogLevel="ERROR"/>
> >
> > You can use logName to use a custom logger instead of the default
> >
> >   > useOriginalBody="true"
> > 

Re: Camel JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-27 Thread Claus Ibsen
Hi

I have just fixed that to be !route so the WARN is only logged when no
custom id has been set.

On Mon, Dec 26, 2022 at 4:08 PM Claus Ibsen  wrote:

> Hi
>
> Ah yeah it should be NOT custom id assigned.
> You are welcome to send a PR
>
> BTW is there a reason you turn off remove all routes?
>
>
> So the code should be like:
>
> if (!route.isCustomId()) {
>
>
>
> On Mon, Dec 26, 2022 at 2:40 PM Mikael Koskinen 
> wrote:
>
>> Hi again,
>>
>> I checked the source code of RouteWatcherReloadStrategy from here:
>>
>> https://github.com/apache/camel/blob/00526e77bfa88bc20bcde640487cf7d83629e49d/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java#L274
>>
>> To me it looks like the warning "Routes with no id's detected"... is
>> always printed if there are routes with custom ids:
>>
>> for (String id : ids) {
>> Route route = getCamelContext().getRoute(id);
>> if (route.isCustomId()) {
>> sj.add(route.getEndpoint().getEndpointUri());
>> }
>> }
>> if (sj.length() > 0) {
>> LOG.warn(
>> "Routes with no id's detected. Its
>> recommended to assign route id's to your routes so Camel can reload
>> the routes correctly.\nUnassigned routes:\n{}",
>> sj);
>> }
>>
>> ma 26. jouluk. 2022 klo 15.30 Mikael Koskinen (mijap...@gmail.com)
>> kirjoitti:
>> >
>> > Hey,
>> >
>> > Hmm, I'm not sure. The unit test you linked seems to use the "id"
>> > field like I used when defining the route. But the assert uses
>> > "routeId".  For example the test:
>> >
>> > when:
>> > loadRoutes '''
>> > - route:
>> > id: demo-route < Here's the "id" field
>> > def "load route inlined camelCase"() {
>> >
>> > But in the assert:
>> >
>> > context.routeDefinitions.size() == 1
>> >
>> > with(context.routeDefinitions[0], RouteDefinition) {
>> > routeId == 'demo-route' <- Here's routeId instead of "id"
>> >
>> > But as I previously tested, Karavan uses "id".
>> >
>> > In the first message I posted the log seems to state that "id" is the
>> > way to go as Camel reports when starting the route:
>> >
>> > 2022-12-26 11:28:42.504  INFO 79551 --- [
>> > main]e.camel.impl.engine.AbstractCamelContext : Started firstRoute
>> >
>> > Where "firstRoute" is the "id". But the problem is that when live
>> > reloading happens, Camel reports that no id has been set. Even though
>> > in the previous line it states that the route with id "firstRoute" has
>> > been started.
>> >
>> > ma 26. jouluk. 2022 klo 14.58 Claus Ibsen (claus.ib...@gmail.com)
>> kirjoitti:
>> > >
>> > > Hi
>> > >
>> > > See some unit tests
>> > >
>> https://github.com/apache/camel/blob/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesTest.groovy#L198
>> > >
>> > > You can also use Apache Camel Karavan to design yaml routes as it
>> builds
>> > > the YAML correct
>> > >
>> > >
>> > >
>> > > On Mon, Dec 26, 2022 at 12:09 PM Mikael Koskinen 
>> wrote:
>> > >
>> > > > Thanks! I tried routeId and route-id but got the following error on
>> both:
>> > > >
>> > > > Unsupported field: routeId
>> > > >  in file:timers.yaml, line 2, column 5:
>> > > > routeId: firstRoute
>> > > > ^
>> > > >
>> > > > at
>> > > >
>> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:128)
>> > > > at
>> > > >
>> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:33)
>> > > >     at
>> > > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
>> > > > at
>> > > >
>> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationCo

Re: Camel errorHandler doesn't log before or after sending message to the dead letter channel

2022-12-27 Thread Claus Ibsen
Hi

Just a caution that using camel-spring-xml with Spring XML is becoming
legacy/deprecated.
It is the very old XML DSL in Camel v1/v2.

So what you can do is to use a route as DLQ that uses direct where you can
then do

from direct myDLQ
   log bla blah
to jms:dead

And then configure the error handler to use direct myDLQ

Then you can do anything you like in the route


On Tue, Dec 27, 2022 at 12:58 PM Burcu Egri
 wrote:

> Hi,
> Thank you for your reply...
>
> Yes, I refer the  inside errorHandler.
> Do you mean that
> org.apache.camel.spring.xml.handler.ErrorHandlerDefinitionParser.doParse
> should parse ?
>
> I checked your suggestions, but the first 2 parameters are related with
> the redeliveryPolicy and our aim is to log just after errorHandler started.
> In the future we are planning to remove redeliveryPolicy part...
>
> I tried to set logName attribute in errorHandler but I am getting below
> error message.
>
> Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
> property 'logName' of bean class
> [org.apache.camel.builder.LegacyDeadLetterChannelBuilder]: Bean property
> 'logName' is not writable or has an invalid setter method. Does the
> parameter type of the setter match the return type of the getter?
>
> In addition to this I tried to set name from Java inside
> CamelContextConfiguration. beforeApplicationStart
> camelContext.getGlobalOptions().put(Exchange.LOG_EIP_NAME, " com.mypackage
> ");
>
> but I am not sure how to set message because  is not parsed in
> errorHandler. We need to find a way to set log message.
>
> Do you have any other suggestion?
>
> Best regards,
> Burcu
>
> -Original Message-
> From: Claus Ibsen 
> Sent: Tuesday, December 27, 2022 1:44 PM
> To: users@camel.apache.org
> Subject: Re: Camel errorHandler doesn't log before or after sending
> message to the dead letter channel
>
> CAUTION: This email originated from outside of the organisation. Do not
> click links or open attachments unless you recognise the sender and know
> the content is safe.
>
>
> Hi
>
> If you refer to 
>
>loggingLevel="ERROR" message="Pushing to backout queue"/>
>
> As something that is supposed to be parsed by that spring code, then that
> is not.
> The  is Log EIP and not really part of the error handler.
>
> The following options is what configures how "verbose" the error handler
> is when it executes and what it logs
>
> retryAttemptedLogLevel="WARN"
> retriesExhaustedLogLevel="ERROR"/>
>
> You can use logName to use a custom logger instead of the default
>
>   useOriginalBody="true"
> logName=""
> deadLetterUri="jms:queue:mybackoutq">
>
>
>
>
> On Tue, Dec 27, 2022 at 11:35 AM Burcu Egri 
> wrote:
>
> > After some investigation in Apache-Camel sources, we see that parser
> > do not parse log line in errorHandler section (see
> > https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> > ub.com%2Fapache%2Fcamel%2Fblob%2Fmain%2Fcomponents%2Fcamel-spring-xml%
> > 2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fcamel%2Fspring%2Fxml%2Fhandler%2F
> > ErrorHandlerDefinitionParser.java%23L77=05%7C01%7CBurcu.Egri%40ae
> > rlingus.com%7Cb2261550ed5f45abb72c08dae7f74c1b%7C57bf7636536c46bf9adef
> > 72b859bc5c0%7C0%7C0%7C638077346559845038%7CUnknown%7CTWFpbGZsb3d8eyJWI
> > joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7
> > C%7C%7C=fIYP0Tn5BAOOBt26v3YSpMkTNcCHZs5QGDhYuuhPKXk%3D=
> > 0]
> > ).
> >
> > It seems it is a bug.
> >
> > Are there anybody to confirm this bug?
> >
> > -Original Message-
> > From: Burcu Egri 
> > Sent: Tuesday, December 27, 2022 12:28 AM
> > To: users@camel.apache.org
> > Subject: Camel errorHandler doesn't log before or after sending
> > message to the dead letter channel
> >
> > CAUTION: This email originated from outside of the organisation. Do
> > not click links or open attachments unless you recognise the sender
> > and know the content is safe.
> >
> >
> > We have a simple Camel route like below. But we have noticed that
> > errorHandler log is not working. After some investigation, we
> > understood that errorHandler has different log parameters then other
> > logs(like in route or onException).
> >
> > We haven't succeeded to use errorHandler log. Yes, there are so many
> > 

Re: Camel 3.X / DataFormat BeanIO

2022-12-27 Thread Claus Ibsen
And only if beanio become active again and do new releases we can consider
adding it back.

There is a 3.0 M1 release but its 1.5 years old, and only a few commits
since that time. You can reach out to beanio on github
and see if the maintainer can become active again, or you can ask if you
can help out the project and make v3 a GA release
and active maintained so it can come back into Camel.

Yes I think a great flat file/csv/kvp project is very usable but it's sadly
hard to do in open source as nobody sponsors such projects.


On Tue, Dec 27, 2022 at 12:26 PM Claus Ibsen  wrote:

> Hi
>
> Yes you can take the old code and build it is a custom component and use
> with camel
>
> On Tue, Dec 27, 2022 at 12:20 PM Ephemeris Lappis <
> ephemeris.lap...@gmail.com> wrote:
>
>> Hello.
>>
>> I do agree about CVEs, that are also an important concern in our jobs,
>> and I also know the price of maintaining complex systems with many
>> components from many origins. And Camel is exactly this kind of
>> system, built upon hundreds of components that make it a quite rich
>> integration platform for enterprises that use both the most recent
>> cloud aware applications, and very old file formats or protocols...
>>
>> Well, is there any way to integrate the "old" beanio component "our
>> way" as a custom data format, and thus a solution not to stop our
>> migration plan right now ?
>>
>> Thanks again.
>>
>> Regards.
>>
>>
>> Le mar. 27 déc. 2022 à 12:03, Andrea Cosentino  a
>> écrit :
>> >
>> > The problem with this kind of dead libraries is related to the fact that
>> > they rapidly become affected by multiple CVEs.
>> >
>> > So being mature and non maintained, it's a problem.
>> >
>> > Since nobody updates or release new versions, going ahead we're going to
>> > include weak libraries if we maintain them in codebase.
>> >
>> > So, I don't think there is any hope to see the component back in the
>> camel
>> > codebase.
>> >
>> > Il giorno mar 27 dic 2022 alle ore 12:00 Ephemeris Lappis <
>> > ephemeris.lap...@gmail.com> ha scritto:
>> >
>> > > Hello.
>> > >
>> > > It seems very strange to me to remove a component when no easy
>> > > alternative exists. Almost half of our about 100 projects use fixed
>> > > length files that are still used by many companies legacy systems, and
>> > > rely on beanio.
>> > >
>> > > In my opinion, a stable component that has no recent change is not
>> > > "dead", just "mature".
>> > >
>> > > Can we hope it gets back to a future Camel release ?
>> > >
>> > > Regards.
>> > >
>> > > Le mar. 27 déc. 2022 à 11:47, Claus Ibsen  a
>> écrit
>> > > :
>> > > >
>> > > > Hi
>> > > >
>> > > > BeanIO is a dead/not-active project and removed in 3.x, as some
>> other
>> > > > components - its documented in the upgrade guide to 3.17.x
>> > > >
>> > > >
>> > > > On Tue, Dec 27, 2022 at 11:38 AM Ephemeris Lappis <
>> > > > ephemeris.lap...@gmail.com> wrote:
>> > > >
>> > > > > Hello.
>> > > > >
>> > > > > I'm very surprised to see that the data format BEANIO has been
>> removed
>> > > > > in the last Camel versions. Isn't any replacement component ?
>> > > > >
>> > > > > We used BeanIO in many exchanges that handle enterprise legacy
>> systems
>> > > > > fixed length formatted files (big retail companies still use it
>> for
>> > > > > many purposes). I know alternative components for many file
>> formats
>> > > > > (xml, csv, etc.), but for fixed length, BeanIO is really the only
>> one
>> > > > > that can handle complex structured files...
>> > > > >
>> > > > > What can we do :( ???
>> > > > >
>> > > > > Thanks for any idea that can save our migration plans.
>> > > > >
>> > > > > Regards.
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > Claus Ibsen
>> > > > -
>> > > > @davsclaus
>> > > > Camel in Action 2: https://www.manning.com/ibsen2
>> > >
>>
>
>
> --
> 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 3.X / DataFormat BeanIO

2022-12-27 Thread Claus Ibsen
Hi

Yes you can take the old code and build it is a custom component and use
with camel

On Tue, Dec 27, 2022 at 12:20 PM Ephemeris Lappis <
ephemeris.lap...@gmail.com> wrote:

> Hello.
>
> I do agree about CVEs, that are also an important concern in our jobs,
> and I also know the price of maintaining complex systems with many
> components from many origins. And Camel is exactly this kind of
> system, built upon hundreds of components that make it a quite rich
> integration platform for enterprises that use both the most recent
> cloud aware applications, and very old file formats or protocols...
>
> Well, is there any way to integrate the "old" beanio component "our
> way" as a custom data format, and thus a solution not to stop our
> migration plan right now ?
>
> Thanks again.
>
> Regards.
>
>
> Le mar. 27 déc. 2022 à 12:03, Andrea Cosentino  a
> écrit :
> >
> > The problem with this kind of dead libraries is related to the fact that
> > they rapidly become affected by multiple CVEs.
> >
> > So being mature and non maintained, it's a problem.
> >
> > Since nobody updates or release new versions, going ahead we're going to
> > include weak libraries if we maintain them in codebase.
> >
> > So, I don't think there is any hope to see the component back in the
> camel
> > codebase.
> >
> > Il giorno mar 27 dic 2022 alle ore 12:00 Ephemeris Lappis <
> > ephemeris.lap...@gmail.com> ha scritto:
> >
> > > Hello.
> > >
> > > It seems very strange to me to remove a component when no easy
> > > alternative exists. Almost half of our about 100 projects use fixed
> > > length files that are still used by many companies legacy systems, and
> > > rely on beanio.
> > >
> > > In my opinion, a stable component that has no recent change is not
> > > "dead", just "mature".
> > >
> > > Can we hope it gets back to a future Camel release ?
> > >
> > > Regards.
> > >
> > > Le mar. 27 déc. 2022 à 11:47, Claus Ibsen  a
> écrit
> > > :
> > > >
> > > > Hi
> > > >
> > > > BeanIO is a dead/not-active project and removed in 3.x, as some other
> > > > components - its documented in the upgrade guide to 3.17.x
> > > >
> > > >
> > > > On Tue, Dec 27, 2022 at 11:38 AM Ephemeris Lappis <
> > > > ephemeris.lap...@gmail.com> wrote:
> > > >
> > > > > Hello.
> > > > >
> > > > > I'm very surprised to see that the data format BEANIO has been
> removed
> > > > > in the last Camel versions. Isn't any replacement component ?
> > > > >
> > > > > We used BeanIO in many exchanges that handle enterprise legacy
> systems
> > > > > fixed length formatted files (big retail companies still use it for
> > > > > many purposes). I know alternative components for many file formats
> > > > > (xml, csv, etc.), but for fixed length, BeanIO is really the only
> one
> > > > > that can handle complex structured files...
> > > > >
> > > > > What can we do :( ???
> > > > >
> > > > > Thanks for any idea that can save our migration plans.
> > > > >
> > > > > Regards.
> > > > >
> > > >
> > > >
> > > > --
> > > > 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 3.X / DataFormat BeanIO

2022-12-27 Thread Claus Ibsen
Hi

BeanIO is a dead/not-active project and removed in 3.x, as some other
components - its documented in the upgrade guide to 3.17.x


On Tue, Dec 27, 2022 at 11:38 AM Ephemeris Lappis <
ephemeris.lap...@gmail.com> wrote:

> Hello.
>
> I'm very surprised to see that the data format BEANIO has been removed
> in the last Camel versions. Isn't any replacement component ?
>
> We used BeanIO in many exchanges that handle enterprise legacy systems
> fixed length formatted files (big retail companies still use it for
> many purposes). I know alternative components for many file formats
> (xml, csv, etc.), but for fixed length, BeanIO is really the only one
> that can handle complex structured files...
>
> What can we do :( ???
>
> Thanks for any idea that can save our migration plans.
>
> Regards.
>


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


Re: Camel errorHandler doesn't log before or after sending message to the dead letter channel

2022-12-27 Thread Claus Ibsen
>
> 
>
> https://gbr01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fspring=05%7C01%7CBurcu.Egri%40aerlingus.com%7Cf0159ba352564a92008608dae7880d02%7C57bf7636536c46bf9adef72b859bc5c0%7C0%7C0%7C638076869017462349%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Fqaeo%2FrYRZDZA9b%2FdJcND6pdx3jZ2tRbhtgeXHQZ5gI%3D=0;
> useMDCLogging="true">
>
>  useOriginalBody="true"
> deadLetterUri="jms:queue:mybackoutq">
>  maximumRedeliveries="1"
> redeliveryDelay="1"
> retryAttemptedLogLevel="WARN"
> retriesExhaustedLogLevel="ERROR"/>
>    loggingLevel="ERROR" message="Pushing to backout queue"/>
> 
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> Try to change log configuration and loggingLevel to DEBUG but nothing
> changed.
>
> 
> 
> 
> 
> 
> 
> 
>


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


Re: Camel JAXB DataFormat / Change between 2.X and 3.X

2022-12-26 Thread Claus Ibsen
Hi

Yes correct and  was deprecated in 2.x to tell about
changes coming.


On Mon, Dec 26, 2022 at 4:32 PM Ephemeris Lappis 
wrote:

> Hello.
>
> We have some Camel contexts that define a JAXB DataFormat before the
> routes, and then use a reference on the route.
>
> Example :
>
> 
>  id="myJAXB"
>   contextPath="my.test.t26.routes.xml"
>   encoding="UTF-8"
>   prettyPrint="true"
>   schema="classpath:xsd/my-schema.xsd" />
> 
>
> and then :
>
> 
>
> Now it seems that we have to add a "custom" element to reference the
> DataFormat, like :
>
> 
>
> Please, could you confirm this change, and that this last syntax is
> the best one ?
>
> Thanks.
>
> Regards.
>


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


Re: Camel JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-26 Thread Claus Ibsen
Hi

Ah yeah it should be NOT custom id assigned.
You are welcome to send a PR

BTW is there a reason you turn off remove all routes?


So the code should be like:

if (!route.isCustomId()) {



On Mon, Dec 26, 2022 at 2:40 PM Mikael Koskinen  wrote:

> Hi again,
>
> I checked the source code of RouteWatcherReloadStrategy from here:
>
> https://github.com/apache/camel/blob/00526e77bfa88bc20bcde640487cf7d83629e49d/core/camel-support/src/main/java/org/apache/camel/support/RouteWatcherReloadStrategy.java#L274
>
> To me it looks like the warning "Routes with no id's detected"... is
> always printed if there are routes with custom ids:
>
> for (String id : ids) {
> Route route = getCamelContext().getRoute(id);
> if (route.isCustomId()) {
> sj.add(route.getEndpoint().getEndpointUri());
> }
> }
> if (sj.length() > 0) {
> LOG.warn(
> "Routes with no id's detected. Its
> recommended to assign route id's to your routes so Camel can reload
> the routes correctly.\nUnassigned routes:\n{}",
> sj);
> }
>
> ma 26. jouluk. 2022 klo 15.30 Mikael Koskinen (mijap...@gmail.com)
> kirjoitti:
> >
> > Hey,
> >
> > Hmm, I'm not sure. The unit test you linked seems to use the "id"
> > field like I used when defining the route. But the assert uses
> > "routeId".  For example the test:
> >
> > when:
> > loadRoutes '''
> > - route:
> > id: demo-route < Here's the "id" field
> > def "load route inlined camelCase"() {
> >
> > But in the assert:
> >
> > context.routeDefinitions.size() == 1
> >
> > with(context.routeDefinitions[0], RouteDefinition) {
> > routeId == 'demo-route' <- Here's routeId instead of "id"
> >
> > But as I previously tested, Karavan uses "id".
> >
> > In the first message I posted the log seems to state that "id" is the
> > way to go as Camel reports when starting the route:
> >
> > 2022-12-26 11:28:42.504  INFO 79551 --- [
> > main]e.camel.impl.engine.AbstractCamelContext : Started firstRoute
> >
> > Where "firstRoute" is the "id". But the problem is that when live
> > reloading happens, Camel reports that no id has been set. Even though
> > in the previous line it states that the route with id "firstRoute" has
> > been started.
> >
> > ma 26. jouluk. 2022 klo 14.58 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> > >
> > > Hi
> > >
> > > See some unit tests
> > >
> https://github.com/apache/camel/blob/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesTest.groovy#L198
> > >
> > > You can also use Apache Camel Karavan to design yaml routes as it
> builds
> > > the YAML correct
> > >
> > >
> > >
> > > On Mon, Dec 26, 2022 at 12:09 PM Mikael Koskinen 
> wrote:
> > >
> > > > Thanks! I tried routeId and route-id but got the following error on
> both:
> > > >
> > > > Unsupported field: routeId
> > > >  in file:timers.yaml, line 2, column 5:
> > > > routeId: firstRoute
> > > > ^
> > > >
> > > > at
> > > >
> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:128)
> > > > at
> > > >
> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:33)
> > > > at
> > > >
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> > > > at
> > > >
> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationContext.java:215)
> > > >
> > > > This is the route:
> > > >
> > > > - route:
> > > > routeId: firstRoute
> > > > from:
> > > > uri: "timer:yaml"
> > > > parameters:
> > > > period: "2000"
> > > > steps:
> > > > - setBody:
> > > > constant: "Hello Camel from yaml timer 300"
> > > > - log: "${body}"
> > > >
> > > > If I use Karavan to set the ID of the route, it sets the "id" field:
>

Re: Camel JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-26 Thread Claus Ibsen
Hi

See some unit tests
https://github.com/apache/camel/blob/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesTest.groovy#L198

You can also use Apache Camel Karavan to design yaml routes as it builds
the YAML correct



On Mon, Dec 26, 2022 at 12:09 PM Mikael Koskinen  wrote:

> Thanks! I tried routeId and route-id but got the following error on both:
>
> Unsupported field: routeId
>  in file:timers.yaml, line 2, column 5:
> routeId: firstRoute
> ^
>
> at
> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:128)
> at
> org.apache.camel.dsl.yaml.deserializers.RouteDefinitionDeserializer.setProperties(RouteDefinitionDeserializer.java:33)
> at
> org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> at
> org.apache.camel.dsl.yaml.common.YamlDeserializationContext$2.construct(YamlDeserializationContext.java:215)
>
> This is the route:
>
> - route:
> routeId: firstRoute
> from:
> uri: "timer:yaml"
> parameters:
> period: "2000"
> steps:
> - setBody:
> constant: "Hello Camel from yaml timer 300"
> - log: "${body}"
>
> If I use Karavan to set the ID of the route, it sets the "id" field:
>
> - route:
> from:
> uri: timer:yaml
> steps:
> - setBody:
> expression:
> constant:
> expression: Hello Camel from yaml timer 300
> - log:
> message: ${body}
> parameters:
> period: '2000'
> id: routeIdFromKaravan
>
>
> ma 26. jouluk. 2022 klo 12.02 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> >
> > And it can use camelCase too, so routeId or route-id are both possible.
> > However routeId is recommended so you use same case as XML, Java DSL etc.
> >
> > On Mon, Dec 26, 2022 at 11:00 AM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > Use route-id to set id for routes
> > >
> > >
> > > On Mon, Dec 26, 2022 at 10:38 AM Mikael Koskinen 
> > > wrote:
> > >
> > >> Hi,
> > >>
> > >> I'm testing how the route reload works if one file has multiple
> > >> routes. I've defined two routes in a single file and assigned ids to
> > >> both:
> > >>
> > >> - route:
> > >> id: firstRoute
> > >> from:
> > >> uri: "timer:yaml"
> > >> parameters:
> > >> period: "2000"
> > >> steps:
> > >> - setBody:
> > >> constant: "Hello Camel from yaml timer 30"
> > >> - log: "${body}"
> > >>
> > >> - route:
> > >> id: secondRoute
> > >> from:
> > >> uri: "timer:yaml"
> > >> parameters:
> > >> period: "3000"
> > >> steps:
> > >> - setBody:
> > >> constant: "Hello Camel from yaml timer this one"
> > >> - log: "${body}"
> > >>
> > >> When I run the routes I can see the ids:
> > >>
> > >> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
> > >> e.camel.impl.engine.AbstractCamelContext : Started firstRoute
> > >> (timer://yaml)
> > >> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
> > >> e.camel.impl.engine.AbstractCamelContext : Started secondRoute
> > >> (timer://yaml)
> > >>
> > >> Then I've enabled live reload using application.properties with
> > >> camel.main.routes-reload-remove-all-routes set to false. Here's the
> > >> full application.properties:
> > >>
> > >> # routes to load
> > >> camel.main.routes-reload-enabled = true
> > >> camel.main.routes-reload-directory = file:./
> > >> camel.main.routes-reload-pattern = *.yaml
> > >> camel.main.routes-reload-remove-all-routes = false
> > >>
> > >> Now when I use Camel Jbang to run the routes:
> > >>
> > >> camel run timers.yaml
> > >>
> > >> I can see the route ids and the mention that live reload is enabled:
> > >>
> > >> 2022-12-26 11:32:03.051  INFO 79751 --- [   main]
> > >> upport.FileWatcherResourceReloadStrategy : Live route reloading
> > >> enabled (directory: .)
> > >> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
> > >> e.camel.impl.engine.AbstractCamelContext : Routes startup (started:2)
> > >> 2022-

Re: Camel JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-26 Thread Claus Ibsen
And it can use camelCase too, so routeId or route-id are both possible.
However routeId is recommended so you use same case as XML, Java DSL etc.

On Mon, Dec 26, 2022 at 11:00 AM Claus Ibsen  wrote:

> Hi
>
> Use route-id to set id for routes
>
>
> On Mon, Dec 26, 2022 at 10:38 AM Mikael Koskinen 
> wrote:
>
>> Hi,
>>
>> I'm testing how the route reload works if one file has multiple
>> routes. I've defined two routes in a single file and assigned ids to
>> both:
>>
>> - route:
>> id: firstRoute
>> from:
>> uri: "timer:yaml"
>> parameters:
>> period: "2000"
>> steps:
>> - setBody:
>> constant: "Hello Camel from yaml timer 30"
>> - log: "${body}"
>>
>> - route:
>> id: secondRoute
>> from:
>> uri: "timer:yaml"
>> parameters:
>> period: "3000"
>> steps:
>> - setBody:
>> constant: "Hello Camel from yaml timer this one"
>> - log: "${body}"
>>
>> When I run the routes I can see the ids:
>>
>> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
>> e.camel.impl.engine.AbstractCamelContext : Started firstRoute
>> (timer://yaml)
>> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
>> e.camel.impl.engine.AbstractCamelContext : Started secondRoute
>> (timer://yaml)
>>
>> Then I've enabled live reload using application.properties with
>> camel.main.routes-reload-remove-all-routes set to false. Here's the
>> full application.properties:
>>
>> # routes to load
>> camel.main.routes-reload-enabled = true
>> camel.main.routes-reload-directory = file:./
>> camel.main.routes-reload-pattern = *.yaml
>> camel.main.routes-reload-remove-all-routes = false
>>
>> Now when I use Camel Jbang to run the routes:
>>
>> camel run timers.yaml
>>
>> I can see the route ids and the mention that live reload is enabled:
>>
>> 2022-12-26 11:32:03.051  INFO 79751 --- [   main]
>> upport.FileWatcherResourceReloadStrategy : Live route reloading
>> enabled (directory: .)
>> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
>> e.camel.impl.engine.AbstractCamelContext : Routes startup (started:2)
>> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
>> e.camel.impl.engine.AbstractCamelContext : Started firstRoute
>> (timer://yaml)
>> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
>> e.camel.impl.engine.AbstractCamelContext : Started secondRoute
>> (timer://yaml)
>>
>> But when I modify one of the routes in the timers.yaml, I get an
>> warning about missing ids:
>>
>> 2022-12-26 11:33:48.522  INFO 79845 --- [rReloadStrategy]
>> e.camel.impl.engine.AbstractCamelContext : Stopped firstRoute
>> (timer://yaml)
>> 2022-12-26 11:33:48.523  INFO 79845 --- [rReloadStrategy]
>> e.camel.impl.engine.AbstractCamelContext : Shutdown firstRoute
>> (timer://yaml)
>> 2022-12-26 11:33:48.524  INFO 79845 --- [rReloadStrategy]
>> e.camel.impl.engine.AbstractCamelContext : Stopped secondRoute
>> (timer://yaml)
>> 2022-12-26 11:33:48.524  INFO 79845 --- [rReloadStrategy]
>> e.camel.impl.engine.AbstractCamelContext : Shutdown secondRoute
>> (timer://yaml)
>> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
>> camel.support.RouteWatcherReloadStrategy : Routes reloaded summary
>> (total:2 started:2)
>> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
>> camel.support.RouteWatcherReloadStrategy : Started firstRoute
>> (timer://yaml) (source: timers.yaml:4)
>> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
>> camel.support.RouteWatcherReloadStrategy : Started secondRoute
>> (timer://yaml) (source: timers.yaml:15)
>> 2022-12-26 11:33:48.538  WARN 79845 --- [rReloadStrategy]
>> camel.support.RouteWatcherReloadStrategy : Routes with no id's
>> detected. Its recommended to assign route id's to your routes so Camel
>> can reload the routes correctly.
>> Unassigned routes:
>> timer://yaml?period=2000
>> timer://yaml?period=3000
>>
>> A bug?
>>
>> Best regards,
>> Mikael
>>
>
>
> --
> 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 JBang 3.20: camel.support.RouteWatcherReloadStrategy : Routes with no id's detected...

2022-12-26 Thread Claus Ibsen
Hi

Use route-id to set id for routes


On Mon, Dec 26, 2022 at 10:38 AM Mikael Koskinen  wrote:

> Hi,
>
> I'm testing how the route reload works if one file has multiple
> routes. I've defined two routes in a single file and assigned ids to
> both:
>
> - route:
> id: firstRoute
> from:
> uri: "timer:yaml"
> parameters:
> period: "2000"
> steps:
> - setBody:
> constant: "Hello Camel from yaml timer 30"
> - log: "${body}"
>
> - route:
> id: secondRoute
> from:
> uri: "timer:yaml"
> parameters:
> period: "3000"
> steps:
> - setBody:
> constant: "Hello Camel from yaml timer this one"
> - log: "${body}"
>
> When I run the routes I can see the ids:
>
> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
> e.camel.impl.engine.AbstractCamelContext : Started firstRoute
> (timer://yaml)
> 2022-12-26 11:28:42.504  INFO 79551 --- [   main]
> e.camel.impl.engine.AbstractCamelContext : Started secondRoute
> (timer://yaml)
>
> Then I've enabled live reload using application.properties with
> camel.main.routes-reload-remove-all-routes set to false. Here's the
> full application.properties:
>
> # routes to load
> camel.main.routes-reload-enabled = true
> camel.main.routes-reload-directory = file:./
> camel.main.routes-reload-pattern = *.yaml
> camel.main.routes-reload-remove-all-routes = false
>
> Now when I use Camel Jbang to run the routes:
>
> camel run timers.yaml
>
> I can see the route ids and the mention that live reload is enabled:
>
> 2022-12-26 11:32:03.051  INFO 79751 --- [   main]
> upport.FileWatcherResourceReloadStrategy : Live route reloading
> enabled (directory: .)
> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
> e.camel.impl.engine.AbstractCamelContext : Routes startup (started:2)
> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
> e.camel.impl.engine.AbstractCamelContext : Started firstRoute
> (timer://yaml)
> 2022-12-26 11:32:03.073  INFO 79751 --- [   main]
> e.camel.impl.engine.AbstractCamelContext : Started secondRoute
> (timer://yaml)
>
> But when I modify one of the routes in the timers.yaml, I get an
> warning about missing ids:
>
> 2022-12-26 11:33:48.522  INFO 79845 --- [rReloadStrategy]
> e.camel.impl.engine.AbstractCamelContext : Stopped firstRoute
> (timer://yaml)
> 2022-12-26 11:33:48.523  INFO 79845 --- [rReloadStrategy]
> e.camel.impl.engine.AbstractCamelContext : Shutdown firstRoute
> (timer://yaml)
> 2022-12-26 11:33:48.524  INFO 79845 --- [rReloadStrategy]
> e.camel.impl.engine.AbstractCamelContext : Stopped secondRoute
> (timer://yaml)
> 2022-12-26 11:33:48.524  INFO 79845 --- [rReloadStrategy]
> e.camel.impl.engine.AbstractCamelContext : Shutdown secondRoute
> (timer://yaml)
> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
> camel.support.RouteWatcherReloadStrategy : Routes reloaded summary
> (total:2 started:2)
> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
> camel.support.RouteWatcherReloadStrategy : Started firstRoute
> (timer://yaml) (source: timers.yaml:4)
> 2022-12-26 11:33:48.537  INFO 79845 --- [rReloadStrategy]
> camel.support.RouteWatcherReloadStrategy : Started secondRoute
> (timer://yaml) (source: timers.yaml:15)
> 2022-12-26 11:33:48.538  WARN 79845 --- [rReloadStrategy]
> camel.support.RouteWatcherReloadStrategy : Routes with no id's
> detected. Its recommended to assign route id's to your routes so Camel
> can reload the routes correctly.
> Unassigned routes:
> timer://yaml?period=2000
> timer://yaml?period=3000
>
> A bug?
>
> Best regards,
> Mikael
>


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


Re: camel-docker operation error

2022-12-22 Thread Claus Ibsen
Hi

On Thu, Dec 22, 2022 at 6:37 PM Mark Webb  wrote:

> Thanks Claus.  I started digging through the Java source code.  It appears
> that only "stats" and "events" can be used by the Consumer, see
> DockerEndpoint.createConsumer(Processor).  That's not clear in the
> documentation.
>
>
Ah yeah, good point. We can improve this. If you want to contribute, then
you can send a PR where you update the javadoc setOperation method, where
you can
say that events and stats are only for the consumer, and all others for the
producer.




> On Thu, Dec 22, 2022 at 12:28 PM Claus Ibsen 
> wrote:
>
> > Hi
> >
> > When browsing the documentation on the website, then make sure to select
> > the Camel version you use, see bottom left corner.
> >
> > It may be that info is a new operation added in a newer version. If you
> > choose the correct Camel version in the docs, then it should list what
> > operations are valid.
> >
> > On Thu, Dec 22, 2022 at 6:14 PM Mark Webb  wrote:
> >
> > > I am trying to get a Camel-Docker route working.  The beginning of my
> > > simple route is (I have a valid IP Address listed in the route):
> > >
> > > from("docker://info?host=IP_ADDRESS=2375").to("log:info");
> > >
> > > And I get the following error:
> > >
> > > *info is not a valid consumer operation*
> > >
> > > Are there any other tutorials or documentation I can look at to figure
> > out
> > > why the "info" operation is not valid?
> > >
> > > Thanks,
> > > Mark
> > >
> >
> >
> > --
> > 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-docker operation error

2022-12-22 Thread Claus Ibsen
Hi

When browsing the documentation on the website, then make sure to select
the Camel version you use, see bottom left corner.

It may be that info is a new operation added in a newer version. If you
choose the correct Camel version in the docs, then it should list what
operations are valid.

On Thu, Dec 22, 2022 at 6:14 PM Mark Webb  wrote:

> I am trying to get a Camel-Docker route working.  The beginning of my
> simple route is (I have a valid IP Address listed in the route):
>
> from("docker://info?host=IP_ADDRESS=2375").to("log:info");
>
> And I get the following error:
>
> *info is not a valid consumer operation*
>
> Are there any other tutorials or documentation I can look at to figure out
> why the "info" operation is not valid?
>
> Thanks,
> Mark
>


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


Re: RouteConfiguration#OnCompletion when error

2022-12-22 Thread Claus Ibsen
Hi

Yes it appears to be a bug.

In the OnCompletionProcessor the code in onComplete should be copied to
onFailure. Its the code in the beginning that checks that its only invoked
at the correct point.
If you copy that code then it looks like it works.

You are welcome to create a JIRA and "fix" this. And would be good to
include unit test with the fix.


On Thu, Dec 22, 2022 at 7:38 AM Babak Vahdat
 wrote:

> And using 3.20.0 here...
>
> > On 22 Dec 2022, at 07:36, Babak Vahdat 
> wrote:
> >
> > Hi
> >
> > There seems to be a bug in RouteConfiguration#OnCompletion support which
> in case of an error, then it would run a given Callback as many times as
> the number of the routes that you have. However if no error then it gets
> called exactly once which is as expected.
> >
> > Here a simple reproducible:
> https://gist.github.com/bvahdat/db518d4f4abde3ece6c5698f07f8e63d <
> https://gist.github.com/bvahdat/db518d4f4abde3ece6c5698f07f8e63d>
> >
> > Am I right?
> >
> > —
> > Babak
>
>

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


Re: [VOTE] Release Apache Camel Kamelets 3.20.0

2022-12-21 Thread Claus Ibsen
+1 (binding)

On Wed, Dec 21, 2022 at 2:26 PM Andrea Cosentino  wrote:

> Hello all:
>
> This is a vote for releasing camel-kamelets 3.20.0
>
> The release contains fixes and it's updated to Camel 3.20.0.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/3.20.0
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1510
> Kamelets Tag:
>
> https://gitbox.apache.org/repos/asf?p=camel-kamelets.git;a=shortlog;h=refs/tags/v3.20.0
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 3.20.0
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> Here's my +1.
>
> Thanks,
> Andrea Cosentino
>


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


Re: need help

2022-12-19 Thread Claus Ibsen
On Mon, Dec 19, 2022 at 11:27 AM Kartheek Veebhudi <
kartheek.veebh...@gmail.com> wrote:

> Hi Camel Users,
>
> We have a file transmission application which uses Apache Camel which is a
> legacy application running on 2.25 version. We have created a custom
> endpointConfiguration like
>  uri="ndmfile://prpertiesfile.xml?delay=12000/> uri="ndm:send"/>
>
> ndmfile is an customEndpoint and using endpoint.setEndPointConfiguration()
> and getEndPointConfiguration().
>
> Currently we are in a situation to upgrade it to 3.14/3.16 version and
> these method got deprecated and deleted from 3.x version. Is there any
> alternative for this method in new updated versions?
>
>
No there is no alternative, they were AFAIR also deprecated in 2.x.
https://github.com/apache/camel/blob/camel-2.25.x/camel-core/src/main/java/org/apache/camel/EndpointConfiguration.java#L25

Just write the component like any other standard component, you can look at
one of the existing components that is is somewhat similar to your
component as inspiration.



>
> *Thanks & Regards,*
> *Kartheek.Veebhudi*
>


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


Re: Route Template and dependency to Spring Boot Component Order initialization

2022-12-16 Thread Claus Ibsen
Hi

Yeah this seems to be improved via CAMEL-18764
When I debug I can see the templates are loaded first despite being 2nd
class, and that only last, routes are created from the template (via
templatedRoute)


On Fri, Dec 16, 2022 at 10:16 AM Claus Ibsen  wrote:

> Hi
>
> I tried the example for the upcoming 3.20.0 release.
>
> If I run it out of the box with java profile
> mvn spring-boot:run -Dspring-boot.run.profiles=java
>
> Then I see 2 routes logged
> 2022-12-16 10:13:31.009  INFO 38526 --- [ - timer://deux] route4
> : Java says Bonjour deux
> 2022-12-16 10:13:31.010  INFO 38526 --- [1 - timer://one] route3
> : Java says Hello one
>
> And if I rename the class MyRouteTemplates.java to RouteTemplates.java
> mvn clean spring-boot:run -Dspring-boot.run.profiles=java
>
> Then I also see 2 routes logged
>
> 2022-12-16 10:15:20.914  INFO 38576 --- [1 - timer://one] route3
> : Java says Hello one
> 2022-12-16 10:15:20.914  INFO 38576 --- [ - timer://deux] route4
> : Java says Bonjour deux
>
> So it may be better in this release, can you try when its released or with
> SNAPSHOT
>
>
>
> On Wed, Nov 2, 2022 at 2:12 PM Michael Rambichler 
> wrote:
>
>> Hi all,
>>
>> we are heavily using route templates with camel 3.18.x and Spring boot
>> 2.7.3
>>
>> I still wonder if there is no better possibility to avoid the spring boot
>> component scan order dependency.
>>
>> To reproduce the issue: check out the example from
>>
>> https://github.com/apache/camel-spring-boot-examples/tree/main/routetemplate
>> and rename the MyRouteTemplates.java to RouteTemplates.java
>>
>> There we are, your spring boot will initialize your RouteTemplate
>> (RouteTemplates.class) class* after* the RouteBuilder
>> (MyTemplateBuilder.class) and fails with: Cannot find RouteTemplate with
>> id
>> myTemplate
>>
>> Are there any better approaches to avoid this Spring Component Scan
>> ordering?
>>
>> BR
>>  Michael
>>
>
>
> --
> 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: Route Template and dependency to Spring Boot Component Order initialization

2022-12-16 Thread Claus Ibsen
Hi

I tried the example for the upcoming 3.20.0 release.

If I run it out of the box with java profile
mvn spring-boot:run -Dspring-boot.run.profiles=java

Then I see 2 routes logged
2022-12-16 10:13:31.009  INFO 38526 --- [ - timer://deux] route4
: Java says Bonjour deux
2022-12-16 10:13:31.010  INFO 38526 --- [1 - timer://one] route3
: Java says Hello one

And if I rename the class MyRouteTemplates.java to RouteTemplates.java
mvn clean spring-boot:run -Dspring-boot.run.profiles=java

Then I also see 2 routes logged

2022-12-16 10:15:20.914  INFO 38576 --- [1 - timer://one] route3
: Java says Hello one
2022-12-16 10:15:20.914  INFO 38576 --- [ - timer://deux] route4
: Java says Bonjour deux

So it may be better in this release, can you try when its released or with
SNAPSHOT



On Wed, Nov 2, 2022 at 2:12 PM Michael Rambichler 
wrote:

> Hi all,
>
> we are heavily using route templates with camel 3.18.x and Spring boot
> 2.7.3
>
> I still wonder if there is no better possibility to avoid the spring boot
> component scan order dependency.
>
> To reproduce the issue: check out the example from
>
> https://github.com/apache/camel-spring-boot-examples/tree/main/routetemplate
> and rename the MyRouteTemplates.java to RouteTemplates.java
>
> There we are, your spring boot will initialize your RouteTemplate
> (RouteTemplates.class) class* after* the RouteBuilder
> (MyTemplateBuilder.class) and fails with: Cannot find RouteTemplate with id
> myTemplate
>
> Are there any better approaches to avoid this Spring Component Scan
> ordering?
>
> BR
>  Michael
>


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


Re: Route Template and dependency to Spring Boot Component Order initialization

2022-12-16 Thread Claus Ibsen
Hi

Sorry for the late reply.
Yeah we should make using this out of the box better on SB.
Can you create a JIRA ticket.

On top of my mind, then Spring Boot may have some annotation/interface that
can be implemented to specify priority/ordering.
And we have that in Camel as well with org.apache.camel.Ordered (I think).

Because if you use RouteBuilder to build route templates then Camel cannot
know just by the class that its template or not.
So we may also consider some interface where you can mark the class to say
it has templates, and therefore should be loaded first.




On Wed, Nov 2, 2022 at 2:12 PM Michael Rambichler 
wrote:

> Hi all,
>
> we are heavily using route templates with camel 3.18.x and Spring boot
> 2.7.3
>
> I still wonder if there is no better possibility to avoid the spring boot
> component scan order dependency.
>
> To reproduce the issue: check out the example from
>
> https://github.com/apache/camel-spring-boot-examples/tree/main/routetemplate
> and rename the MyRouteTemplates.java to RouteTemplates.java
>
> There we are, your spring boot will initialize your RouteTemplate
> (RouteTemplates.class) class* after* the RouteBuilder
> (MyTemplateBuilder.class) and fails with: Cannot find RouteTemplate with id
> myTemplate
>
> Are there any better approaches to avoid this Spring Component Scan
> ordering?
>
> BR
>  Michael
>


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


Re: metadata properties

2022-12-13 Thread Claus Ibsen
Hi

No, it's all just metadata.

On Tue, Dec 13, 2022 at 6:55 PM ski n  wrote:

> btw what does group do? I couldn't find anything online or in Camel in
> action about it.
>
> from("direct:input")
> .group("mygroup")
>to("direct:output")
>
> Can you use it to manage a group of routes at once? For example,
> starting/suspending/stopping a group? Or has it other uses? Is there an
> example?
>
> Raymond
>
>
>
> On Tue, Dec 13, 2022 at 6:10 PM ski n  wrote:
>
> > Yes, I know. But I don't want to implement this in every
> > route/routeTemplate, so that's why I thought I use the API for it (inject
> > metadata properties on the start of a route for example).
> >
> > I have implemented a workaround that uses a map that loaded the metadata
> > in memory. This map is separated to the CamelContext and I was worried it
> > would take too much resources, but it seems working fine.
> >
> > Raymond
> >
> >
> > On Tue, Dec 13, 2022 at 5:22 PM Claus Ibsen 
> wrote:
> >
> >> There are route properties / route groups you can set via the DSL.
> >>
> >>
> >>
> >> On Tue, Dec 13, 2022 at 4:24 PM ski n  wrote:
> >>
> >> > I have a use case where I like to add properties as metadata to a
> >> > route/routetemplate. Properties like:
> >> >
> >> > - The group a route belongs to
> >> > - The author of the route
> >> > - The version of the route
> >> > - The environment it runs
> >> > - etc.
> >> >
> >> > I know Kamelet have a construct for metadata, but is there also
> >> construct
> >> > to set and get such properties with Camel? The properties shouldn't be
> >> > available directly in the route like Exchange properties. I also try
> >> not to
> >> > set it through the DSL, but with the API.
> >> >
> >> > Is there a way to do this? (or have similar result)
> >> >
> >> > Raymond
> >> >
> >>
> >>
> >> --
> >> 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: metadata properties

2022-12-13 Thread Claus Ibsen
There are route properties / route groups you can set via the DSL.



On Tue, Dec 13, 2022 at 4:24 PM ski n  wrote:

> I have a use case where I like to add properties as metadata to a
> route/routetemplate. Properties like:
>
> - The group a route belongs to
> - The author of the route
> - The version of the route
> - The environment it runs
> - etc.
>
> I know Kamelet have a construct for metadata, but is there also construct
> to set and get such properties with Camel? The properties shouldn't be
> available directly in the route like Exchange properties. I also try not to
> set it through the DSL, but with the API.
>
> Is there a way to do this? (or have similar result)
>
> Raymond
>


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


Re: Pausable Consumer

2022-12-13 Thread Claus Ibsen
Hi

What Camel version do you use? And can you try with the latest releases,
and 3.21.0 is on the way later this month.

On Tue, Dec 13, 2022 at 2:47 PM Chris Deeney
 wrote:

>
> Hi there,
> I'm currently trying to get the "pausable" DSL method working in my Kafka
> route that checks to see if an API responds to a ping. This seems to be
> working fine however when the service is resumed (successful ping response
> in "canContinue()"), any messages polled are not processed and lost. Any
> help would be greatly appreciated!
>
> Cheers!
>
> Chris Deeney
> | Java Developer
>


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


Re: BUG - missing configuration placeholder possibility for id in REST DSL

2022-12-12 Thread Claus Ibsen
Hi

Ah okay, yeah its not very common to use placeholders for ids and therefore
it's not resolved there before.
Yes you are welcome to create a JIRA and send a PR for this improvement

On Mon, Dec 12, 2022 at 1:28 PM Nikola Glidzic 
wrote:

> Sorry guys, I didn't know image can't be sent. Combine this email with
> previous one. Here is the relevant part of code of method forceAssignIds(),
> mentioned lines are marked with arrows:
>
> public static void forceAssignIds(CamelContext context,
> List routes) throws Exception {
> ExtendedCamelContext ecc =
> context.adapt(ExtendedCamelContext.class);
>
> // handle custom assigned id's first, and then afterwards assign
> auto
> // generated ids
> Set customIds = new HashSet<>();
>
> for (final RouteDefinition route : routes) {
> // if there was a custom id assigned, then make sure to support
> // property placeholders
> if (route.hasCustomIdAssigned()) {
> final String originalId = route.getId();
> final String id =
> context.resolvePropertyPlaceholders(originalId);
>
>   <- line 142
> // only set id if its changed, such as we did property
> // placeholder
> if (!originalId.equals(id)) {
> route.setId(id);
> }
> customIds.add(id);
> } else {
> RestDefinition rest = route.getRestDefinition();
> if (rest != null && route.isRest()) {
> VerbDefinition verb = findVerbDefinition(rest,
> route.getInput().getEndpointUri());
> if (verb != null) {
> String id = verb.getId();
>
>
>  <- line 154
> if (verb.hasCustomIdAssigned() &&
> ObjectHelper.isNotEmpty(id) && !customIds.contains(id)) {
> route.setId(id);
> customIds.add(id);
> }
> }
> }
> }
> }
>
>
> From: Nikola Glidzic
> Sent: Monday, December 12, 2022 1:13 PM
> To: users@camel.apache.org
> Subject: BUG - missing configuration placeholder possibility for id in
> REST DSL
>
> Hello Camel crew,
>
> I think there is a bug when using placeholder for route id in REST DSL
> route. I am using Camel 3.18.4, but same problem exists in previous
> versions as well.
>
> I want my REST route to have my custom route id loaded from configuration
> by using configuration placeholder, like this:
>
> rest()
> .post("{{endpoint.uri}}")<-
> loaded nice
> .id("{{endpoint.id}}")
>  <- NOT loaded
> .type(Claim.class)
> .consumes("application/json")
> .bindingMode(RestBindingMode.json)
> .to("direct:some_channel")
>
> Endpoint uri placeholder will be loaded good, but placeholder for id will
> not be loaded and my route id will remain as "{{endpoint.id}}".
>
> I think mistake and fix solution for this stands in class
> RouteDefinitionHelper, in method forceAssignIds():
>
> If you check the provided image, I think that line 154 for resolving REST
> route id should have the same placeholder resolving logic as it is in line
> 142.
>
> Should I create JIRA ticket for this or will you do it? It is probably
> better if you do it, but please provide us link of JIRA ticket in response
> so we can track the progress.
>
> Thanks in advance!
> Kind Regards,
> Nikola Glidzic
>
>
>
>

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


Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-12-03 Thread Claus Ibsen
Hi

Thanks for your patience and reporting this.
We have had some "hickups" with the CI server building fresh SNAPSHOTs so
you may have used stale JARs for a few days.

Keep testing and reporting findings. Also if you have ideas for things to
improve etc.



On Sat, Dec 3, 2022 at 8:48 AM Mikael Koskinen  wrote:

> Hi,
>
> I'm happy to report that it is now working! I first tested with
> Windows Sandbox (a fresh Windows 10 image) and then with my main
> Windows where I had previously tested it and both worked like a charm.
> I didn't have to delete the m2 repo.
>
> Here's the dependency list which the latest version generated:
>
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-core
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-platform-http
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-microprofile-health
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-file-watch
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-http
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-kamelet
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-rest
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-yaml-dsl
> 
> 
> org.apache.camel.kamelets
> camel-kamelets-utils
> 0.9.3
> 
> 
> org.apache.camel
> *
> 
> 
> 
> 
> org.apache.camel.kamelets
> camel-kamelets
> 0.9.3
>     
>
>
> 
> io.quarkus
> quarkus-junit5
> test
> 
> 
>
> Thank you for all the help!
>
> pe 2. jouluk. 2022 klo 8.53 Claus Ibsen (claus.ib...@gmail.com) kirjoitti:
> >
> > Hi
> >
> > Oh it also looks like the CI job did not complete last day, so wait for
> > this build to succeed
> >
> https://ci-builds.apache.org/job/Camel/job/Camel%20Daily%20Snapshot%20Deploy/job/main/154/
> >
> > On Fri, Dec 2, 2022 at 7:51 AM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > You can try to delete from your local m2 repo
> > > io/quarkus/platform/quarkus-camel-bom
> > >
> > > And then try again, as this BOM is what we need to be able to download,
> > > and load to resolve correct dependencies for the generated pom.xml.
> > >
> > >
> > >
> > >
> > > On Thu, Dec 1, 2022 at 6:10 PM Mikael Koskinen 
> wrote:
> > >
> > >> Hey,
> > >>
> > >> I was now able to test things using the latest 3.20.0-SNAPSHOT in
> > >> Windows 10 but unfortunately the issue seems to persist.
> > >>
> > >> I started from a new clean folder and then issued:
> > >>
> > >> jbang run --fresh "-Dcamel.jbang.version=3.20.0-SNAPSHOT"
> > >> camel@apache/camel export --runtime=
> > >> quarkus --gav=com.foo:acme:1.0-SNAPSHOT -dir=pub
> > >> --quarkus-version=2.14.2.Final
> > >>
> > >> There's couple new dependencies, but unfortunately the pom.xml still
> > >> isn't using quarkus everywhere:
> > >>
> > >> ---
> > >>
> > >> 
> > >> 
> > >> org.apache.camel.quarkus
> > >> camel-quarkus-core
> > >> 
> > >> 
> > >> org.apache.camel.quarkus
> > >> camel-quarkus-platform-http
> > >> 
> > >> 
> > >> org.apache.camel.quarkus
> > >> camel-quarkus-microprofile-health
> > >> 
> > >> 
> > >> org.apache.camel
> > >> camel-file-watch
> > >> 3.20.0-SNAPSHOT
> > >> 
> > >> 
> > >> org.apache.camel
> > >> camel-http
> > >> 3.20.0-SNAPSHOT
> > >> 
> > >> 
> > >> org.apache.camel
> > >> camel-kamelet
> > >> 3.20.0-SNAPSHOT
> > >> 
> > >> 
>

Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-12-01 Thread Claus Ibsen
Hi

Oh it also looks like the CI job did not complete last day, so wait for
this build to succeed
https://ci-builds.apache.org/job/Camel/job/Camel%20Daily%20Snapshot%20Deploy/job/main/154/

On Fri, Dec 2, 2022 at 7:51 AM Claus Ibsen  wrote:

> Hi
>
> You can try to delete from your local m2 repo
> io/quarkus/platform/quarkus-camel-bom
>
> And then try again, as this BOM is what we need to be able to download,
> and load to resolve correct dependencies for the generated pom.xml.
>
>
>
>
> On Thu, Dec 1, 2022 at 6:10 PM Mikael Koskinen  wrote:
>
>> Hey,
>>
>> I was now able to test things using the latest 3.20.0-SNAPSHOT in
>> Windows 10 but unfortunately the issue seems to persist.
>>
>> I started from a new clean folder and then issued:
>>
>> jbang run --fresh "-Dcamel.jbang.version=3.20.0-SNAPSHOT"
>> camel@apache/camel export --runtime=
>> quarkus --gav=com.foo:acme:1.0-SNAPSHOT -dir=pub
>> --quarkus-version=2.14.2.Final
>>
>> There's couple new dependencies, but unfortunately the pom.xml still
>> isn't using quarkus everywhere:
>>
>> ---
>>
>> 
>> 
>> org.apache.camel.quarkus
>> camel-quarkus-core
>> 
>> 
>> org.apache.camel.quarkus
>> camel-quarkus-platform-http
>> 
>> 
>> org.apache.camel.quarkus
>> camel-quarkus-microprofile-health
>> 
>> 
>> org.apache.camel
>> camel-file-watch
>> 3.20.0-SNAPSHOT
>> 
>> 
>> org.apache.camel
>> camel-http
>> 3.20.0-SNAPSHOT
>> 
>> 
>> org.apache.camel
>> camel-kamelet
>> 3.20.0-SNAPSHOT
>> 
>> 
>> org.apache.camel
>> camel-rest
>> 3.20.0-SNAPSHOT
>> 
>> 
>> org.apache.camel
>> camel-yaml-dsl
>> 3.20.0-SNAPSHOT
>> 
>> 
>> org.apache.camel.kamelets
>> camel-kamelets-utils
>> 0.9.3
>> 
>> 
>> org.apache.camel
>> *
>> 
>> 
>> 
>> 
>> org.apache.camel.kamelets
>> camel-kamelets
>> 0.9.3
>> 
>>
>>
>> 
>> io.quarkus
>> quarkus-junit5
>> test
>> 
>> 
>>
>> ---
>>
>> Diffing this vs the previous version I see that these are new
>> dependencies which weren't added previously:
>>
>> camel-kamelet
>> camel-kamelets-utils
>> camel-kamelets
>>
>> When I previously manually modified the pom.xml to make things work I
>> had to add the following two which aren't included in the newly
>> generated pom.xml:
>>
>> camel-quarkus-kamelet
>> camel-kamelets-catalog
>>
>> I'm not sure what's the difference between camel-kamelets and
>> camel-kamelets-catalog.
>>
>> ke 30. marrask. 2022 klo 20.21 Mikael Koskinen (mijap...@gmail.com)
>> kirjoitti:
>> >
>> > Hi,
>> >
>> > Thanks! I'll try the SNAPSHOT tomorrow and report back on how it works.
>> >
>> > ke 30. marrask. 2022 klo 15.05 Claus Ibsen (claus.ib...@gmail.com)
>> kirjoitti:
>> > >
>> > > Hi
>> > >
>> > > Okay I have a potential fix.
>> > >
>> > > You can test this by building from source (or wait till tomorrow for
>> CI
>> > > server to publish a new SNAPSHOT)
>> > > For source you only need to build dsl/camel-jbang
>> > >
>> > > So checkout the camel source code ( a lot of source )
>> > > cd dsl/camel-jbang
>> > > mvn clean install
>> > >
>> > > and then try again on windows
>> > >
>> > > On Wed, Nov 30, 2022 at 1:55 PM Claus Ibsen 
>> wrote:
>> > >
>> > > > Hi
>> > > >
>> > > > Yeah I think its a windows bug in camel-jbang, we had to download
>> > > > camel-quarkus-catalog in a special way with the Shrinkwrap project.
>> > > > However now we use standard Maven so we can likely downloader this
&

Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-12-01 Thread Claus Ibsen
Hi

You can try to delete from your local m2 repo
io/quarkus/platform/quarkus-camel-bom

And then try again, as this BOM is what we need to be able to download, and
load to resolve correct dependencies for the generated pom.xml.




On Thu, Dec 1, 2022 at 6:10 PM Mikael Koskinen  wrote:

> Hey,
>
> I was now able to test things using the latest 3.20.0-SNAPSHOT in
> Windows 10 but unfortunately the issue seems to persist.
>
> I started from a new clean folder and then issued:
>
> jbang run --fresh "-Dcamel.jbang.version=3.20.0-SNAPSHOT"
> camel@apache/camel export --runtime=
> quarkus --gav=com.foo:acme:1.0-SNAPSHOT -dir=pub
> --quarkus-version=2.14.2.Final
>
> There's couple new dependencies, but unfortunately the pom.xml still
> isn't using quarkus everywhere:
>
> ---
>
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-core
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-platform-http
> 
> 
> org.apache.camel.quarkus
> camel-quarkus-microprofile-health
> 
> 
> org.apache.camel
> camel-file-watch
> 3.20.0-SNAPSHOT
> 
> 
> org.apache.camel
> camel-http
> 3.20.0-SNAPSHOT
> 
> 
> org.apache.camel
> camel-kamelet
> 3.20.0-SNAPSHOT
> 
> 
> org.apache.camel
> camel-rest
> 3.20.0-SNAPSHOT
> 
> 
> org.apache.camel
> camel-yaml-dsl
> 3.20.0-SNAPSHOT
> 
> 
> org.apache.camel.kamelets
> camel-kamelets-utils
> 0.9.3
> 
> 
> org.apache.camel
> *
> 
> 
> 
> 
> org.apache.camel.kamelets
> camel-kamelets
> 0.9.3
> 
>
>
> 
> io.quarkus
> quarkus-junit5
> test
> 
> 
>
> ---
>
> Diffing this vs the previous version I see that these are new
> dependencies which weren't added previously:
>
> camel-kamelet
> camel-kamelets-utils
> camel-kamelets
>
> When I previously manually modified the pom.xml to make things work I
> had to add the following two which aren't included in the newly
> generated pom.xml:
>
> camel-quarkus-kamelet
> camel-kamelets-catalog
>
> I'm not sure what's the difference between camel-kamelets and
> camel-kamelets-catalog.
>
> ke 30. marrask. 2022 klo 20.21 Mikael Koskinen (mijap...@gmail.com)
> kirjoitti:
> >
> > Hi,
> >
> > Thanks! I'll try the SNAPSHOT tomorrow and report back on how it works.
> >
> > ke 30. marrask. 2022 klo 15.05 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> > >
> > > Hi
> > >
> > > Okay I have a potential fix.
> > >
> > > You can test this by building from source (or wait till tomorrow for CI
> > > server to publish a new SNAPSHOT)
> > > For source you only need to build dsl/camel-jbang
> > >
> > > So checkout the camel source code ( a lot of source )
> > > cd dsl/camel-jbang
> > > mvn clean install
> > >
> > > and then try again on windows
> > >
> > > On Wed, Nov 30, 2022 at 1:55 PM Claus Ibsen 
> wrote:
> > >
> > > > Hi
> > > >
> > > > Yeah I think its a windows bug in camel-jbang, we had to download
> > > > camel-quarkus-catalog in a special way with the Shrinkwrap project.
> > > > However now we use standard Maven so we can likely downloader this
> in a
> > > > better way that can work for windows too
> > > > https://issues.apache.org/jira/browse/CAMEL-18778
> > > >
> > > > On Wed, Nov 30, 2022 at 1:48 PM Mikael Koskinen 
> > > > wrote:
> > > >
> > > >> Hey,
> > > >>
> > > >> I tested with Mac and it worked from the get go with
> 3.20.0-SNAPSHOT:
> > > >> all the dependencies are quarkus versions as expected.
> > > >>
> > > >> Haven't been able to test the Spring boot & Windows combination yet.
> > > >>
> > > >> ke 30. marrask. 2022 klo 11.25 Mikael Koskinen (mijap...@gmail.com)
> > > >> kirjoitti:
> > > >> >
> > > >> > Hi,
> > > &

Re: YAML DSL/Karavan: HTTPS request to server which has self-signed certificate/invalid certificate

2022-12-01 Thread Claus Ibsen
Hi

Yeah making using camel components easier for quickly trying out and
testing stuff is excellent with karavan / jbang and kamelets.

Have you looked the kamelets for http? We can liketry make a
derivation that can do HTTPS - In the past there was some dummy http
certificate trust manager (of some sorts),
that could be = true.

We can maybe find that old code, and put it into a new kamelet.



On Thu, Dec 1, 2022 at 7:15 AM Mikael Koskinen  wrote:

> Hi,
>
> I'm wondering if it possible to use just YAML DSL/Karavan to create a
> route where HTTP/Netty-http/Undertow component makes a HTTPS request
> to server where server has either:
>
> a) Self-signed but otherwise valid certificate
> b) Expired or otherwise invalid certificate
>
> I was kind of hoping to find something like
> disableRemoteCertificateValidation which could be checked through
> Karavan. Couldn't find one and tried to find a solution using just the
> YAML DSL and failed again.
>
> In my case the self-signed certificates are the issue and they change
> a lot and so just enabling some "I know this is wrong but just make
> this work" property would be a life saver instead of having to mess
> with keys etc.
>
> Is there a "pure YAML DSL" way of making a https request to a server
> presenting a self-signed certificate?
>
> Thanks in advance for any guidance.
>


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


Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-11-30 Thread Claus Ibsen
Hi

Okay I have a potential fix.

You can test this by building from source (or wait till tomorrow for CI
server to publish a new SNAPSHOT)
For source you only need to build dsl/camel-jbang

So checkout the camel source code ( a lot of source )
cd dsl/camel-jbang
mvn clean install

and then try again on windows

On Wed, Nov 30, 2022 at 1:55 PM Claus Ibsen  wrote:

> Hi
>
> Yeah I think its a windows bug in camel-jbang, we had to download
> camel-quarkus-catalog in a special way with the Shrinkwrap project.
> However now we use standard Maven so we can likely downloader this in a
> better way that can work for windows too
> https://issues.apache.org/jira/browse/CAMEL-18778
>
> On Wed, Nov 30, 2022 at 1:48 PM Mikael Koskinen 
> wrote:
>
>> Hey,
>>
>> I tested with Mac and it worked from the get go with 3.20.0-SNAPSHOT:
>> all the dependencies are quarkus versions as expected.
>>
>> Haven't been able to test the Spring boot & Windows combination yet.
>>
>> ke 30. marrask. 2022 klo 11.25 Mikael Koskinen (mijap...@gmail.com)
>> kirjoitti:
>> >
>> > Hi,
>> >
>> > Yep, using Windows. I’ll try the Spring boot export & running things
>> with Mac later today and report back with my findings.
>> >
>> > On Wednesday, November 30, 2022, Claus Ibsen 
>> wrote:
>> >>
>> >> Hi
>> >>
>> >> Are you using windows btw? I suspect it may also be related to that,
>> as it
>> >> smells like the camel-quarkus-catalog (needed for export to Q)
>> >> is not downloaded and resolved correctly so we fallback to core camel
>> maven
>> >> GAVs
>> >>
>> >> Can you try to export to spring boot and look in the generated pom.xml
>> that
>> >> the GAVs are using camel-xxx-starter ?
>> >>
>> >>
>> >>
>> >>
>> >> On Tue, Nov 29, 2022 at 8:12 PM Mikael Koskinen 
>> wrote:
>> >>
>> >> > Hey,
>> >> >
>> >> > Thank you for the help here and in the Gist.
>> >> >
>> >> > Based on the suggestions I tested the JBang version 3.20.0-SNAPSHOT
>> >> > and with Quarkus 2.14.2.Final and still encountered the same issue.
>> >> >
>> >> > Manually modifying the exported pom.xml got things working. I updated
>> >> > the gist with logs and also with the changes I did to pom.xml to make
>> >> > things work.
>> >> >
>> >> > ti 29. marrask. 2022 klo 8.21 Claus Ibsen (claus.ib...@gmail.com)
>> >> > kirjoitti:
>> >> > >
>> >> > > Hi
>> >> > >
>> >> > > I created a ticket at CEQ
>> >> > > https://github.com/apache/camel-quarkus/issues/4300
>> >> > >
>> >> > > What camel-quarkus version are you using btw. You can try with
>> latest
>> >> > > 2.14.2 release, you can re-export and set the quarkus version with
>> the
>> >> > > --quarkus-version option, or adjust the existing pom.xml
>> >> > >
>> >> > > On Tue, Nov 29, 2022 at 7:10 AM Claus Ibsen > >
>> >> > wrote:
>> >> > >
>> >> > > > Hi
>> >> > > >
>> >> > > > Yeah it suspect quarkus http extension does not bring in servlet
>> api
>> >> > JAR
>> >> > > > which is needed by camel-http.
>> >> > > >
>> >> >
>> https://github.com/apache/camel/blob/main/components/camel-http/pom.xml#L55
>> >> > > >
>> >> > > > You can when doing export try adding
>> >> > > > --deps=javax.servlet:javax.servlet-api:3.1.0 (or whatever maven
>> JAR
>> >> > that
>> >> > > > quarkus uses for servlet as there are many of them)
>> >> > > >
>> >> > > > On Fri, Nov 25, 2022 at 8:30 PM Mikael Koskinen <
>> mijap...@gmail.com>
>> >> > > > wrote:
>> >> > > >
>> >> > > >> Hi,
>> >> > > >>
>> >> > > >> I have some issues when trying to export an integration to
>> Quarkus
>> >> > > >> runtime using Camel JBang if the integration uses
>> >> > > >> kamelet:http-sink.The sample integration causing issues is
>> available
>> >> > > >> from here:
&g

Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-11-30 Thread Claus Ibsen
Hi

Yeah I think its a windows bug in camel-jbang, we had to download
camel-quarkus-catalog in a special way with the Shrinkwrap project.
However now we use standard Maven so we can likely downloader this in a
better way that can work for windows too
https://issues.apache.org/jira/browse/CAMEL-18778

On Wed, Nov 30, 2022 at 1:48 PM Mikael Koskinen  wrote:

> Hey,
>
> I tested with Mac and it worked from the get go with 3.20.0-SNAPSHOT:
> all the dependencies are quarkus versions as expected.
>
> Haven't been able to test the Spring boot & Windows combination yet.
>
> ke 30. marrask. 2022 klo 11.25 Mikael Koskinen (mijap...@gmail.com)
> kirjoitti:
> >
> > Hi,
> >
> > Yep, using Windows. I’ll try the Spring boot export & running things
> with Mac later today and report back with my findings.
> >
> > On Wednesday, November 30, 2022, Claus Ibsen 
> wrote:
> >>
> >> Hi
> >>
> >> Are you using windows btw? I suspect it may also be related to that, as
> it
> >> smells like the camel-quarkus-catalog (needed for export to Q)
> >> is not downloaded and resolved correctly so we fallback to core camel
> maven
> >> GAVs
> >>
> >> Can you try to export to spring boot and look in the generated pom.xml
> that
> >> the GAVs are using camel-xxx-starter ?
> >>
> >>
> >>
> >>
> >> On Tue, Nov 29, 2022 at 8:12 PM Mikael Koskinen 
> wrote:
> >>
> >> > Hey,
> >> >
> >> > Thank you for the help here and in the Gist.
> >> >
> >> > Based on the suggestions I tested the JBang version 3.20.0-SNAPSHOT
> >> > and with Quarkus 2.14.2.Final and still encountered the same issue.
> >> >
> >> > Manually modifying the exported pom.xml got things working. I updated
> >> > the gist with logs and also with the changes I did to pom.xml to make
> >> > things work.
> >> >
> >> > ti 29. marrask. 2022 klo 8.21 Claus Ibsen (claus.ib...@gmail.com)
> >> > kirjoitti:
> >> > >
> >> > > Hi
> >> > >
> >> > > I created a ticket at CEQ
> >> > > https://github.com/apache/camel-quarkus/issues/4300
> >> > >
> >> > > What camel-quarkus version are you using btw. You can try with
> latest
> >> > > 2.14.2 release, you can re-export and set the quarkus version with
> the
> >> > > --quarkus-version option, or adjust the existing pom.xml
> >> > >
> >> > > On Tue, Nov 29, 2022 at 7:10 AM Claus Ibsen 
> >> > wrote:
> >> > >
> >> > > > Hi
> >> > > >
> >> > > > Yeah it suspect quarkus http extension does not bring in servlet
> api
> >> > JAR
> >> > > > which is needed by camel-http.
> >> > > >
> >> >
> https://github.com/apache/camel/blob/main/components/camel-http/pom.xml#L55
> >> > > >
> >> > > > You can when doing export try adding
> >> > > > --deps=javax.servlet:javax.servlet-api:3.1.0 (or whatever maven
> JAR
> >> > that
> >> > > > quarkus uses for servlet as there are many of them)
> >> > > >
> >> > > > On Fri, Nov 25, 2022 at 8:30 PM Mikael Koskinen <
> mijap...@gmail.com>
> >> > > > wrote:
> >> > > >
> >> > > >> Hi,
> >> > > >>
> >> > > >> I have some issues when trying to export an integration to
> Quarkus
> >> > > >> runtime using Camel JBang if the integration uses
> >> > > >> kamelet:http-sink.The sample integration causing issues is
> available
> >> > > >> from here:
> >> > > >>
> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
> >> > > >>
> >> > > >> The integration runs fine using "camel run myintegration.yaml"
> >> > > >>
> >> > > >> But if I export it to Quarkus using "camel export -dir=pub
> >> > > >> --gav=com.foo:acme:1.0-SNAPSHOT --runtime=quarkus --fresh"
> >> > > >>
> >> > > >> And then try to run things using "mvn compile quarkus:dev" I get:
> >> > > >>
> >> > > >> ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread)
> Error
> >

Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-11-29 Thread Claus Ibsen
Hi

Are you using windows btw? I suspect it may also be related to that, as it
smells like the camel-quarkus-catalog (needed for export to Q)
is not downloaded and resolved correctly so we fallback to core camel maven
GAVs

Can you try to export to spring boot and look in the generated pom.xml that
the GAVs are using camel-xxx-starter ?




On Tue, Nov 29, 2022 at 8:12 PM Mikael Koskinen  wrote:

> Hey,
>
> Thank you for the help here and in the Gist.
>
> Based on the suggestions I tested the JBang version 3.20.0-SNAPSHOT
> and with Quarkus 2.14.2.Final and still encountered the same issue.
>
> Manually modifying the exported pom.xml got things working. I updated
> the gist with logs and also with the changes I did to pom.xml to make
> things work.
>
> ti 29. marrask. 2022 klo 8.21 Claus Ibsen (claus.ib...@gmail.com)
> kirjoitti:
> >
> > Hi
> >
> > I created a ticket at CEQ
> > https://github.com/apache/camel-quarkus/issues/4300
> >
> > What camel-quarkus version are you using btw. You can try with latest
> > 2.14.2 release, you can re-export and set the quarkus version with the
> > --quarkus-version option, or adjust the existing pom.xml
> >
> > On Tue, Nov 29, 2022 at 7:10 AM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > Yeah it suspect quarkus http extension does not bring in servlet api
> JAR
> > > which is needed by camel-http.
> > >
> https://github.com/apache/camel/blob/main/components/camel-http/pom.xml#L55
> > >
> > > You can when doing export try adding
> > > --deps=javax.servlet:javax.servlet-api:3.1.0 (or whatever maven JAR
> that
> > > quarkus uses for servlet as there are many of them)
> > >
> > > On Fri, Nov 25, 2022 at 8:30 PM Mikael Koskinen 
> > > wrote:
> > >
> > >> Hi,
> > >>
> > >> I have some issues when trying to export an integration to Quarkus
> > >> runtime using Camel JBang if the integration uses
> > >> kamelet:http-sink.The sample integration causing issues is available
> > >> from here:
> > >> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
> > >>
> > >> The integration runs fine using "camel run myintegration.yaml"
> > >>
> > >> But if I export it to Quarkus using "camel export -dir=pub
> > >> --gav=com.foo:acme:1.0-SNAPSHOT --runtime=quarkus --fresh"
> > >>
> > >> And then try to run things using "mvn compile quarkus:dev" I get:
> > >>
> > >> ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error
> > >> running Quarkus: java.lang.reflect.InvocationTargetException
> > >> ...
> > >> Caused by: java.lang.ClassNotFoundException:
> > >> javax.servlet.http.HttpServletRequest
> > >> at
> > >>
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
> > >> at
> > >>
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> > >> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
> > >> at
> > >>
> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:490)
> > >> at
> > >>
> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:440)
> > >>
> > >> The full exception is available from the same gist:
> > >> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
> > >>
> > >> If I export to Camel Main it works OK.
> > >>
> > >> Am I missing something? Any advice is appreciated.
> > >>
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -
> > > @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> > >
> >
> >
> > --
> > 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: Migration from 2.x to 3.x

2022-11-29 Thread Claus Ibsen
Hi

An app is classloader isolated, eg a WAR in Apache Tomcat, an OSGi bundle,
a Spring Boot app, etc.

On Tue, Nov 29, 2022 at 9:18 AM Ephemeris Lappis 
wrote:

> Hello.
>
> We're looking for the constraints that may exist to migrate our
> projects from Camel 2.x to 3.x.
>
> One of them is mentioned in
> https://camel.apache.org/manual/camel-3-migration-guide.html, about
> multiple Camel contexts in the same application.
>
> I'd like to be sure about what is an "application", and if we're
> impacted by such restrictions.
>
> An example of project structure :
> - An OSGi bundle as deployment unit (today managed as a RedHat Fuse
> profile, and planned to be managed as a Karaf feature.
> - Some beans to define some kind of data and specific EventNotifier
> implementations.
> - 1 blueprint to declare default properties (property-placeholder with
> the PID attached to the bundle) that may be overridden or not by
> deployments. Some properties defined once are used in different
> contexts.
> - 1 blueprint to instantiate beans or to reference external services
> - 1 blueprint with shared common routes with "vm" endpoints
> - 7 blueprints for 7 business groups of routes that rely on common
> services and use common properties and shared routes.
>
> Can we port this kind of projects to Camel 3.x as is, or should we
> change completely our design to move each Camel context in its own
> bundle, each bundle with its own configuration property file
> (duplicating entries), and as many features as bundles, multiplying
> dev-ops and production work ?
>
> Thanks in advance for your advice and help.
>
> Regards.
>


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


Re: Camel JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-11-28 Thread Claus Ibsen
Hi

I created a ticket at CEQ
https://github.com/apache/camel-quarkus/issues/4300

What camel-quarkus version are you using btw. You can try with latest
2.14.2 release, you can re-export and set the quarkus version with the
--quarkus-version option, or adjust the existing pom.xml

On Tue, Nov 29, 2022 at 7:10 AM Claus Ibsen  wrote:

> Hi
>
> Yeah it suspect quarkus http extension does not bring in servlet api JAR
> which is needed by camel-http.
> https://github.com/apache/camel/blob/main/components/camel-http/pom.xml#L55
>
> You can when doing export try adding
> --deps=javax.servlet:javax.servlet-api:3.1.0 (or whatever maven JAR that
> quarkus uses for servlet as there are many of them)
>
> On Fri, Nov 25, 2022 at 8:30 PM Mikael Koskinen 
> wrote:
>
>> Hi,
>>
>> I have some issues when trying to export an integration to Quarkus
>> runtime using Camel JBang if the integration uses
>> kamelet:http-sink.The sample integration causing issues is available
>> from here:
>> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
>>
>> The integration runs fine using "camel run myintegration.yaml"
>>
>> But if I export it to Quarkus using "camel export -dir=pub
>> --gav=com.foo:acme:1.0-SNAPSHOT --runtime=quarkus --fresh"
>>
>> And then try to run things using "mvn compile quarkus:dev" I get:
>>
>> ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error
>> running Quarkus: java.lang.reflect.InvocationTargetException
>> ...
>> Caused by: java.lang.ClassNotFoundException:
>> javax.servlet.http.HttpServletRequest
>> at
>> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
>> at
>> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
>> at
>> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:490)
>> at
>> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:440)
>>
>> The full exception is available from the same gist:
>> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
>>
>> If I export to Camel Main it works OK.
>>
>> Am I missing something? Any advice is appreciated.
>>
>
>
> --
> 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 JBang http-sink issue when exporting to Quarkus runtime: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest

2022-11-28 Thread Claus Ibsen
Hi

Yeah it suspect quarkus http extension does not bring in servlet api JAR
which is needed by camel-http.
https://github.com/apache/camel/blob/main/components/camel-http/pom.xml#L55

You can when doing export try adding
--deps=javax.servlet:javax.servlet-api:3.1.0 (or whatever maven JAR that
quarkus uses for servlet as there are many of them)

On Fri, Nov 25, 2022 at 8:30 PM Mikael Koskinen  wrote:

> Hi,
>
> I have some issues when trying to export an integration to Quarkus
> runtime using Camel JBang if the integration uses
> kamelet:http-sink.The sample integration causing issues is available
> from here:
> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
>
> The integration runs fine using "camel run myintegration.yaml"
>
> But if I export it to Quarkus using "camel export -dir=pub
> --gav=com.foo:acme:1.0-SNAPSHOT --runtime=quarkus --fresh"
>
> And then try to run things using "mvn compile quarkus:dev" I get:
>
> ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error
> running Quarkus: java.lang.reflect.InvocationTargetException
> ...
> Caused by: java.lang.ClassNotFoundException:
> javax.servlet.http.HttpServletRequest
> at
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
> at
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
> at
> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:490)
> at
> io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:440)
>
> The full exception is available from the same gist:
> https://gist.github.com/mikoskinen/71ce1d1ba5b5d7b690a4ec12af20e8ec
>
> If I export to Camel Main it works OK.
>
> Am I missing something? Any advice is appreciated.
>


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


Re: Templates mix xml and java builder

2022-11-27 Thread Claus Ibsen
I created a ticket
https://issues.apache.org/jira/browse/CAMEL-18764

On Sun, Nov 27, 2022 at 1:49 PM Claus Ibsen  wrote:

> Hi
>
> Okay I can also reproduce this, so the problem is that the java routes are
> initialized before the xml.
> This new templatedRoute from a RouteBuilder is problematic as it's a
> chicken and egg situation.
>
>
> On Sat, Nov 26, 2022 at 1:43 PM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
>> Oki doki - will do. Thanks.
>>
>> Sendt fra Outlook til iOS <https://aka.ms/o0ukef>
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.niel...@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
>> *For a safer and smarter world*
>> NOTE: This e-mail (including any attachments) is for the sole use of the
>> intended recipient(s) and may contain information that  confidential and/or
>> protected by legal privilege. Any unauthorized review, use, copy,
>> disclosure or distribution of this e-mail is strictly prohibited. If you
>> are not the intended recipient, please notify AddSecure immediately and
>> destroy all copies of this e-mail. AddSecure does not accept any liability
>> for breach of security, error or virus that may result from the
>> trans­mission of this message.
>>
>> --
>> *Fra:* Claus Ibsen 
>> *Sendt:* Saturday, November 26, 2022 1:40:10 PM
>> *Til:* users@camel.apache.org 
>> *Emne:* Re: Templates mix xml and java builder
>>
>> CAUTION: External email
>> Hi
>>
>> Okay you are welcome to create a JIRA ticket and if you have a sample
>> project that reproduces this then its easier for us to use to tackle this.
>>
>> On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
>> svend-ole.niel...@addsecure.com> wrote:
>>
>> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.niel...@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
>> *For a safer and smarter world*
>> NOTE: This e-mail (including any attachments) is for the sole use of the
>> intended recipient(s) and may contain information that  confidential and/or
>> protected by legal privilege. Any unauthorized review, use, copy,
>> disclosure or distribution of this e-mail is strictly prohibited. If you
>> are not the intended recipient, please notify AddSecure immediately and
>> destroy all copies of this e-mail. AddSecure does not accept any liability
>> for breach of security, error or virus that may result from the
>> trans­mission of this message.
>>
>> --
>> *Fra:* Claus Ibsen 
>> *Sendt:* 26. november 2022 12:52
>> *Til:* users@camel.apache.org 
>> *Emne:* Re: Templates mix xml and java builder
>>
>> CAUTION: External email
>> What version of Camel do you use?
>>
>> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
>> svend-ole.niel...@addsecure.com> wrote:
>>
>> Hi again
>>
>> Problem is - it does not work (at least here)
>>
>> Taking the routetemplate-xml example and adding a RouteBuilder with
>>
>> templatedRoute("myXmlTemplate")
>> .parameter("name", "Name")
>> .parameter("greeting", "Hello there");
>>
>> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
>> Cannot find RouteTemplate with id myXmlTemplate.
>>
>> Same goes for the other example in the routetemplate example - same
>> situation. However the java created templates can be instantiated using
>> yaml. So this leads me to believe that using XML defined templates can not
>> be used from Java but the opposite is possible.
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.niel...@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
>> *For a safer and smarter world*
>> NO

Re: Templates mix xml and java builder

2022-11-27 Thread Claus Ibsen
Hi

Okay I can also reproduce this, so the problem is that the java routes are
initialized before the xml.
This new templatedRoute from a RouteBuilder is problematic as it's a
chicken and egg situation.


On Sat, Nov 26, 2022 at 1:43 PM Svend Ole Nielsen <
svend-ole.niel...@addsecure.com> wrote:

> Oki doki - will do. Thanks.
>
> Sendt fra Outlook til iOS <https://aka.ms/o0ukef>
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
> --
> *Fra:* Claus Ibsen 
> *Sendt:* Saturday, November 26, 2022 1:40:10 PM
> *Til:* users@camel.apache.org 
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> Okay you are welcome to create a JIRA ticket and if you have a sample
> project that reproduces this then its easier for us to use to tackle this.
>
> On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
> --
> *Fra:* Claus Ibsen 
> *Sendt:* 26. november 2022 12:52
> *Til:* users@camel.apache.org 
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> What version of Camel do you use?
>
> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
> .parameter("name", "Name")
> .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
>

Re: Templates mix xml and java builder

2022-11-26 Thread Claus Ibsen
Hi

Okay you are welcome to create a JIRA ticket and if you have a sample
project that reproduces this then its easier for us to use to tackle this.

On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
svend-ole.niel...@addsecure.com> wrote:

> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
> --
> *Fra:* Claus Ibsen 
> *Sendt:* 26. november 2022 12:52
> *Til:* users@camel.apache.org 
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> What version of Camel do you use?
>
> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
> .parameter("name", "Name")
> .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
> --
> *Fra:* Claus Ibsen 
> *Sendt:* 26. november 2022 08:37
> *Til:* users@camel.apache.org 
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> You can mix any kind of DSLs you like.
>
> This example uses route configuration (but should work for route template
> as well), and have different DSLs
>
> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>
>
>
>
> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
> Hi - I have been looking all over the documentation and been at Google,
> but nowhere has it been possible to dig some info up, so here goes:
>
> Would it be possible to define a template in XML and load it in a Java
> Routebuilder? Or is it xml only both template definition and route building?
>
> Regards,
> Svend O.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosu

Re: Templates mix xml and java builder

2022-11-26 Thread Claus Ibsen
What version of Camel do you use?

On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
svend-ole.niel...@addsecure.com> wrote:

> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
> .parameter("name", "Name")
> .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
> --
> *Fra:* Claus Ibsen 
> *Sendt:* 26. november 2022 08:37
> *Til:* users@camel.apache.org 
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> You can mix any kind of DSLs you like.
>
> This example uses route configuration (but should work for route template
> as well), and have different DSLs
>
> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>
>
>
>
> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
> svend-ole.niel...@addsecure.com> wrote:
>
> Hi - I have been looking all over the documentation and been at Google,
> but nowhere has it been possible to dig some info up, so here goes:
>
> Would it be possible to define a template in XML and load it in a Java
> Routebuilder? Or is it xml only both template definition and route building?
>
> Regards,
> Svend O.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: 
> https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W
>
>


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


Re: Templates mix xml and java builder

2022-11-25 Thread Claus Ibsen
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template
as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
svend-ole.niel...@addsecure.com> wrote:

> Hi - I have been looking all over the documentation and been at Google,
> but nowhere has it been possible to dig some info up, so here goes:
>
> Would it be possible to define a template in XML and load it in a Java
> Routebuilder? Or is it xml only both template definition and route building?
>
> Regards,
> Svend O.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.niel...@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> *For a safer and smarter world*
> NOTE: This e-mail (including any attachments) is for the sole use of the
> intended recipient(s) and may contain information that  confidential and/or
> protected by legal privilege. Any unauthorized review, use, copy,
> disclosure or distribution of this e-mail is strictly prohibited. If you
> are not the intended recipient, please notify AddSecure immediately and
> destroy all copies of this e-mail. AddSecure does not accept any liability
> for breach of security, error or virus that may result from the
> trans­mission of this message.
>
>

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


Re: DefaultErrorHandler not logging to specific log file

2022-11-25 Thread Claus Ibsen
Hi

Use, dead letter channel to send the message to a log endpoint of your
choice, such as log:error.
That is essentially what the log error handler did.
https://camel.apache.org/manual/error-handler.html


On Fri, Nov 25, 2022 at 2:01 PM Tasi, Erne  wrote:

> Hello All,
>
> We are using Camel in Karaf and recently we upgraded Karaf to version
> 4.2.1 and camel to 3.18.3. I am not sure if it is a bug or if I am doing
> something wrong, but it seems as if when I want to use the
> DefaultErrorHandler to log errors to a specific log file it doesn't work
> anymore. In previous versions we used the LoggerErrorHandler for this but
> apparently it has been removed therefore the DefaultErrorHandler would be
> the right candidate for the replacement.
>
> I have a logger configured in org.ops4j.pax.logging.cfg file like so:
> log4j2.logger.ErrorLoggingTestServiceError.name =
> ErrorLoggingTestServiceErrorLogger
> log4j2.logger.ErrorLoggingTestServiceError.level = ERROR
> log4j2.logger.ErrorLoggingTestServiceError.appenderRef.ErrorLoggingTestServiceError.ref
> = ErrorLoggingTestServiceError
> log4j2.appender.ErrorLoggingTestServiceError.name =
> ErrorLoggingTestServiceError
> log4j2.appender.ErrorLoggingTestServiceError.type = RollingFile
> log4j2.appender.ErrorLoggingTestServiceError.fileName =
> ${custom.logs.path}/ErrorLoggingTestService/ErrorLoggingTestService-Error.log
> log4j2.appender.ErrorLoggingTestServiceError.filePattern =
> ${custom.logs.path}/ErrorLoggingTestService/ErrorLoggingTestService-Error.%i.log.gz
> log4j2.appender.ErrorLoggingTestServiceError.immediateFlush = true
> log4j2.appender.ErrorLoggingTestServiceError.append = true
> log4j2.appender.ErrorLoggingTestServiceError.layout.type = PatternLayout
> log4j2.appender.ErrorLoggingTestServiceError.layout.pattern =
> ${log4j2.patternCamel}
> log4j2.appender.ErrorLoggingTestServiceError.policies.type = Policies
> log4j2.appender.ErrorLoggingTestServiceError.policies.size.type =
> SizeBasedTriggeringPolicy
> log4j2.appender.ErrorLoggingTestServiceError.policies.size.size = 50MB
>
> The ErrorLoggingTestService looks like this:
>
> 
> http://www.osgi.org/xmlns/blueprint/v1.0.0;
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>   xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
> http://camel.apache.org/schema/blueprint
> http://camel.apache.org/schema/blueprint/camel-blueprint-3.18.3.xsd;>
>
>   
>
>class="java.lang.IllegalStateException">
> 
>   
>
>factory-method="getLogger">
> 
>   
>
>errorHandlerRef="defaultEH"
> xmlns="http://camel.apache.org/schema/blueprint;>
>
>  logName="ErrorLoggingTestServiceErrorLogger" level="ERROR"/>
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
>   
>
>   
>
>   
> Log-Message from Camel Context.
>   
>
>   
>
>   
> 
>
>   
> 
>
> Now when the onException is not commented out and the defaultErrorLogger
> bean is used the log is written so the logger configuration should be ok,
> however the defaultEH error handler does not write into the log file. I
> have tried to set the log name in different ways even as a bean with the
> DefaultErrorHandlerBuilder class to no avail. The error log is created, but
> no logs are written to it. Does anyone have an idea where the problem is in
> my code or at least a working example where the ERROR logs would be written
> in a separate log file.
>
> Best Regards,
> Erne
>
>
>
> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30,
> Fax: +49 711 7825-4000, Internet: www.cenit.com
> Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover,
> Muenchen, Oelsnitz, Ratingen, Saarbruecken
> Vorstandsmitglieder (Members of the Board): Peter Schneck, Axelle Maze
> Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz
> (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof.
> Dr. Isabell Welpe, Ricardo Malta
> Bankverbindungen (Bank Accounts):
> Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166
> 1040 00 SWIFT-CODE : DEUTDESS,
> Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532
> 0155 00 SWIFT-Code : COBADEFF600,
> Registergericht (Registry court): Amtsgericht Stuttgart
> Handelsregister (Commercial Register): HRB Nr. 19117
> Umsatzsteuer (VAT) ID: DE 147 862 777
>


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


<    1   2   3   4   5   6   7   8   9   10   >