Re: Camel 4.6.0: Issue with AdviceWithRouteBuilder

2024-07-12 Thread Claus Ibsen
Hi

No but try with 4.7.0 when its released

On Fri, Jul 12, 2024 at 11:14 AM Klug Andreas (BD/SWD-BEB5)
 wrote:

> Hello everyone,
>
> After migrating from 4.4.0 to 4.6.0 we experience a strange issue with the
> AdviceWithRouteBuilder.
>
> We do have multiple AdviceWithTasks which are working in 4.4.0 and 4.6.0,
> e. g.
>
>   *   weaveByToUri("micrometer:.*").before()
>   *   weaveById("*").selectLast().before()
>
> However, using weaveAddFirst().before() or builder.weaveAddFirst().after()
> won’t work starting from 4.6.0.
> I double-checked that by weaving in pretty simple to identify statements
> like
> .log("")
> and finding these statements in the route dump.
> Even trying to mimic weaveAddFirst() by using
> weaveById(“*”).selectFirst().before() or
> weaveById(“*”).selectFirst().after() doesn’t seem to work.
>
> Do you have any suggestions?
>
> Best Regards,
> Andreas
>


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


Re: Camel NotifyBuilder does not match when exception is thrown

2024-07-11 Thread Claus Ibsen
Hi

whenFrom is from the original route, so that would be "direct:route-a"

You can use fromCurrentRoute (route id based) instead

On Thu, Jul 11, 2024 at 12:16 PM Lance Java
 wrote:

> I asked this question on stack overflow but didn't get a response so asking
> here
>
> https://stackoverflow.com/questions/78720143/camel-notifybuilder-does-not-match-when-exception-is-thrown
>
> It seems that camel's NotifyBuilder
> <https://camel.apache.org/manual/notify-builder.html> works in normal
> message processing but does not work when exceptions are thrown.
>
> Please see the following test case where I create the following routes
>
>- direct:route-a adds "a" to a list and passes to direct:route-b
>- direct:route-b adds "b" to a list and throws exception
>- errorHandler routes to direct:dead-letter as a deadLetterChannel
>- direct:dead-letter adds "dead" to a list
>
> I can see that the list contains "a", "b", "dead" when I send a message to
> direct:route-a
>
> But the NotifyBuilders for direct:route-b and direct:dead-letter don't
> match for some reason.
>
> Is there a bug in NotifyBuilder where they don't match when exceptions are
> thrown? Am I using NotifyBuilder incorrectly? I've tried both
> NotifyBuilder.whenDone(1) and NotifyBuilder.whenFailed(1) and neither
> causes a match.
>
> Looking at the NotifyBuilder javadoc
> <
> https://www.javadoc.io/doc/org.apache.camel/camel-core/2.25.4/org/apache/camel/builder/NotifyBuilder.html#whenDone-int-
> >
> I
> see the following comment for whenDone(...)
>
> > The difference between done and completed is that done can also include
> failed messages, where as completed is only successful processed messages.
>
> import lombok.extern.slf4j.Slf4j;import
> org.apache.camel.CamelContext;import
> org.apache.camel.ProducerTemplate;import
> org.apache.camel.builder.NotifyBuilder;import
> org.apache.camel.builder.RouteBuilder;import
> org.apache.camel.impl.DefaultCamelContext;import
> org.apache.camel.impl.engine.DefaultProducerTemplate;import
> org.junit.jupiter.api.AfterEach;import
> org.junit.jupiter.api.BeforeEach;import org.junit.jupiter.api.Test;
> import java.util.LinkedList;import java.util.List;import
> java.util.concurrent.TimeUnit;
> import static org.assertj.core.api.Assertions.assertThat;
> @Slf4jpublic class NotifyBuilderTest {
> private CamelContext camelContext;
> private ProducerTemplate producerTemplate;
> private List list;
>
> @BeforeEach
> public void beforeEach() throws Exception {
> list = new LinkedList<>();
> camelContext = new DefaultCamelContext();
>
> camelContext.addRoutes(new RouteBuilder() {
> @Override
> public void configure() {
> from("direct:route-a")
> .process(exchange -> list.add("a"))
> .to("direct:route-b");
>
> from("direct:route-b")
> .process(exchange -> list.add("b"))
> .process(exchange -> { throw new Exception("foo");
> });
>
> errorHandler(deadLetterChannel("direct:dead-letter"));
>
> from("direct:dead-letter")
> .process(exchange -> list.add("dead"));
> }
> });
> producerTemplate = new DefaultProducerTemplate(camelContext);
>
> camelContext.start();
> producerTemplate.start();
> }
>
> @AfterEach
> public void afterEach() {
> producerTemplate.stop();
> camelContext.stop();
> }
>
> @Test
> public void testNotify() {
> NotifyBuilder notifierA = new NotifyBuilder(camelContext)
> .from("direct:route-a")
> .whenDone(1)
> .create();
> NotifyBuilder notifierB = new NotifyBuilder(camelContext)
> .from("direct:route-b")
> .whenDone(1)
> .create();
> NotifyBuilder notifierDead = new NotifyBuilder(camelContext)
> .from("direct:dead-letter")
>     .whenDone(1)
> .create();
>
> producerTemplate.sendBody("direct:route-a", null);
>
> // this succeeds
> assertThat(list).containsExactly("a", "b", "dead");
>
> // this succeeds
> assertThat(notifierA.matches(5, TimeUnit.SECONDS)).isTrue();
>
> // this fails
> assertThat(notifierB.matches(5, TimeUnit.SECONDS)).isTrue();
>
> // this fails
> assertThat(notifierDead.matches(5, TimeUnit.SECONDS)).isTrue();
> }
> }
>


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


Re: MDCUnitOfWork not working with vert.x-eventloop-thread

2024-07-11 Thread Claus Ibsen
Hi

This is an old Quarkus version and we dont support this
 CAMEL VERSION   QUARKUSJDK   KIND RELEASED SUPPORTED UNTIL
 3.18.6   2.13.3   11  LTS   April 2023July 2023

You can try latest v4 Camel version and see what happens there.



On Thu, Jul 11, 2024 at 7:58 AM _ Jane  wrote:

> Dear community,
>
> When I using Camel Quarkus and use camel-knative event producer, the
> thread name is vert.x-eventloop-thread-xxx and the fields from
> MDCUnitOfWork (like camel.routeId) is missing. Is there any special
> configuration needed to show the MDCUnitOfWork fields in my log? Thanks!
>
> The Camel Quarkus version is 2.13.3 and here is the sample code:
>
> from("timer://foo?fixedRate=true=6")
> .routeId("route_timer_test")
> .setBody(constant("test event"))
> .setHeader(CloudEvent.CAMEL_CLOUD_EVENT_SOURCE, constant("test-route"))
> .log("there is camel.routeId")
> .to("knative:event/broker-test")
> .log("there isn't camel.routeId")
>
> The log format config is "quarkus.log.console.format=%d{-MM-dd
> HH:mm:ss,SSS} %-5p [%c{3.}] (%t) - %X{camel.routeId} - %s%e%n" and the
> result log is:
>
> 2024-07-11 13:53:51,273 INFO  [route_timer_test] (Camel (test-route)
> thread #2 - timer://foo) - route_timer_test- there is camel.routeId
> 2024-07-11 13:53:51,401 INFO  [route_timer_test]
> (vert.x-eventloop-thread-0) -  - there isn't camel.routeId
>
>

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


Re: Camel bean

2024-07-05 Thread Claus Ibsen
Hi

Sounds a bit complex, but you are welcome to create a JIRA.
And provide some sample code that demonstrates this. Or see if you dare to
add some kind of unit test that reproduces this, and works with your fix.



On Fri, Jul 5, 2024 at 5:33 PM logesh  wrote:

> I am trying to use bean with reference and method call.The bean has
> overloaded methods and hence it is being called in this way.The below
> method call was populated with parameter type and value in reference to the
> guidanct provided in  here.
>
> https://camel.apache.org/manual/bean-binding.html#_declaring_parameter_type_and_value
>
> My bean spring DSL looks as below
>
> 
> I get  ambiguous method invocation possible exception.
> On investigating further this was drilled down to issue happening during
> the matchmethod call in BeanInfo class under org.apache.camel.component.
>
> The matchmethod was calling the method splitsafequote method with 4
> parameters (input seperator trime:true and keepquote:true) in
> strignquotehelper class under org.apache.camel.util which splits the
> parameters and types.The problem was isolated to the type and value
> concatenated with space between them ignored.The flag skipleadingwhitespace
> is set to true and is never changed which ignores the space and is missed
> in the parsing logic.
> This in turn breaks at the match method which looks for the indexof(32)
> which is for a whitespace and since it's not there it returns -1 and there
> by breaking the whole purpose of passing parameter type and value.
>
> Camel version used :4.5.0
> Camel components:camel-bean and camel-util
>
> Please let know if this is a bug or if any missing configuration from.my
> side
>
> PS:I changed the flag to false and it works fine with the above bean method
> call
>
> Thanks
> Logeshwaran Devakar
>


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


Re: RabbitMQ component and Failed auto ACK

2024-07-05 Thread Claus Ibsen
Hi

You need to ask spring-rabbitmq how their auto ack works, but I would
assume it would ack it as soon as Camel receive the message (onMessage)
like JMS.
And that Camel will process the message no matter what.

If you want once and only once semantics then you need something that acks
it later (or something like transactional).
But distributed messaging and networking is complex, also be prepared for
duplicates.

See also the acknowledgeMode option in the camel-spring-rabbitmq docs




On Fri, Jul 5, 2024 at 2:09 PM Guillem Folch 
wrote:

> Hi all,
>
>
> I'm currently using a RabbitMQ queue and a client application using SPRING
> RABBITMQ component as consumer.
> Currently we are not setting any acknowdlege-Mode, so I guess we are using
> auto acknacknowledgement , so we let Camel component to manage
> automatically the ACK of the message  when the consumer receives the
> message from the queue.
> Our simplified Camel route looks like the following:
>
>
> 
>uri="spring-rabbitmq:MyExchange?routingKey=MyQueue=MyQueue=20"/>
> 
>   
>  
>
> My question is what happens with the flow if the Ack cannot be sent
> successfully, for instance because there's a network issue or a problem in
> RabbitMQ.
> Will be the Camel message aborted? Will continue the flow to the
> direct:someOtherCamleRoute?
>
> I was expecting that in this situation the flow will not continue. But
> I've got some customer logs that seem to indicate that the flow continues
> and the message is sent to the processor and to the next route.
> In this case as the message is not acknowledged in RabbitMQ, after some
> time is already available for another consumer and it's duplicating the
> message process.
> Is this possible? Am I missing something?
>
> Thanks
> Guillem
>
>
>
>

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


Re: Troubles with dynamic routing RabbiMQ endpoint and route start/stop

2024-07-04 Thread Claus Ibsen
Hi

camel-rabbitmq is the old component that is deprecated.
You should use camel-spring-rabbitmq

And you cannot mix old Camel v3 components with Camel v4

On Thu, Jul 4, 2024 at 9:52 AM Jan Bares, WOOD & Co.
 wrote:

> Hi,
>
> We have dynamic toD() endpoint of RabbitMQ producer (camel-rabbitmq). We
> send few exchanges and stop the route. Then we start the route and send
> another exchange, but RabbitMQProducer says:
>
> Failed delivery for (MessageId: 9269944780100 on ExchangeId:
> 9269944780100). Exhausted after delivery attempt: 1 caught:
> java.util.concurrent.RejectedExecutionException
> java.util.concurrent.RejectedExecutionException: null
> at
> org.apache.camel.component.rabbitmq.RabbitMQProducer.process(RabbitMQProducer.java:199)
> ...
>
> This is because the RabbbitMQProducer is not running:
>
> public boolean process(Exchange exchange, AsyncCallback callback) {
> if (!this.isRunAllowed()) {// 197
> if (exchange.getException() == null) {// 198
> exchange.setException(new RejectedExecutionException());//
> 199
> }
>
> I suspect this is a bug related to dynamic routing.
>
> SpringBoot 3.2.5
> Camel 4.6.0
> camel-rabbitmq 3.22.2
>
> Thank you for any pointers, Jan
>
> Jan Bares
> Head of Calypso development | IT Development
>
> Phone: +420 222 096 457
> Mobile: +420 776 333 676
> Email: jan.ba...@wood.cz
>
> WOOD & Company
> Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic |
> wood.cz
>
>
>
>
>
> 
> DISCLAIMER
> WOOD & Company Financial Services, a.s. and its branches are authorized
> and regulated by the CNB as Home State regulator and in Poland by the KNF,
> in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as
> Host State regulators. For further information about WOOD & Co., its
> investment services, financial instruments and associated risks, safeguard
> client assets (incl. compensation schemes) and contractual relationship
> please see our website at www.wood.com<http://www.wood.com/> under
> section Corporate Governance. Unless otherwise stated, this transmission is
> neither an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: Route stop with long running processor

2024-07-02 Thread Claus Ibsen
Hi

Try implement ShutdownPrepared

On Tue, Jul 2, 2024 at 11:07 AM Jan Bares, WOOD & Co.
 wrote:

> Hi,
>
> We have a processor that takes long time to finish processing (tenths of
> seconds) each exchange. Is there a way the processor can tell the route is
> about to be stopped and finish the processing immediately? It seems that
> the doStop is called only after all the processing is finished. In the
> processor we have a loop and we can break the loop when we know that the
> route is about to be stopped.
>
> Thanks, Jan
>
> Jan Bares
> Head of Calypso development | IT Development
>
> Phone: +420 222 096 457
> Mobile: +420 776 333 676
> Email: jan.ba...@wood.cz
>
> WOOD & Company
> Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic |
> wood.cz
>
>
>
>
>
> 
> DISCLAIMER
> WOOD & Company Financial Services, a.s. and its branches are authorized
> and regulated by the CNB as Home State regulator and in Poland by the KNF,
> in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as
> Host State regulators. For further information about WOOD & Co., its
> investment services, financial instruments and associated risks, safeguard
> client assets (incl. compensation schemes) and contractual relationship
> please see our website at www.wood.com<http://www.wood.com/> under
> section Corporate Governance. Unless otherwise stated, this transmission is
> neither an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: [VOTE] Release Apache Camel Kamelets 4.4.3

2024-07-01 Thread Claus Ibsen
+1 (binding)

On Mon, Jul 1, 2024 at 9:59 AM Andrea Cosentino  wrote:

> Hello all,
>
> This is a vote for releasing camel-kamelets 4.4.3
>
> This is a release supporting Camel 4.4.3 and it's an LTS release.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/4.4.3
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1726
> Kamelets Tag:
> https://github.com/apache/camel-kamelets/releases/tag/v4.4.3
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 4.4.3
> [ ] -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: When exactly are the route "after processing" options such as file move done?

2024-06-18 Thread Claus Ibsen
On Tue, Jun 18, 2024 at 12:06 PM Jan Bares, WOOD & Co.
 wrote:

> Yes, thanks. And does the rename happen on the first to() in the route or
> on the last one?
>
>
when the exchange from the original route is done being routed at the end


> Jan
>
> > -Original Message-
> > From: Claus Ibsen 
> > Sent: Tuesday, June 18, 2024 11:52 AM
> > To: users@camel.apache.org
> > Subject: Re: When exactly are the route "after processing" options such
> as file
> > move done?
> >
> > Its the original route that move/rename then file when its done, not the
> > wiretaps
> >
> > On Tue, Jun 18, 2024 at 11:40 AM Jan Bares, WOOD & Co.
> >  wrote:
> >
> > > Hi,
> > >
> > > Say I have a route that reads a file and after processing it moves the
> > > file to another folder.
> > >
> > >
> > >
> >
> from("file:/mnt/folder/?include=input.txt=done/{date:now:MMddHHmms
> > sSSS}.txt")
> > > .process(...)
> > > .wireTap("routeB")
> > > .split(...)
> > > .filter(...)
> > > .to(...)
> > > .wireTap("routeC")
> > > .process(...)
> > > .to(...)
> > >
> > > When exactly is the move operation done? As you can see I have
> > > intermediate to() in my route and also two wireTap() that pass the
> Exchange
> > > to another route. The question is related to a problem when the
> Exchange
> > > still contains GenericFile but we have seen exception "file not found"
> in a
> > > wireTap route, because the file was already renamed.
> > >
> > > Thank you, Jan
> > >
> > > Jan Bares
> > > Head of Calypso development | IT Development
> > >
> > > Phone: +420 222 096 457
> > > Mobile: +420 776 333 676
> > > Email: jan.ba...@wood.cz
> > >
> > > WOOD & Company
> > > Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic |
> > > wood.cz
> > >
> > >
> > >
> > >
> > >
> > > 
> > > DISCLAIMER
> > > WOOD & Company Financial Services, a.s. and its branches are authorized
> > > and regulated by the CNB as Home State regulator and in Poland by the
> KNF,
> > > in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the
> FCA as
> > > Host State regulators. For further information about WOOD & Co., its
> > > investment services, financial instruments and associated risks,
> safeguard
> > > client assets (incl. compensation schemes) and contractual relationship
> > > please see our website at www.wood.com<http://www.wood.com/> under
> > > section Corporate Governance. Unless otherwise stated, this
> transmission is
> > > neither an offer nor the solicitation of an offer to sell or purchase
> any
> > > investment. All estimates, opinions and other information contained
> herein
> > > are subject to change without notice and are provided in good faith but
> > > without legal responsibility or liability. Opinion may be personal to
> the
> > > author and may not reflect the opinions of WOOD & Co. Communications
> from
> > > sales persons, sales traders or traders should not be regarded as
> > > investment research and may contain opinions or trading ideas which are
> > > different from WOOD & Co. investment research opinions. This e-mail
> and any
> > > attachments are confidential and may be privileged or otherwise
> protected
> > > from disclosure. If you are not a named addressee you must not use,
> > > disclose, distribute, copy, print or rely on this e-mail and any of its
> > > attachments. Please notify the sender that you have received this
> email by
> > > mistake by replying to the email, and then delete the email and any
> copies
> > > of it. Although WOOD & Co. routinely screens e-mails for viruses,
> > > addressees should scan this e-mail and any attachments for viruses.
> WOOD &
> > > Co. makes no representation or warranty as to the absence of viruses in
> > > this e-mail or any attachments. Please note that to ensure regulatory
> > > compliance and for the protection of our clients and business, we may
> > > monitor and read e-mails sent to and from our server(s).
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://

Re: When exactly are the route "after processing" options such as file move done?

2024-06-18 Thread Claus Ibsen
Its the original route that move/rename then file when its done, not the
wiretaps

On Tue, Jun 18, 2024 at 11:40 AM Jan Bares, WOOD & Co.
 wrote:

> Hi,
>
> Say I have a route that reads a file and after processing it moves the
> file to another folder.
>
>
> from("file:/mnt/folder/?include=input.txt=done/{date:now:MMddHHmmssSSS}.txt")
> .process(...)
> .wireTap("routeB")
> .split(...)
> .filter(...)
> .to(...)
> .wireTap("routeC")
> .process(...)
> .to(...)
>
> When exactly is the move operation done? As you can see I have
> intermediate to() in my route and also two wireTap() that pass the Exchange
> to another route. The question is related to a problem when the Exchange
> still contains GenericFile but we have seen exception "file not found" in a
> wireTap route, because the file was already renamed.
>
> Thank you, Jan
>
> Jan Bares
> Head of Calypso development | IT Development
>
> Phone: +420 222 096 457
> Mobile: +420 776 333 676
> Email: jan.ba...@wood.cz
>
> WOOD & Company
> Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic |
> wood.cz
>
>
>
>
>
> 
> DISCLAIMER
> WOOD & Company Financial Services, a.s. and its branches are authorized
> and regulated by the CNB as Home State regulator and in Poland by the KNF,
> in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as
> Host State regulators. For further information about WOOD & Co., its
> investment services, financial instruments and associated risks, safeguard
> client assets (incl. compensation schemes) and contractual relationship
> please see our website at www.wood.com<http://www.wood.com/> under
> section Corporate Governance. Unless otherwise stated, this transmission is
> neither an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: [VOTE] Release Apache Camel K 2.3.3

2024-06-10 Thread Claus Ibsen
+1 (binding)

On Fri, Jun 7, 2024 at 2:11 PM Pasquale Congiusti <
pasquale.congiu...@gmail.com> wrote:

> Hello,
>
> This is a vote to release Apache Camel K 2.3.3. This release provides the
> rebundle of OLM CRDs and some bug fixes required to fix a regression
> spotted on running version 2.3.2 on Openshift cluster via OLM [1].
>
> Camel K release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-k/2.3.3/
>
> Camel K Tag:
> https://github.com/apache/camel-k/releases/tag/v2.3.3
>
> Camel K CRD Java dependency staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1719
>
> Staging container image repository (multi architecture manifest):
>
> https://hub.docker.com/layers/camelk/camel-k/2.3.3/images/sha256-f340d21029300082ef93bb947715aee8bc48a930aae6b0163673ed9cd355b7cc?context=explore
>
> It's possible to install all staging artifacts with a single command
> (preferably using the kamel CLI you find in Camel K release files):
>
> $ kamel install --operator-image=camelk/camel-k:2.3.3 --olm=false
>
> Please test this release candidate and cast your vote.
>
> [ ] +1 Release Apache Camel K 2.3.3
> [ ] -1 Veto the release (provide specific comments)
>
> The vote is open for at least 72 hours.
>
> I start the vote with my +1 (binding).
>
> Thanks and regards,
> Pasquale Congiusti
>
> [1] https://github.com/apache/camel-k/milestone/53?closed=1
>


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


Re: Processor data persistence during route stop

2024-06-06 Thread Claus Ibsen
Hi

That is something you need to implement yourself to have this kind of
persistence. Your processor or beans can extend ServiceSupport (or
implement Service) from Camel then you have doStart/doStop methods that
Camel calls for you.


On Thu, Jun 6, 2024 at 11:18 AM Branko Husarik, Wood & Co.
 wrote:

> Hello,
>
>
>
> I would like to ask about the proper saving and loading of processor
> variables to the database at the route stop. I am trying to use
> RoutePolicySupport to find out the system shutdown, but I don’t see any
> nice solution for how to persist the state of some processors that could be
> restored after startup.
>
> Please, can you give me tips? Thank you
>
>
>
> Best Regards
>
>
>
> Branko Husarik
>
>
>
> *Braňko Husárik*
> Calypso Developer
> IT Development
> email: branko.husa...@wood.cz
> m: +420 606 022 474
>
> WOOD & Company
> Palladium, nám. Republiky 1079/1a
> 110 00 Prague 1, Czech Republic
> wood.com
>
>
>
>
>
>
>
>
>
> --
> DISCLAIMER WOOD & Company Financial Services, a.s. and its branches are
> authorized and regulated by the CNB as Home State regulator and in Poland
> by the KNF, in Slovakia by the NBS, in Italy by the CONSOB and in the UK by
> the FCA as Host State regulators. For further information about WOOD & Co.,
> its investment services, financial instruments and associated risks,
> safeguard client assets (incl. compensation schemes) and contractual
> relationship please see our website at www.wood.com under section
> Corporate Governance. Unless otherwise stated, this transmission is neither
> an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: Issue with duplicate MBean operation causing Hawtio to crash

2024-05-31 Thread Claus Ibsen
Hi

Thanks for reporting
https://issues.apache.org/jira/browse/CAMEL-20820

On Fri, May 31, 2024 at 10:37 AM Roger Goossens 
wrote:

> Hello everybody,
>
> We're hitting a small issue in Camel that unfortunately causes Hawtio to
> crash after upgrading to Camel 4 (and Hawtio 4).
>
> Hawtio crashes due to a duplicate MBean operation being exposed when using
> a json-validator endpoint (and possibly some other endpoints as well). I
> made a small project with a json-validator endpoint to reproduce the issue.
> The project is available here:
> https://github.com/rphgoossens/json-validation
> When you start it up and try to open the Hawtio dashboard (
> http://localhost:8080/actuator/hawtio), you'll notice it won't display
> anything and there's an error visible in the web console.
>
> The underlying issue (after some digging) appears to be a duplicate MBean
> Operation being exposed for the json-validator endpoint
> (clearContentCache())
>
> [image: Screenshot 2024-05-31 at 09.58.41.jpg]
>
> The duplication is a result of a ManagedOperation annotation being present
> on the clearContentCache method of the ResourceEndpoint class (a superclass
> of the JsonValdatorEndpoint class) and a ManagedOperation annotation being
> present on the clearContentCache method of the ManagedResourceEndpointMBean
> interface (an interface that the JsonValidatorEndpoint class implements).
> When you hover over both buttons in VisualVm (picture above), you'll both
> buttons having different descriptions (one has the description of the
> annotation in the ResourceEndpoint class and the other gets its description
> from the ManagedResourceEndpointMBean interface)
>
> [image: Screenshot 2024-05-31 at 10.03.26.jpg]
> [image: Screenshot 2024-05-31 at 10.03.49.jpg]
>
> Funny thing is that the duplication of the operation will NOT take place
> if the descriptions in the ManagedOperation annotations are the same (which
> they currently are not obviously). I tested this by shadowing the
> ResourceEndpoint class in my project and adjusting the description.
> ManagedAttribute annotations that are duplicated in ResourceEndpoint and
> ManagedResourceEndpointMBean (like isContentCache()) with different
> descriptions are not duplicated in the MBean exposure funny enough.
>
> You can argue that this shouldn't cause a crash in Hawtio (and it didn't
> in the 3 version), but the duplicate MBean operation is a small bug IMHO,
> since both operations in the end will call the same method. Only the one
> coming from the class at the bottom of the hierarchy (in this case
> the ResourceEndpoint one) should be exposed.
>
> So my request would be to create a Camel issue to solve this in a future
> Camel version.
>
> The only workaround we currently have is to set the
> camel.main.jms-management-m-beans-level to contextonly. Then Hawtio will
> load without errors, but then we're missing a lot MBean functionality, eg.
> stop and start individual routes in the project.
>
> I hope the information I provided was helpful and complete. Feel free to
> mail me for any additional questions and please let me know if you will
> create an issue for this.
>
> Best Regards,
> Roger Goossens.
>
>
>
>

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


Re: Camel Exception handled unknown element issue

2024-05-28 Thread Claus Ibsen
Hi

You cannot use  in  as that is the point to handle the
exception.
You need to remove it.

On Tue, May 28, 2024 at 1:09 PM Bikash Kaushik 
wrote:

> Hi Team,
>
> I'm  doing camel migration from version 2.15.1 to 4.2.0. In older version
> there is handle tag in exception block :
>
> 
> java.lang.Exception
>
> 
> false
> 
>  message="X-Correlation-Id_${header.X-Correlation-Id} |
> UserId_${header.RequestorId} | Exception occured">
> 
>
> *But while upgrading it to Camel 4 getting below error :*
> Caused by: org.apache.camel.xml.io.XmlPullParserLocationException:
> Unexpected element '{http://camel.apache.org/schema/spring}handled'
> in classpath:routes/camel-route.xml, line 885, column 26:
> 
>
> *Please help me in fixing this issue.*
>
> --
>
>
> *Regards,*
> *Bikash Kaushik*
>


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


Re: Camel Spring RabbitMQ with setMaximumRetryAttempts: Wrong count?

2024-05-25 Thread Claus Ibsen
Hi

Ah yeah the default in spring is 3, so I guess if you want no retry, then 0
should be a valid value.
https://issues.apache.org/jira/browse/CAMEL-20803

On Fri, May 24, 2024 at 2:35 PM Speckels, Bert 
wrote:

> Hallo (again)
>
> In Camel Spring RabbitMQ we found the following component option:
>
> option: maximumRetryAttempts (consumer)
> description: How many times a Rabbitmq consumer will retry the same
> message if Camel failed to process the message.
> default: 5
> type: int
>
> Based on the description, I would actually have expected that this value
> would have to be set to 0
> if we don't want any retries. But that is apparently not the case: With
> value 0, retries still occur (3 times?).
> Only when I set maximumRetryAttempts to 1 no retries will be carried out
> in the event of an error.
>
> Is this the expected behavior?
>
> This option maps directly to 'maxAttempts' of the Spring Framework,
> right?!
> In that case IMHO 'attempts' (including first processing) and
> "retryAttempts' (exluding first processing) have
> different meanings ... but I am not a native speaker :)
>
> Maybe at least the description should mention this more clearly?!
>
> With kind regards
> Bert.



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


Re: Message Header moved to Exchange property in 4.5 or 4.6?!

2024-05-24 Thread Claus Ibsen
Hi

Its already in the guide at
https://camel.apache.org/manual/camel-4x-upgrade-guide-4_5.html#_intercept_eip

On Fri, May 24, 2024 at 2:25 PM Claus Ibsen  wrote:

> Hi
>
> Its
> https://issues.apache.org/jira/browse/CAMEL-20381
>
> On Fri, May 24, 2024 at 2:23 PM Claus Ibsen  wrote:
>
>> Hi
>>
>> You are welcome to add this to the guide, (find out which version it was
>> changed, so you can add it to the correct guide)
>>
>>
>> On Fri, May 24, 2024 at 2:21 PM Speckels, Bert 
>> wrote:
>>
>>> Hallo
>>>
>>> We upgraded from Camel 4.4.2 to 4.6 and found one problem with
>>>
>>> Exchange.INTERCEPTED_ENDPOINT = "CamelInterceptedEndpoint".
>>>
>>> Until Camel 4.4.2 this was set as a **message header**.
>>>
>>> With Camel 4.6 this is now an **exchange property**.
>>>
>>> I didn't find that information in any migration guide. Now we are afraid
>>> that there may be more changes that we didn't recognize.
>>> Is there any information about those changes?
>>>
>>> With kind regards
>>> Bert.
>>>
>>>
>>
>> --
>> 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: Message Header moved to Exchange property in 4.5 or 4.6?!

2024-05-24 Thread Claus Ibsen
Hi

Its
https://issues.apache.org/jira/browse/CAMEL-20381

On Fri, May 24, 2024 at 2:23 PM Claus Ibsen  wrote:

> Hi
>
> You are welcome to add this to the guide, (find out which version it was
> changed, so you can add it to the correct guide)
>
>
> On Fri, May 24, 2024 at 2:21 PM Speckels, Bert 
> wrote:
>
>> Hallo
>>
>> We upgraded from Camel 4.4.2 to 4.6 and found one problem with
>>
>> Exchange.INTERCEPTED_ENDPOINT = "CamelInterceptedEndpoint".
>>
>> Until Camel 4.4.2 this was set as a **message header**.
>>
>> With Camel 4.6 this is now an **exchange property**.
>>
>> I didn't find that information in any migration guide. Now we are afraid
>> that there may be more changes that we didn't recognize.
>> Is there any information about those changes?
>>
>> With kind regards
>> Bert.
>>
>>
>
> --
> 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: Message Header moved to Exchange property in 4.5 or 4.6?!

2024-05-24 Thread Claus Ibsen
Hi

You are welcome to add this to the guide, (find out which version it was
changed, so you can add it to the correct guide)


On Fri, May 24, 2024 at 2:21 PM Speckels, Bert 
wrote:

> Hallo
>
> We upgraded from Camel 4.4.2 to 4.6 and found one problem with
>
> Exchange.INTERCEPTED_ENDPOINT = "CamelInterceptedEndpoint".
>
> Until Camel 4.4.2 this was set as a **message header**.
>
> With Camel 4.6 this is now an **exchange property**.
>
> I didn't find that information in any migration guide. Now we are afraid
> that there may be more changes that we didn't recognize.
> Is there any information about those changes?
>
> With kind regards
> Bert.
>
>

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


Re: Graceful shutdown of the route

2024-05-23 Thread Claus Ibsen
Hi

Try with async=false

On Thu, May 23, 2024 at 11:00 AM Branko Husarik, Wood & Co.
 wrote:

> Hello,
>
> I have a question about the graceful shutdown of the route and its
> subsequent startup. I switched from force shutdown:
> context.getRouteController().stopRoute("routeId") to the shutdown by
> control bus:
> producerTemplate.sendBody("controlbus:route?routeId=routeId=stop=true").
> The main goal was to allow the route to finish processing the current
> exchange. It worked perfectly, but now I have some additional problems.
>
> 1) How can I start the route again with the same route ID immediately
> after (I am "restarting" the route every midnight with different
> parameters)?
> 2) Is there any way to wait until the control bus finishes its shutdown
> job?
>
> Maybe I am totally wrong with the control bus. Please Can you give me
> tips? Thank you
>
> Best Regards
>
> Branko Husarik
>
>
>
>
>
> 
> DISCLAIMER
> WOOD & Company Financial Services, a.s. and its branches are authorized
> and regulated by the CNB as Home State regulator and in Poland by the KNF,
> in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as
> Host State regulators. For further information about WOOD & Co., its
> investment services, financial instruments and associated risks, safeguard
> client assets (incl. compensation schemes) and contractual relationship
> please see our website at www.wood.com<http://www.wood.com/> under
> section Corporate Governance. Unless otherwise stated, this transmission is
> neither an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: Stopping a route while in retry (how to interrupt the retry?) ... worked great before migration to "camel spring rabbitmq"

2024-05-07 Thread Claus Ibsen
Hi

We can maybe also add on option to error handler to make this general
https://issues.apache.org/jira/browse/CAMEL-20744

On Tue, May 7, 2024 at 5:03 PM Claus Ibsen  wrote:

> Hi
>
> You can try adding retryWhile to your onException and check if the route
> status if its stopping, and then return false to break the retry sooner.
>
> On Tue, May 7, 2024 at 4:11 PM Speckels, Bert 
> wrote:
>
>> I have created a simple example project which demonstrates the
>> different behaviouts of "camel  rabbitmq" and "camel spring rabbitmq":
>>
>> https://github.com/Skrrytch/camel-and-rabbitmq-issue
>> This demonstrates both components so you can see the different behaviour.
>> See readme.md for details like code description, how to run and reproduce.
>>
>> ... and the corresponding Stack Overflow entry:
>>
>>
>> https://stackoverflow.com/questions/78443006/impossible-to-stop-a-route-with-inflight-messages-which-are-in-redelivery-when
>>
>> Maybe someone can help because we need a way to interrupt a redelivery
>> by stopping the route for maintenance as well as stop, remove the message
>> from queue and restart.
>>
>> With kind regards
>> Bert.
>> 
>> Von: Speckels, Bert 
>> Gesendet: Donnerstag, 18. April 2024 18:25
>> An: users@camel.apache.org 
>> Betreff: Stopping a route while in retry (how to interrupt the retry?)
>> ... worked great before migration to "camel spring rabbitmq"
>>
>> Hello everyone.
>>
>> I hope to get some useful information about our current problem. I'll
>> try to keep it brief and still provide enough information. Ask if any
>> more information is required.
>>
>> We migrated our camel routes which receive messages from RabbitMQ to
>> "camel spring rabbitmq" (since "camel rabbitmq" has been removed in
>> camel 4).
>>
>> First of all:
>> 3.2.4
>> 4.4.0
>> 17
>> (First we also tried with camel 3.22.1 and spring boot 2.7.18)
>>
>> Everything worked great after the migration, except for one special case:
>>
>> For maintenance we sometimes need to STOP the routes (e.g. via JMX): The
>> rabbitmq consumers should be stopped and inflight messages remain in
>> RabbitMQ, ready to be consumed again after maintenance.
>>
>> That worked like a charm with "camel rabbitmq component": Even
>> when there was a message in (Camel) RETRY for some minutes, that route
>> has been stopped
>> after the configured timeout of 5 seconds, the retry (Thread.sleep) has
>> been
>> interrupted and the message in RabbitMQ was ready to be consumed
>> again.
>>
>> But with "camel spring rabbitmq" the message in retry is no longer
>> interrupted: It continues to run despite the rabbit consumer being and the
>> consuming route has been stopped
>> (we can see that in Hawt.io)
>>
>> I attached two log outputs: The first one with "camel rabbitmq" (where
>> you can
>> see the interruption of Thread.sleep) and another one with "camel
>> spring rabbitmq": As you can see, camel is waiting for the inflight
>> message to finish but then forces the route to stop ... but the retry
>> thread is still running and tries to redeliver the message (we can see
>> the delivery failures while the consumer and route is stopped)
>>
>> Thanks for reading all this. I hope I made my point clear?!
>>
>> With kind regards
>> Bert
>>
>
>
> --
> 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: Stopping a route while in retry (how to interrupt the retry?) ... worked great before migration to "camel spring rabbitmq"

2024-05-07 Thread Claus Ibsen
Hi

You can try adding retryWhile to your onException and check if the route
status if its stopping, and then return false to break the retry sooner.

On Tue, May 7, 2024 at 4:11 PM Speckels, Bert 
wrote:

> I have created a simple example project which demonstrates the
> different behaviouts of "camel  rabbitmq" and "camel spring rabbitmq":
>
> https://github.com/Skrrytch/camel-and-rabbitmq-issue
> This demonstrates both components so you can see the different behaviour.
> See readme.md for details like code description, how to run and reproduce.
>
> ... and the corresponding Stack Overflow entry:
>
>
> https://stackoverflow.com/questions/78443006/impossible-to-stop-a-route-with-inflight-messages-which-are-in-redelivery-when
>
> Maybe someone can help because we need a way to interrupt a redelivery
> by stopping the route for maintenance as well as stop, remove the message
> from queue and restart.
>
> With kind regards
> Bert.
> 
> Von: Speckels, Bert 
> Gesendet: Donnerstag, 18. April 2024 18:25
> An: users@camel.apache.org 
> Betreff: Stopping a route while in retry (how to interrupt the retry?) ...
> worked great before migration to "camel spring rabbitmq"
>
> Hello everyone.
>
> I hope to get some useful information about our current problem. I'll
> try to keep it brief and still provide enough information. Ask if any
> more information is required.
>
> We migrated our camel routes which receive messages from RabbitMQ to
> "camel spring rabbitmq" (since "camel rabbitmq" has been removed in
> camel 4).
>
> First of all:
> 3.2.4
> 4.4.0
> 17
> (First we also tried with camel 3.22.1 and spring boot 2.7.18)
>
> Everything worked great after the migration, except for one special case:
>
> For maintenance we sometimes need to STOP the routes (e.g. via JMX): The
> rabbitmq consumers should be stopped and inflight messages remain in
> RabbitMQ, ready to be consumed again after maintenance.
>
> That worked like a charm with "camel rabbitmq component": Even
> when there was a message in (Camel) RETRY for some minutes, that route has
> been stopped
> after the configured timeout of 5 seconds, the retry (Thread.sleep) has
> been
> interrupted and the message in RabbitMQ was ready to be consumed
> again.
>
> But with "camel spring rabbitmq" the message in retry is no longer
> interrupted: It continues to run despite the rabbit consumer being and the
> consuming route has been stopped
> (we can see that in Hawt.io)
>
> I attached two log outputs: The first one with "camel rabbitmq" (where you
> can
> see the interruption of Thread.sleep) and another one with "camel
> spring rabbitmq": As you can see, camel is waiting for the inflight
> message to finish but then forces the route to stop ... but the retry
> thread is still running and tries to redeliver the message (we can see
> the delivery failures while the consumer and route is stopped)
>
> Thanks for reading all this. I hope I made my point clear?!
>
> With kind regards
> Bert
>


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


Re: Camel JMS component / Dynamic destination on consumer

2024-04-17 Thread Claus Ibsen
Hi

You can use {{ }} syntax that can refer to JVM sys properties also.

The toD example you have is using simple language and its not the same as
{{ }} but they can both use sys/env variables etc.


On Wed, Apr 17, 2024 at 4:36 PM Ephemeris Lappis 
wrote:

> Hello.
>
> I'm looking for some way to set a JMS consumer on a queue whose name
> depends on the context (in my real case, a system property).
>
> For a producer, the route (we use blueprint DSL) can be something like
> that :
>
> 
>
> But I don't see any way for the "from" uri...
>
> Any idea ?
>
> Thanks for your help.
>
> Regards.
>


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


Re: Camel 3.22 issues with route ID

2024-04-16 Thread Claus Ibsen
Hi

You can also use nodePrefixId to help make unique ids easier, which you can
set on routes

On Tue, Apr 16, 2024 at 9:49 AM Claus Ibsen  wrote:

> Hi
>
> This is correct as-is. You should not have duplicate ids, its your problem
> to fix that.
>
> On Tue, Apr 16, 2024 at 9:23 AM Michael Rambichler 
> wrote:
>
>> Hi,
>>
>>
>>
>> we recently switched from Camel 3.18 to Camel 3.22 and we discovered
>> following issue in some of our applications:
>>
>>
>>
>> We have several applications that use e.g. openapi generator to create
>> separate route builder classes, a minimal reproducible example is:
>>
>>
>>
>> @Component
>>
>> public final class RestRoute extends RouteBuilder {
>>
>> public void configure() {
>>
>> rest().get().id("myRoute1").to("log:foo");
>>
>> }
>>
>> }
>>
>>
>>
>> The id “myRoute1” is specified over the operationId in the open API spec.
>> Furthermore, we have following “main” route using the same route ID (not
>> on
>> purpose):
>>
>>
>>
>> @Component
>>
>> public class MainRoute extends RouteBuilder {
>>
>> public void configure() {
>>
>> from("direct:myRoute1").routeId("myRoute1").to("log:bar");
>>
>> }
>>
>> }
>>
>>
>>
>> The routeId in this route is typically set over config. Both routes use
>> the
>> same ID (which is not easy to detect in an application if REST route is
>> auto-generated and main route gets ID from config). In Camel 3.18, we did
>> not have a problem with that.
>>
>>
>>
>> However, in Camel 3.22, running a simple unit test shows a
>> non-deterministic behavior:
>>
>>
>>
>>1. If RestRoute is configured first, it gets the ID “myRoute1”
>> assigned.
>>Afterwards, MainRoute is configured, and detects that “myRoute1” is
>> already
>>used, and throws an Exception:
>>
>> FailedToStartRouteException: Failed to start route myRoute1 because of
>> duplicate id detected: myRoute1.
>>
>>
>>
>>2. If MainRoute is configured first, it gets the ID “myRoute1”
>> assigned.
>>Afterwards, RestRoute is configured, and detects that “myRoute1” is
>> already
>>used, and then assigns a new route ID to RestRoute (“route1”). No
>> problem
>>arises here.
>>
>>
>>
>> The problem is that the result varies from run to run. We had the
>> situation, that in local unit test and test pipeline, the tests were
>> running fine, but in the production deployment the test suddenly failed.
>>
>> Even worse is that the application startup would also fail if RestRoute is
>> configured first.
>>
>>
>>
>> Another problem in Camel 3.22 we discovered in our tests was that if
>> RestRoute uses .routeId() instead of .id(), e.g.
>> rest().get().routeId("myRoute1").to("log:foo"), then one of the two routes
>> will not start at all, without throwing an error.
>>
>> Here, the route that is configured first starts, and the other route won’t
>> start. In Camel 3.18, .routeId() is not available for rest routes at all,
>> so no problem there.
>>
>>
>>
>> So, it looks like the order of route configuration was deterministic in
>> Camel 3.18 (here, it seems the route configuration order depended on the
>> name of the class or the package the class is in).
>>
>> In Camel 3.22 it seems this is not deterministic anymore, leading to
>> above-described problems.
>>
>>
>>
>> Please let us know if this behavior is known and if I should create a
>> ticket for it.
>>
>>
>>
>> Thanks
>>
>
>
> --
> 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.22 issues with route ID

2024-04-16 Thread Claus Ibsen
Hi

This is correct as-is. You should not have duplicate ids, its your problem
to fix that.

On Tue, Apr 16, 2024 at 9:23 AM Michael Rambichler 
wrote:

> Hi,
>
>
>
> we recently switched from Camel 3.18 to Camel 3.22 and we discovered
> following issue in some of our applications:
>
>
>
> We have several applications that use e.g. openapi generator to create
> separate route builder classes, a minimal reproducible example is:
>
>
>
> @Component
>
> public final class RestRoute extends RouteBuilder {
>
> public void configure() {
>
> rest().get().id("myRoute1").to("log:foo");
>
> }
>
> }
>
>
>
> The id “myRoute1” is specified over the operationId in the open API spec.
> Furthermore, we have following “main” route using the same route ID (not on
> purpose):
>
>
>
> @Component
>
> public class MainRoute extends RouteBuilder {
>
> public void configure() {
>
> from("direct:myRoute1").routeId("myRoute1").to("log:bar");
>
> }
>
> }
>
>
>
> The routeId in this route is typically set over config. Both routes use the
> same ID (which is not easy to detect in an application if REST route is
> auto-generated and main route gets ID from config). In Camel 3.18, we did
> not have a problem with that.
>
>
>
> However, in Camel 3.22, running a simple unit test shows a
> non-deterministic behavior:
>
>
>
>1. If RestRoute is configured first, it gets the ID “myRoute1” assigned.
>Afterwards, MainRoute is configured, and detects that “myRoute1” is
> already
>used, and throws an Exception:
>
> FailedToStartRouteException: Failed to start route myRoute1 because of
> duplicate id detected: myRoute1.
>
>
>
>2. If MainRoute is configured first, it gets the ID “myRoute1” assigned.
>Afterwards, RestRoute is configured, and detects that “myRoute1” is
> already
>used, and then assigns a new route ID to RestRoute (“route1”). No
> problem
>arises here.
>
>
>
> The problem is that the result varies from run to run. We had the
> situation, that in local unit test and test pipeline, the tests were
> running fine, but in the production deployment the test suddenly failed.
>
> Even worse is that the application startup would also fail if RestRoute is
> configured first.
>
>
>
> Another problem in Camel 3.22 we discovered in our tests was that if
> RestRoute uses .routeId() instead of .id(), e.g.
> rest().get().routeId("myRoute1").to("log:foo"), then one of the two routes
> will not start at all, without throwing an error.
>
> Here, the route that is configured first starts, and the other route won’t
> start. In Camel 3.18, .routeId() is not available for rest routes at all,
> so no problem there.
>
>
>
> So, it looks like the order of route configuration was deterministic in
> Camel 3.18 (here, it seems the route configuration order depended on the
> name of the class or the package the class is in).
>
> In Camel 3.22 it seems this is not deterministic anymore, leading to
> above-described problems.
>
>
>
> Please let us know if this behavior is known and if I should create a
> ticket for it.
>
>
>
> Thanks
>


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


Re: [VOTE] Release Apache Camel Kamelets 4.5.0

2024-04-02 Thread Claus Ibsen
+1 (binding)

On Tue, Apr 2, 2024 at 7:47 AM Andrea Cosentino  wrote:

> Hello all,
>
> This is a vote for releasing camel-kamelets 4.5.0
>
> This is a release supporting Camel 4.5.0 and it's a development release.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/4.5.0
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1692
> Kamelets Tag:
> https://github.com/apache/camel-kamelets/releases/tag/v4.5.0
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 4.5.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: [ANNOUNCE] Apache Camel 4.5.0 Released

2024-03-28 Thread Claus Ibsen
Hi

Yeah it seems SB does not inject CamelContext eager on those route policy
factory and the metrics uses the camel context to get its name
https://issues.apache.org/jira/browse/CAMEL-20628


On Thu, Mar 28, 2024 at 3:04 PM Alphonse Bendt 
wrote:

> Hi folks,
>
> > Am 28.03.2024 um 12:43 schrieb Gregor Zurowski  >:
> >
> > The Camel PMC is pleased to announce the release of Apache Camel 4.5.0.
>
> just tried out to update one of our projects from 4.4.1 to 4.5.0
>
> (current SpringBoot version, using JUnit5 based tests)
>
> With the update a number of tests start to fail (stacktrace [1]). Are
> there any breaking changes we need to be aware of in the new version?
> didn’t see anything mentioned in the release notes.
>
>
> [1]
> org.apache.camel.FailedToCreateRouteException: Failed to create route XXX:
> Route(XXX)[From[direct:XXX] -> [DoTry[... because of Cannot invoke
> "org.apache.camel.CamelContext.getName()" because "camelContext" is null
> 24587 at
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:85)
> 24588 at
> org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
>
> 24589 at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:728)
>
> 24590 at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:594)
>
> 24591 at
> org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2391)
>
> 24592 at
> org.apache.camel.support.service.BaseService.init(BaseService.java:78)
> 24593 at
> org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2027)
>
> 24594 at
> org.apache.camel.support.service.BaseService.start(BaseService.java:105)
> 24595 at
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2046)
>
> 24596 at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:212)
>
> 24597 at
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:119)
>
> 24598 at
> org.apache.camel.test.spring.junit5.CamelAnnotationsHandler.lambda$handleCamelContextStartup$1(CamelAnnotationsHandler.java:403)
>
> 24599 at
> org.apache.camel.test.spring.junit5.CamelSpringTestHelper.doToSpringCamelContexts(CamelSpringTestHelper.java:108)
>
> 24600 at
> org.apache.camel.test.spring.junit5.CamelAnnotationsHandler.handleCamelContextStartup(CamelAnnotationsHandler.java:400)
>
> 24601 at
> org.apache.camel.test.spring.junit5.CamelSpringBootExecutionListener.beforeTestMethod(CamelSpringBootExecutionListener.java:105)
>
> 24602 at
> org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:320)
>
> 24603 at
> org.springframework.test.context.junit.jupiter.SpringExtension.beforeEach(SpringExtension.java:240)
>
> 24604 at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> 24605 at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> 24606Caused by: java.lang.NullPointerException: Cannot invoke
> "org.apache.camel.CamelContext.getName()" because "camelContext" is null
> 24607 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicyNamingStrategy.getExchangeStatusTags(MicrometerRoutePolicyNamingStrategy.java:112)
>
> 24608 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicy$MetricsStatistics.createCounter(MicrometerRoutePolicy.java:214)
>
> 24609 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicy$MetricsStatistics.initAdditionalCounters(MicrometerRoutePolicy.java:94)
>
> 24610 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicy$MetricsStatistics.(MicrometerRoutePolicy.java:88)
>
> 24611 at
> org.apache.camel.component.micrometer.routepolicy.ContextMetricsStatistics.(ContextMetricsStatistics.java:33)
>
> 24612 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicyFactory.createOrGetContextMetric(MicrometerRoutePolicyFactory.java:115)
>
> 24613 at
> org.apache.camel.component.micrometer.routepolicy.MicrometerRoutePolicy.onInit(MicrometerRoutePolicy.java:299)
>
> 24614 at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:352)
> 24615 at
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:79)
> 24616 ... 18 more



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


Re: in Camel+Spring Boot, how to dynamically update a property

2024-03-28 Thread Claus Ibsen
Hi

See also
https://camel.apache.org/manual/context-reload.html#_using_context_reloading


On Wed, Mar 27, 2024 at 10:00 PM Mitch Trachtenberg 
wrote:

> I have a Camel Spring Boot app whose application.properties file has the
> line:
> greeting=Hello.
>
> Sure enough, a route with body set to {{greeting}} has a body of "Hello".
>
> I'd like to handle a GET or POST to an endpoint by changing what is picked
> up by {{greeting}}.  Various AIs tell me to use something along these
> lines:
>
>  ((ConfigurableEnvironment)environment).getPropertySources()
>.addFirst(
>  new MapPropertySource(
>   "dynamicPropertySource",
>   Collections.singletonMap("greeting", "NEW")
>)
>  );
> contextRefresher.refresh()
>
> The environment and contextRefresher variables are autowired.  I use
> control bus commands to stop and start the route, and put the
> update/refresh in between.
>
> No change in the output of {{greeting}} occurs.  I'm using Camel 4.4.1 and
> Spring Boot 3.2.2.  I'm wondering, first of all, if what I'm showing should
> work, as far as better eyes than mine can tell.  And, if not, what is the
> correct way to update a route triggered from a timer so that properties can
> be altered from how they were initially pulled in from
> application.properties.
>
> Any suggestions gratefully accepted.
>
> Thanks,
> Mitch
>


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


Re: Camel Jbang 4.4.1 not available?

2024-03-24 Thread Claus Ibsen
gt;> Hi,
> > > >>
> > > >> I'm trying to install Camel Jbang 4.4.1 but the 4.4.0 always gets
> > > >> installed. --Force and --fresh parameters don't help.
> > > >>
> > > >> jbang app install --force --fresh camel@apache/camel
> > > >>
> > > >> I checked the CamelJBang.java and it still seems to refer to 4.4.0,
> is
> > > >> this
> > > >> something that needs to be changed on the source code side?
> > > >>
> > > >> I'm not actually that familiar with how the versioning with the
> Camel
> > > >> Jbang
> > > >> works. I assumed that the release of Camel 4.4.1 means that the
> Camel
> > > >> Jbang
> > > >> is also updated to the same version. But now I noticed that there's
> no
> > > >> 4.4.1 release for the docker image either, so I assume they have a
> > > >> different release cadence.
> > > >>
> > > >> Specifying the exact version when running a command works, for
> > example:
> > > >>
> > > >> jbang --fresh "-Dcamel.jbang.version=4.4.1" camel@apache/camel
> > > --version
> > > >>
> > > >> Best regards,
> > > >> Mikael
> > > >>
> > > >
> > > >
> > > > --
> > > > Tadayoshi Sato
> > > >
> > >
> > >
> > > --
> > > Tadayoshi Sato
> > >
> >
>


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


Re: Svar: Re: Issue with unit or work and toV endpoint when Excetion thrown

2024-03-23 Thread Claus Ibsen
Hi

Thanks for the sample project. This is the http response I see now after a
code-fix

~/workspace ❯ curl -i -X POST http://localhost:8080/test

 8s
HTTP/1.1 500
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sat, 23 Mar 2024 08:02:31 GMT
Connection: close

{
  "status" : 1000,
  "message" : "ERROR message = Unspecific Error(Error occurred)"
}%



On Sat, Mar 23, 2024 at 9:15 AM Claus Ibsen  wrote:

> Hi
>
> https://issues.apache.org/jira/browse/CAMEL-20607
>
> On Thu, Mar 21, 2024 at 1:03 PM Mikael Andersson Wigander
>  wrote:
>
>>
>> Hi
>>
>> As simple as I get do it…
>>
>> https://github.com/hakuseki/demo-Camel-UoW
>>
>>
>>
>> /M
>>
>>
>> On Thursday, March 21st, 2024 at 11:09, Claus Ibsen <
>> claus.ib...@gmail.com> wrote:
>>
>> > Hi
>> >
>> > Yeah if you keep it plain camel and not fancy spring boot stuff
>> >
>> > On Thu, Mar 21, 2024 at 11:06 AM Mikael Andersson Wigander
>> > mikael.andersson.wigan...@pm.me.invalid wrote:
>> >
>> > > Spring boot OK?
>> > >
>> > >
>> > > /M
>> > >
>> > > Den 21 mars 2024 kl 10:51, Claus Ibsen <[claus.ib...@gmail.com
>> ](mailto:Den
>> > > 21 mars 2024 kl 10:51, Claus Ibsen < skrev:
>> > >
>> > > > Hi
>> > > >
>> > > > Can you make something that is pure camel (not quarkus) that will
>> help
>> > > >
>> > > > On Thu, Mar 21, 2024 at 7:56 AM Mikael Andersson Wigander
>> > > > mikael.andersson.wigan...@pm.me.invalid wrote:
>> > > >
>> > > > > Here's a repo to use
>> > > > >
>> > > > > https://github.com/hakuseki/code-with-quarkus
>> > > > >
>> > > > > /M
>> > > > >
>> > > > > On Wednesday, March 20th, 2024 at 22:17, Claus Ibsen <
>> > > > > claus.ib...@gmail.com> wrote:
>> > > > >
>> > > > > > Hi
>> > > > > >
>> > > > > > Are you able to put together a smaller and simpler example with
>> just
>> > > > > > routes
>> > > > > > (no rest-dsl) that can let us quicker take a look and better
>> > > > > > understand
>> > > > > > what is happening?
>> > > > > >
>> > > > > > On Mon, Mar 18, 2024 at 10:04 AM Mikael Andersson Wigander
>> > > > > > mikael.andersson.wigan...@pm.me.invalid wrote:
>> > > > > >
>> > > > > > > Hi
>> > > > > > >
>> > > > > > > I have experienced a weird behavior in Camel 4.4.0 in Quarkus
>> where
>> > > > > > > the
>> > > > > > > Exception handling is not executing as expected when using a
>> toV().
>> > > > > > >
>> > > > > > > In my code sample below everything starts with a rest call.
>> > > > > > > If this rest call finish without errors then the original
>> message
>> > > > > > > should
>> > > > > > > be returned.
>> > > > > > > If an error is thrown, then an error message should be
>> returned.
>> > > > > > >
>> > > > > > > But if I call an endpoint using the .toV(), the error is
>> processed
>> > > > > > > as
>> > > > > > > expected BUT NOT returned. It seems like something is messing
>> with
>> > > > > > > the
>> > > > > > > unit
>> > > > > > > of work or whatever…
>> > > > > > >
>> > > > > > > from(direct("start"))
>> > > > > > > .setBody(constant(List.of("A", "B")))
>> > > > > > > .to(direct("line"));
>> > > > > > >
>> > > > > > > // .toV(direct("line").getUri(), "mySend", "myReceive");
>> > > > > > >
>> > > > > > > By commenting out the .to() and removing the comment on
>> .toV() the
>> > > > > > > problem
>> > > > > > > occurs.
>> > > > > > >
>> > > > > > > This is

Re: Svar: Re: Issue with unit or work and toV endpoint when Excetion thrown

2024-03-23 Thread Claus Ibsen
Hi

https://issues.apache.org/jira/browse/CAMEL-20607

On Thu, Mar 21, 2024 at 1:03 PM Mikael Andersson Wigander
 wrote:

>
> Hi
>
> As simple as I get do it…
>
> https://github.com/hakuseki/demo-Camel-UoW
>
>
>
> /M
>
>
> On Thursday, March 21st, 2024 at 11:09, Claus Ibsen 
> wrote:
>
> > Hi
> >
> > Yeah if you keep it plain camel and not fancy spring boot stuff
> >
> > On Thu, Mar 21, 2024 at 11:06 AM Mikael Andersson Wigander
> > mikael.andersson.wigan...@pm.me.invalid wrote:
> >
> > > Spring boot OK?
> > >
> > >
> > > /M
> > >
> > > Den 21 mars 2024 kl 10:51, Claus Ibsen <[claus.ib...@gmail.com
> ](mailto:Den
> > > 21 mars 2024 kl 10:51, Claus Ibsen < skrev:
> > >
> > > > Hi
> > > >
> > > > Can you make something that is pure camel (not quarkus) that will
> help
> > > >
> > > > On Thu, Mar 21, 2024 at 7:56 AM Mikael Andersson Wigander
> > > > mikael.andersson.wigan...@pm.me.invalid wrote:
> > > >
> > > > > Here's a repo to use
> > > > >
> > > > > https://github.com/hakuseki/code-with-quarkus
> > > > >
> > > > > /M
> > > > >
> > > > > On Wednesday, March 20th, 2024 at 22:17, Claus Ibsen <
> > > > > claus.ib...@gmail.com> wrote:
> > > > >
> > > > > > Hi
> > > > > >
> > > > > > Are you able to put together a smaller and simpler example with
> just
> > > > > > routes
> > > > > > (no rest-dsl) that can let us quicker take a look and better
> > > > > > understand
> > > > > > what is happening?
> > > > > >
> > > > > > On Mon, Mar 18, 2024 at 10:04 AM Mikael Andersson Wigander
> > > > > > mikael.andersson.wigan...@pm.me.invalid wrote:
> > > > > >
> > > > > > > Hi
> > > > > > >
> > > > > > > I have experienced a weird behavior in Camel 4.4.0 in Quarkus
> where
> > > > > > > the
> > > > > > > Exception handling is not executing as expected when using a
> toV().
> > > > > > >
> > > > > > > In my code sample below everything starts with a rest call.
> > > > > > > If this rest call finish without errors then the original
> message
> > > > > > > should
> > > > > > > be returned.
> > > > > > > If an error is thrown, then an error message should be
> returned.
> > > > > > >
> > > > > > > But if I call an endpoint using the .toV(), the error is
> processed
> > > > > > > as
> > > > > > > expected BUT NOT returned. It seems like something is messing
> with
> > > > > > > the
> > > > > > > unit
> > > > > > > of work or whatever…
> > > > > > >
> > > > > > > from(direct("start"))
> > > > > > > .setBody(constant(List.of("A", "B")))
> > > > > > > .to(direct("line"));
> > > > > > >
> > > > > > > // .toV(direct("line").getUri(), "mySend", "myReceive");
> > > > > > >
> > > > > > > By commenting out the .to() and removing the comment on .toV()
> the
> > > > > > > problem
> > > > > > > occurs.
> > > > > > >
> > > > > > > This is a simulation so the incoming rest post payload is NOT
> > > > > > > returned
> > > > > > > (just POST a JSON), however the body of the "start" endpoint
> should
> > > > > > > be
> > > > > > > returned if everything work, but an error message should be
> returned
> > > > > > > if an
> > > > > > > error is thrown.
> > > > > > > This is not happening if the .toV() is used. Then the body of
> the
> > > > > > > "start"
> > > > > > > endpoint is returned.
> > > > > > >
> > > > > > > Might this be a bug or have I messed something up?
> > > > > > >
> > > > > > > I really like the Variables now, to send 

Re: [VOTE] Release Apache Camel Kamelets 4.4.1

2024-03-22 Thread Claus Ibsen
+1 (binding)

On Fri, Mar 22, 2024 at 7:05 AM Andrea Cosentino  wrote:

> Hello all,
>
> This is a vote for releasing camel-kamelets 4.4.1
>
> This is the second release of camel-kamelets supporting LTS Camel 4.4.x and
> it contains alignment to 4.4.1 and some fixes.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/4.4.1
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1687
> Kamelets Tag:
> https://github.com/apache/camel-kamelets/releases/tag/v4.4.1
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 4.4.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: Svar: Re: Issue with unit or work and toV endpoint when Excetion thrown

2024-03-21 Thread Claus Ibsen
Hi

Yeah if you keep it plain camel and not fancy spring boot stuff

On Thu, Mar 21, 2024 at 11:06 AM Mikael Andersson Wigander
 wrote:

> Spring boot OK?
>
> /M
>
> Den 21 mars 2024 kl 10:51, Claus Ibsen <[claus.ib...@gmail.com](mailto:Den
> 21 mars 2024 kl 10:51, Claus Ibsen < skrev:
>
> > Hi
> >
> > Can you make something that is pure camel (not quarkus) that will help
> >
> > On Thu, Mar 21, 2024 at 7:56 AM Mikael Andersson Wigander
> >  wrote:
> >
> >> Here's a repo to use
> >>
> >> https://github.com/hakuseki/code-with-quarkus
> >>
> >>
> >>
> >>
> >> /M
> >>
> >>
> >> On Wednesday, March 20th, 2024 at 22:17, Claus Ibsen <
> >> claus.ib...@gmail.com> wrote:
> >>
> >> > Hi
> >> >
> >> > Are you able to put together a smaller and simpler example with just
> >> routes
> >> > (no rest-dsl) that can let us quicker take a look and better
> understand
> >> > what is happening?
> >> >
> >> >
> >> > On Mon, Mar 18, 2024 at 10:04 AM Mikael Andersson Wigander
> >> > mikael.andersson.wigan...@pm.me.invalid wrote:
> >> >
> >> > > Hi
> >> > >
> >> > > I have experienced a weird behavior in Camel 4.4.0 in Quarkus where
> the
> >> > > Exception handling is not executing as expected when using a toV().
> >> > >
> >> > > In my code sample below everything starts with a rest call.
> >> > > If this rest call finish without errors then the original message
> >> should
> >> > > be returned.
> >> > > If an error is thrown, then an error message should be returned.
> >> > >
> >> > > But if I call an endpoint using the .toV(), the error is processed
> as
> >> > > expected BUT NOT returned. It seems like something is messing with
> the
> >> unit
> >> > > of work or whatever…
> >> > >
> >> > > from(direct("start"))
> >> > > .setBody(constant(List.of("A", "B")))
> >> > > .to(direct("line"));
> >> > >
> >> > > // .toV(direct("line").getUri(), "mySend", "myReceive");
> >> > >
> >> > > By commenting out the .to() and removing the comment on .toV() the
> >> problem
> >> > > occurs.
> >> > >
> >> > > This is a simulation so the incoming rest post payload is NOT
> returned
> >> > > (just POST a JSON), however the body of the "start" endpoint should
> be
> >> > > returned if everything work, but an error message should be returned
> >> if an
> >> > > error is thrown.
> >> > > This is not happening if the .toV() is used. Then the body of the
> >> "start"
> >> > > endpoint is returned.
> >> > >
> >> > > Might this be a bug or have I messed something up?
> >> > >
> >> > > I really like the Variables now, to send to an endpoint and be
> certain
> >> the
> >> > > original body is untouched without the hazzle of storing/restoring
> >> logic…
> >> > >
> >> > >
> >> > > /M
> >> > >
> >> > > *public class *TestRouter *extends *EndpointRouteBuilder {
> >> > > @Override
> >> > > *public void *configure() *throws Exception {
> >> > > onException(IllegalAccessException.class)
> >> > > .routeId("Exceptions")
> >> > > .maximumRedeliveries(0)
> >> > > .handled(true)
> >> > > .removeHeaders("")
> >> > > .process(*new *JsonResponseProcessor())
> >> > > .to(log("Exceptions").level("WARN")
> >> > > .showBody(false)
> >> > > .showBodyType(false)
> >> > > .showHeaders(true)
> >> > > .multiline(true))
> >> > > .to(direct("reply"));
> >> > >
> >> > > restConfiguration()
> >> > > .bindingMode(RestBindingMode.json)
> >> > > .dataFormatProperty("prettyPrint", "true")
> >> > > .component("servlet")
> >> > > .apiProperty("cors", "true");
> >> > >
> >> > > rest().post("/t

Re: Issue with unit or work and toV endpoint when Excetion thrown

2024-03-21 Thread Claus Ibsen
Hi


Can you make something that is pure camel (not quarkus) that will help

On Thu, Mar 21, 2024 at 7:56 AM Mikael Andersson Wigander
 wrote:

> Here's a repo to use
>
> https://github.com/hakuseki/code-with-quarkus
>
>
>
>
> /M
>
>
> On Wednesday, March 20th, 2024 at 22:17, Claus Ibsen <
> claus.ib...@gmail.com> wrote:
>
> > Hi
> >
> > Are you able to put together a smaller and simpler example with just
> routes
> > (no rest-dsl) that can let us quicker take a look and better understand
> > what is happening?
> >
> >
> > On Mon, Mar 18, 2024 at 10:04 AM Mikael Andersson Wigander
> > mikael.andersson.wigan...@pm.me.invalid wrote:
> >
> > > Hi
> > >
> > > I have experienced a weird behavior in Camel 4.4.0 in Quarkus where the
> > > Exception handling is not executing as expected when using a toV().
> > >
> > > In my code sample below everything starts with a rest call.
> > > If this rest call finish without errors then the original message
> should
> > > be returned.
> > > If an error is thrown, then an error message should be returned.
> > >
> > > But if I call an endpoint using the .toV(), the error is processed as
> > > expected BUT NOT returned. It seems like something is messing with the
> unit
> > > of work or whatever…
> > >
> > > from(direct("start"))
> > > .setBody(constant(List.of("A", "B")))
> > > .to(direct("line"));
> > >
> > > // .toV(direct("line").getUri(), "mySend", "myReceive");
> > >
> > > By commenting out the .to() and removing the comment on .toV() the
> problem
> > > occurs.
> > >
> > > This is a simulation so the incoming rest post payload is NOT returned
> > > (just POST a JSON), however the body of the "start" endpoint should be
> > > returned if everything work, but an error message should be returned
> if an
> > > error is thrown.
> > > This is not happening if the .toV() is used. Then the body of the
> "start"
> > > endpoint is returned.
> > >
> > > Might this be a bug or have I messed something up?
> > >
> > > I really like the Variables now, to send to an endpoint and be certain
> the
> > > original body is untouched without the hazzle of storing/restoring
> logic…
> > >
> > >
> > > /M
> > >
> > > *public class *TestRouter *extends *EndpointRouteBuilder {
> > > @Override
> > > *public void *configure() *throws Exception {
> > > onException(IllegalAccessException.class)
> > > .routeId("Exceptions")
> > > .maximumRedeliveries(0)
> > > .handled(true)
> > > .removeHeaders("")
> > > .process(*new *JsonResponseProcessor())
> > > .to(log("Exceptions").level("WARN")
> > > .showBody(false)
> > > .showBodyType(false)
> > > .showHeaders(true)
> > > .multiline(true))
> > > .to(direct("reply"));
> > >
> > > restConfiguration()
> > > .bindingMode(RestBindingMode.json)
> > > .dataFormatProperty("prettyPrint", "true")
> > > .component("servlet")
> > > .apiProperty("cors", "true");
> > >
> > > rest().post("/test")
> > > .id("REST-workOrder-POST")
> > > .consumes("application/json")
> > > .produces("application/json")
> > > .outType(ResponseMessage.class)
> > > .to(direct("start").getUri());
> > >
> > > from(direct("start"))
> > > .setBody(constant(List.of("A", "B")))
> > > .to(direct("line"));
> > >
> > > *// .toV(direct("line").getUri(), "mySend", "myReceive");
> > > *from("direct:line")
> > > .to("log:line")
> > > .process(*new *MyProcessor())
> > > .to("mock:line");
> > >
> > > from(direct("reply"))
> > > .routeId("createResponse")
> > > .description("Creates a unified response")
> > > .to(log("DIRECT_REPLY").showBody(true)
> > > .showVariables(true)
> > > .showBodyType(true)
> > > .showHeaders(true)
> > > .multiline(true))
> > > .end();
> > > }
> > >
> > > *private class *MyProcessor *impleme

Re: Issue with unit or work and toV endpoint when Excetion thrown

2024-03-20 Thread Claus Ibsen
 *new *ResponseMessage();
>
> *final **Message *in = exchange.getIn();
> *if *(cause != *null*) {
> String responseCode = in.getHeader(*Exchange*.
> *HTTP_RESPONSE_CODE*, String.*class*);
>
> String reason = "Unspecific Error";
> String errorString = cause.getMessage();
> String statusCode = "1000";
>
> in.setHeader(*Exchange*.*HTTP_RESPONSE_CODE*,
> HttpResponseStatus.*INTERNAL_SERVER_ERROR*);
> message.setError(NumberUtils.*toInt*(statusCode, 1000),
>  String.*format*("ERROR message = %s(%s)",
> reason, errorString));
>
> }
> in.setBody(message);
> }
> }
> }
>
>
>
> --
>
> Capgemini is a trading name used by the Capgemini Group of companies which
> includes Capgemini Sverige AB, a company registered in Sweden (number
> 556092-3053) whose registered office is at FLEMINGGATAN 18 BOX 12054 S-102
> 22 Stockholm, Sweden.
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute,
> or use this message or any part thereof. If you receive this message in
> error, please notify the sender immediately and delete all copies of this
> message.
>
>
>

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


Re: How to get headers within Variables returning?

2024-03-14 Thread Claus Ibsen
See the docs
https://camel.apache.org/manual/variables.html

And then you can debug what happens also, for example with camel jbang
debug that shows all the details

On Thu, Mar 14, 2024 at 11:30 AM Mikael Andersson Wigander
 wrote:

> Hi
>
> I’m using the new 4.4 feature with Variables and having issues with
> headers created within the variables.
>
> I use this feature for getting an access_token and I store it as a header
> in the call to be used later.
>
> How can I retrieve it in subsequent executions returning from my toV()
> call when the value valueReceiving is set?
>
> Since using the valueReceive the headers created within the call is moved
> to a headers map within the variableRepository.
>
> /M



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


Re: Camel AWS-S3 prefixes do not accept wildcards

2024-03-13 Thread Claus Ibsen
Hi

Camel uses the AWS Java SDK and it set the prefix on this SDK so its
depends on if this SDK has any kind of support for wildcards.
As you write its likely it does not have that.

You can try to dive into the AWS SDK and see more deeper.

On Wed, Mar 13, 2024 at 7:19 PM Mitch Trachtenberg  wrote:

> I cannot specifically find this stated in either AWS S3 or Camel
> documentation, but it appears that I can give a prefix 1234- to restrict
> Camel's (4.3.0) downloads to files starting 1234-, but cannot give a prefix
> - to restrict Camel's downloads to files beginning with four characters
> and a hyphen.
>
> I believe AWS CLI does provide a way to do this.  If I'm correct, it would
> be helpful if this could be added to the documentation.
>
> If someone were to want to instruct me in where/how to do that, I'd be
> happy to generate a pull request, but it might be easier to just add:
> "Note: due to AWS S3 limitations, the prefix parameter does not work with
> wildcards."
>
> It would be even more helpful, of course, if the component were modified in
> some way to allow for wildcards.
>


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


Re: Error executing reactive work due to Java heap space. This exception is ignored.

2024-03-13 Thread Claus Ibsen
Hi

Okay as its a very serious error then its not caught by Camel.

>From the javadoc you can read

An Error is a subclass of Throwable that indicates serious problems that a
reasonable application should not try to catch. Most such errors are
abnormal conditions. The ThreadDeath error, though a "normal" condition, is
also a subclass of Error because most applications should not try to catch
it.



On Wed, Mar 13, 2024 at 11:10 AM MÜLLER Christian (ICS460-BAI)
 wrote:

> Hi,
>
> thanks for the repsonse!
>
> Camel 3.22.0
> the thrown exception class is:
> java.lang.OutOfMemoryError: Java heap space
>
> Regards Christian
>
> Am 13.03.24, 10:16 schrieb "Claus Ibsen" :
>
> What Camel version, and can you tell the exact exception class that was
> throw
>
> On Tue, Mar 12, 2024 at 2:17 PM MÜLLER Christian (ICS460-BAI)
>  wrote:
>
> Hello,
>
> we are currently trying to understand the behaviour of camel if a thread
> “crashes” due to heap space.
>
> We observe the following error message in our logs:
> Error executing reactive work due to Java heap space. This exception is
> ignored.
> Camel (camel-1) thread #11 -
> sql://select%20*%20from%20LVS_REP.EXC_XMLFROMCOS%20where%20STATUS='25'%20and%20EXC_MSGTYPE%20like%20'LOAD00%25'%20and%20EXC_XML100%20in%20('AT0100','AT0730')
> After this error the route goes silent and no further “selects” are
> executed.
> We understand that this is intentional in order to protect other routes…
> but for us this behaviour is a serious problem as we are unable to alarm
> that there is an issue with the route.
>
> Is there any way to force camel not to ignore this exception and “rethrow”
> it?
>
> Thanks in Advance!
> Regards Christian
>
>
> [cid:ii_18e3718573ea4b0cb8a1]<https://www.spar-ics.com/>
>
> DI Christian Müller
> Software Engineer
> Business Automation & Integration
>
> Mobile:
> +43 664 88748100
> E-Mail:
> christian.muel...@spar-ics.com<mailto:christian.muel...@spar-ics.com>
>
> SPAR Business Services GmbH
> Information & Communication Services
> Europastrasse 3, 5015 Salzburg, Austria
>
> [cid:ii_18e3718573e81c1b3703]
>
> Sollten Sie diese E-Mail unbeabsichtigt bzw. irrtümlich erhalten haben, so
> weisen wir Sie darauf hin, dass gemäß § 161 Abs 4 TKG 2021 der Inhalt sowie
> die Tatsache des Empfangs dieser E-Mail weder aufgezeichnet noch verwertet
> oder Unbefugten mitgeteilt werden dürfen. Wir ersuchen Sie, die Nachricht
> von Ihrem System zu löschen und sich mit uns in Verbindung zu setzen.
> Unter diesem Link finden Sie die Informationen über die Verarbeitung Ihrer
> personenbezogenen Daten sowie zu Ihren Rechten als betroffene Person:
> https://www.spar.at/service/datenschutzhinweise
>
> If you have received this email accidentally or in error, we point out
> that, in accordance with § 161 para. 4 TKG 2021 (Telecommunications Act),
> the contents of this email and the fact of its receipt must not be
> recorded, exploited or communicated to unauthorized persons. We ask you to
> delete the message from your system and to contact us.
> Under this link you will find information about the processing of your
> personal data and about your rights as a data subject
> https://www.spar.at/service/datenschutzhinweise
>
>
>
>
> --
> 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: Error executing reactive work due to Java heap space. This exception is ignored.

2024-03-13 Thread Claus Ibsen
What Camel version, and can you tell the exact exception class that was
throw

On Tue, Mar 12, 2024 at 2:17 PM MÜLLER Christian (ICS460-BAI)
 wrote:

> Hello,
>
> we are currently trying to understand the behaviour of camel if a thread
> “crashes” due to heap space.
>
> We observe the following error message in our logs:
>
> *Error executing reactive work due to Java heap space. This exception is
> ignored. Camel (camel-1) thread #11 -
> sql://select%20*%20from%20LVS_REP.EXC_XMLFROMCOS%20where%20STATUS='25'%20and%20EXC_MSGTYPE%20like%20'LOAD00%25'%20and%20EXC_XML100%20in%20('AT0100','AT0730')*
>
> After this error the route goes silent and no further “selects” are
> executed.
> We understand that this is intentional in order to protect other routes…
> but for us this behaviour is a serious problem as we are unable to alarm
> that there is an issue with the route.
>
> Is there any way to force camel not to ignore this exception and “rethrow”
> it?
>
> Thanks in Advance!
> Regards Christian
>
>
> <https://www.spar-ics.com/>
>
> DI Christian Müller
> Software Engineer
> Business Automation & Integration
> *Mobile:* +43 664 88748100
> *E-Mail:* christian.muel...@spar-ics.com
>
> *SPAR Business Services GmbH*Information & Communication Services
> Europastrasse 3, 5015 Salzburg, Austria
>
>
> Sollten Sie diese E-Mail unbeabsichtigt bzw. irrtümlich erhalten haben, so
> weisen wir Sie darauf hin, dass gemäß § 161 Abs 4 TKG 2021 der Inhalt sowie
> die Tatsache des Empfangs dieser E-Mail weder aufgezeichnet noch verwertet
> oder Unbefugten mitgeteilt werden dürfen. Wir ersuchen Sie, die Nachricht
> von Ihrem System zu löschen und sich mit uns in Verbindung zu setzen.
> Unter diesem Link finden Sie die Informationen über die Verarbeitung Ihrer
> personenbezogenen Daten sowie zu Ihren Rechten als betroffene Person:
> https://www.spar.at/service/datenschutzhinweise
>
> If you have received this email accidentally or in error, we point out
> that, in accordance with § 161 para. 4 TKG 2021 (Telecommunications Act),
> the contents of this email and the fact of its receipt must not be
> recorded, exploited or communicated to unauthorized persons. We ask you to
> delete the message from your system and to contact us.
> Under this link you will find information about the processing of your
> personal data and about your rights as a data subject
> https://www.spar.at/service/datenschutzhinweise
>
>
>


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


Re: Camel JMS & transaction : redelivery conditions ignored

2024-03-11 Thread Claus Ibsen
Hi

You need to set this on the broker side, it's the one that does the
redelivery.
Every broker has their own settings for DLQ and redelivery.

On Mon, Mar 11, 2024 at 2:20 PM Ephemeris Lappis 
wrote:

> Hello.
>
> It seems that the JMS consumer ignores the redelivery conditions that
> I set on my route :
>
> 
>  uri="jms:fifi1?connectionFactory=#aliceJMStransacted=true" />
> 
> 
> java.lang.Exception
> 
> 
> 
> 
> 
> 
> ${body} == 'BAD'
> 
> 
> 0 / 0
> 
> 
> 
> 
> 
>
> In fact, the message is not rolled back but delivered 7 times. I'd
> like the rollback put the message to a DLQ queue at the first
> execution.
>
> I've tried with/without "transacted" option or/and statement, and
> with/without "rollback" but it doesn't change anything...
>
> I also switched between "disableRedelivery" and "maximumRedeliveries"
> : no difference.
>
> I've probably misunderstood how it works :( !
>
> Any experts for help ?
>
> Thanks in advance.
>
> Regards.
>


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


Re: Camel-Kafka parameters sanitization

2024-03-11 Thread Claus Ibsen
Hi

I created a ticket
https://issues.apache.org/jira/browse/CAMEL-20549

On Mon, Mar 11, 2024 at 1:20 PM Claus Ibsen  wrote:

> Hi
>
>
> Thanks for reporting. You are welcome to create a JIRA so we can fix this
> little bug.
> We need to make Camel pass in that value as upper case so it can match the
> PEM equals
>
>
>
> On Mon, Mar 11, 2024 at 12:13 PM Modanese, Riccardo
>  wrote:
>
>> Hi guys,
>>
>> I have a question about Kafka routes and security.
>> I’m worried about injection (like what can be done in sql or http I mean)
>> through “url options” parameters value (especially for those enclosed
>> between RAW() such as truststore/keystore password or jaas config).
>>
>> Is my concern valid or is completely without any fundament or  there is
>> anyway a check and sanitization done by Camel (I saw while debugging that
>> Camel-Kafka endpoint parses the parameters to create an option object to
>> pass down to the Kafka-client so I’m wondering if this parsing will
>> sanitize values also).
>>
>> Thanks!
>>
>> P.S. I think I discovered a possible issue while trying to set truststore
>> in PEM format.
>> I’m using Camel 3.21 (Kafka-client is 3.4.1).
>> I generated keys and certificates in PEM format and they worked fine if
>> used to setup a Kafka-client (same version imported by Camel-Kafka endpoint)
>> Since wasn’t working from the route I debugged the route startup and I
>> discovered that, even if the truststoreType was set as PEM (uppercase) the
>> value that come to the lower level (the Kakfa-client ssl initialization I
>> mean) was lowercase (pem) and then failed to match this check
>> (DefaultSslEngineFactory):
>>
>>
>> private static SecurityStore createTruststore(String type, String path,
>> Password password, Password trustStoreCerts) {
>>
>> if (trustStoreCerts != null) {
>>
>> if (!PEM_TYPE.equals(type))
>>
>> throw new InvalidConfigurationException("SSL trust store
>> certs can be specified only for PEM, but trust store type is " + type +
>> ".");
>>
>> else if (path != null)
>>
>> throw new InvalidConfigurationException("Both SSL trust
>> store location and separate trust certificates are specified.");
>>
>> else if (password != null)
>>
>> throw new InvalidConfigurationException("SSL trust store
>> password cannot be specified for PEM format.");
>>
>> else
>>
>> return new PemStore(trustStoreCerts);
>>
>> } else if (PEM_TYPE.equals(type) && path != null) {
>>
>> if (password != null)
>>
>> throw new InvalidConfigurationException("SSL trust store
>> password cannot be specified for PEM format.");
>>
>> else
>>
>> return new FileBasedPemStore(path, null, false);
>>
>> } else if (path == null && password != null) {
>>
>> throw new InvalidConfigurationException("SSL trust store is
>> not specified, but trust store password is specified.");
>>
>> } else if (path != null) {
>>
>> return new FileBasedStore(type, path, password, null, false);
>>
>> } else
>>
>> return null;
>>
>> }
>>
>>
>> As result the truststore was not set and my Kafka-client wasn’t able to
>> connect to the Kafka server.
>> I tried to change the at debug time, on the fly while entering this
>> method, the type from “pem” to “PEM” and it worked fine.
>>
>> Am doing something wrong?
>>
>>
>> Regards,
>> Riccardo Modanese
>>
>
>
> --
> 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-Kafka parameters sanitization

2024-03-11 Thread Claus Ibsen
Hi


Thanks for reporting. You are welcome to create a JIRA so we can fix this
little bug.
We need to make Camel pass in that value as upper case so it can match the
PEM equals



On Mon, Mar 11, 2024 at 12:13 PM Modanese, Riccardo
 wrote:

> Hi guys,
>
> I have a question about Kafka routes and security.
> I’m worried about injection (like what can be done in sql or http I mean)
> through “url options” parameters value (especially for those enclosed
> between RAW() such as truststore/keystore password or jaas config).
>
> Is my concern valid or is completely without any fundament or  there is
> anyway a check and sanitization done by Camel (I saw while debugging that
> Camel-Kafka endpoint parses the parameters to create an option object to
> pass down to the Kafka-client so I’m wondering if this parsing will
> sanitize values also).
>
> Thanks!
>
> P.S. I think I discovered a possible issue while trying to set truststore
> in PEM format.
> I’m using Camel 3.21 (Kafka-client is 3.4.1).
> I generated keys and certificates in PEM format and they worked fine if
> used to setup a Kafka-client (same version imported by Camel-Kafka endpoint)
> Since wasn’t working from the route I debugged the route startup and I
> discovered that, even if the truststoreType was set as PEM (uppercase) the
> value that come to the lower level (the Kakfa-client ssl initialization I
> mean) was lowercase (pem) and then failed to match this check
> (DefaultSslEngineFactory):
>
>
> private static SecurityStore createTruststore(String type, String path,
> Password password, Password trustStoreCerts) {
>
> if (trustStoreCerts != null) {
>
> if (!PEM_TYPE.equals(type))
>
> throw new InvalidConfigurationException("SSL trust store
> certs can be specified only for PEM, but trust store type is " + type +
> ".");
>
> else if (path != null)
>
> throw new InvalidConfigurationException("Both SSL trust
> store location and separate trust certificates are specified.");
>
> else if (password != null)
>
> throw new InvalidConfigurationException("SSL trust store
> password cannot be specified for PEM format.");
>
> else
>
> return new PemStore(trustStoreCerts);
>
> } else if (PEM_TYPE.equals(type) && path != null) {
>
> if (password != null)
>
> throw new InvalidConfigurationException("SSL trust store
> password cannot be specified for PEM format.");
>
> else
>
> return new FileBasedPemStore(path, null, false);
>
> } else if (path == null && password != null) {
>
> throw new InvalidConfigurationException("SSL trust store is
> not specified, but trust store password is specified.");
>
> } else if (path != null) {
>
> return new FileBasedStore(type, path, password, null, false);
>
> } else
>
> return null;
>
> }
>
>
> As result the truststore was not set and my Kafka-client wasn’t able to
> connect to the Kafka server.
> I tried to change the at debug time, on the fly while entering this
> method, the type from “pem” to “PEM” and it worked fine.
>
> Am doing something wrong?
>
>
> Regards,
> Riccardo Modanese
>


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


Re: JMS InOut consumer question

2024-03-08 Thread Claus Ibsen
Hi

No this is by-design and how this works. The consumer is active listening
for messages, as it can handle higher load and concurrent requests.


On Fri, Mar 8, 2024 at 10:48 AM Bálint Baráth 
wrote:

> Hello!
>
> I ran into a weird behaviour, that is not mentioned in any of the docs I
> found, and I don't know if this is the expected way it works.
>
> When I create a JMS request-reply with a shared replyTo queue, camel
> correctly creates a reply consumer with the JMSCorrelationID, and it
> successfully reads the response.
>
> However after this, even when there is no new request it leaves an active
> consumer on the reply queue, with the selector
> "JMSCorrelationID='CamelDummyJmsMessageSelector.'"
> When there is a new request this changes into a normal correlationID, but
> after the response the dummy selector returns.
>
> Is this supposed to happen, and if it is, is there a way to turn it off?
>
> I even tried to implement my own MessageListenerContainerFactor, but that
> proved to be too difficult for now.
>
> I tried with camel 4.0.4, 4.4.0, and 3.22.1, with springboot 3.2.3 and with
> springboot 2, so I tried with jakarta and javax and it's the same.
>
> I'm using tibco jms, and sending to a tibco ems queue.
>
> Route code snippet, this is all that is needed to reproduce. Configuration
> is from springboot application properties.
>
> from("direct:started")
> .setHeader("JMSReplyTo", constant("Q.replyqueuename"))
> .to("jms:queue:" + "Q.inputqueuename" + "?replyTo="+
> "Q.replyqueuename"
> +"=InOut");
>
> Thanks for the reply in advance.
> Best regards,
>
> Bálint
>


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


Re: Netty TCP Producer- unable to get byte array from response

2024-03-07 Thread Claus Ibsen
ication() {
> }
>
> public static void main(String[] args) throws Exception {
> Main main = new Main(MyApplication.class);
> Thread sendThread = new Thread(new Runnable() {
> @Override
> public void run() {
> try {
> Thread.sleep(2000);
>
> System.out.println("Sending");
> ProducerTemplate pdt = main.getCamelTemplate();
>
> Path path = Paths.get("isoAuthReq");
> byte[] data = Files.readAllBytes(path);
>
> ByteBuf bufReq = Unpooled.wrappedBuffer(data);
> ByteBuf bufRes = (ByteBuf)
> pdt.requestBody("netty:tcp://x.x.x.x:49002?decoders=#epdecoder=#epencoder=false=true=true=true=true=8000",
> bufReq);
>
> int lenght = bufRes.readableBytes();
> System.out.println("lenght " + lenght);
> byte[] bytes = new byte[lenght];
> bufRes.readBytes(bytes);
> System.out.println("Result " + bytes);
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> });
> sendThread.start();
> main.run(args);
>
> System.out.println("Done");
> }
>
> }
>
> Here is my encoder / decoder:
>
> @BindToRegistry
> public LengthFieldPrepender epencoder() {
> // this will create an instance of this bean with the name of the
> method (eg epencoder)
> return new LengthFieldPrepender(2);
> }
>
> @BindToRegistry
> public ChannelHandlerFactory epdecoder() {
> // this will create an instance of this bean with the name of the
> method (eg epdecoder)
> return
> ChannelHandlerFactories.newLengthFieldBasedFrameDecoder(4096, 0, 2, 0, 2);
> }
>
>
>
>
>
>
>
> [__tpx__]
>


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


Re: Any way to have "Named/Keyed Endpoints" in YAML / Karavan?

2024-03-06 Thread Claus Ibsen
Hi

Yeah there is maybe an use-case for being able to configure a group of
parameters, and then refer to this anywhere in yaml-dsl / karavan where you
use parameters.
And maybe having those in some external fragmented files, so they don't
clutter up in application.properties.



On Sat, Mar 2, 2024 at 9:18 AM Mikael Koskinen  wrote:

> Hi,
>
> Thank you for the tip, this seems like a good alternative.
>
> The issue that comes to mind is that we have integrations where we are
> transferring issues between multiple Jira instances and directly
> configuring the components gives issues in these cases.
>
> In the best case scenario we hope we could provide properties like:
>
> ourJira.username = test
> ourJira.password = 123456
> ourJira.jiraUrl = https://our.atlassian.com/jira
> <https://comp.atlassian.com/jira>
> theirJira.username = test
> theirJira.password = 123456
> theirJira.jiraUrl = https://our.atlassian.com/jira
> <https://comp.atlassian.com/jira>
>
> And then in the route somehow "auto apply" all these properties into an
> endpoint without having to set them one by one. Maybe the ID could be used
> in this auto mapping? So something like:
>
> - route:
> from:
>   uri: jira
>   id: ourJira-123
>   parameters:
> type: NEWISSUES
>   steps:
> - to:
> uri: jira
> id: theirJira-93838
>
>
>
> to 29. helmik. 2024 klo 23.57 Marat Gubaidullin (
> marat.gubaidul...@gmail.com)
> kirjoitti:
>
> > Hello Mikael
> >
> > I believe that component configuration in application.properties should
> > work, so don't need to duplicate in YAML:
> >
> > camel.component.jira.jira-url=URL
> > camel.component.jira.password=PASSWORD
> >
> >
> > Marat
> >
> > On Thu, Feb 29, 2024 at 9:00 AM Mikael Koskinen 
> > wrote:
> >
> > > Hi,
> > >
> > > Property placeholders allow us to reuse single things like Jira
> username
> > > and password. But is there a concept in Camel that works with Camel
> YAML
> > &
> > > Karavan where we could reuse "named" endpoint definitions?
> > >
> > > So the idea is that I could (hopefully in application.properties)
> define
> > > something like:
> > >
> > > myjira.username = test
> > > myjira.password = 123456
> > > myjira.jiraUrl = https://comp.atlassian.com/jira
> > >
> > > And then in my route use this "named/keyed" definition when adding the
> > Jira
> > > component. So something like:
> > >
> > > - route:
> > > from:
> > >   uri: jira
> > >   key: "myjira"
> > >   parameters:
> > > type: NEWISSUES
> > >   steps:
> > > - to:
> > > uri: kamelet:http-sink
> > > parameters:
> > >   url: https://webhooksite
> > >   method: POST
> > >
> > > The idea is that I could apply all the properties defined in the
> > > application.properties to the endpoint instead of having to add the
> > > properties one by one.
> > >
> > > I went through the documentation and found something that is almost
> > there:
> > >
> > >
> >
> https://camel.apache.org/manual/faq/how-do-i-configure-endpoints.html#HowdoIconfigureendpoints-Configuringurisusingendpointwithbeanpropertystyle
> > >
> > > But then I checked the YAML schema and I don't think it supports these
> > > Endpoint-definitions. And if it does, I'm not sure if the Karavan
> > designer
> > > could keep up with it.
> > >
> > > So I'm not sure if something like this already exists. Or if I should
> use
> > > Beans? Or is this a new feature idea. Thanks for any tips in advance.
> > >
> > > Best regards,
> > > Mikael
> > >
> >
>


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


Re: Reconfigure incoming file endpoint to follow current date

2024-03-01 Thread Claus Ibsen
Hi

If they all have the same root folder (starting directory)

from file:files?filter=xxx

Then you can use filter to select which dir/files to accept. You can use
simple pattern with now as a date to make it match current day. Or write a
bit of code in a custom file filter class.
See the file component docs for more details.




On Fri, Mar 1, 2024 at 2:04 PM Jan Bares, WOOD & Co. 
wrote:

> Hi,
>
> We need to read files from a folder,that contains current date. During
> quiet period after midnight we need to "switch" to the new folder. What are
> possible solutions? Essentially we need to change endpoint configuration on
> runtime at specific time. Our routes are configured using Java DSL.
>
> On March 1 the folder name is FILES/2024_03_01
> On March 2 the folder name will be FILES/2024_03_02
> ...
>
> Kind regards, Jan
>
> Jan Bares
> Head of Calypso development | IT Development
>
> Phone: +420 222 096 457
> Mobile: +420 776 333 676
> Email: jan.ba...@wood.cz
>
> WOOD & Company
> Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic |
> wood.cz
>
>
>
>
>
> 
> DISCLAIMER
> WOOD & Company Financial Services, a.s. and its branches are authorized
> and regulated by the CNB as Home State regulator and in Poland by the KNF,
> in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as
> Host State regulators. For further information about WOOD & Co., its
> investment services, financial instruments and associated risks, safeguard
> client assets (incl. compensation schemes) and contractual relationship
> please see our website at www.wood.com<http://www.wood.com/> under
> section Corporate Governance. Unless otherwise stated, this transmission is
> neither an offer nor the solicitation of an offer to sell or purchase any
> investment. All estimates, opinions and other information contained herein
> are subject to change without notice and are provided in good faith but
> without legal responsibility or liability. Opinion may be personal to the
> author and may not reflect the opinions of WOOD & Co. Communications from
> sales persons, sales traders or traders should not be regarded as
> investment research and may contain opinions or trading ideas which are
> different from WOOD & Co. investment research opinions. This e-mail and any
> attachments are confidential and may be privileged or otherwise protected
> from disclosure. If you are not a named addressee you must not use,
> disclose, distribute, copy, print or rely on this e-mail and any of its
> attachments. Please notify the sender that you have received this email by
> mistake by replying to the email, and then delete the email and any copies
> of it. Although WOOD & Co. routinely screens e-mails for viruses,
> addressees should scan this e-mail and any attachments for viruses. WOOD &
> Co. makes no representation or warranty as to the absence of viruses in
> this e-mail or any attachments. Please note that to ensure regulatory
> compliance and for the protection of our clients and business, we may
> monitor and read e-mails sent to and from our server(s).
>


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


Re: What happened to HTTP component OAuth support?

2024-03-01 Thread Claus Ibsen
Hi

You are welcome to look further, it could be due to http client v4 -> v5
upgrade that causes major refactor.
And as such this feature may need to be implement again. If so you are
welcome to help. Create a JIRA and see how to do that.

On Mon, Feb 19, 2024 at 12:22 PM Mikael Andersson Wigander
 wrote:

> Hi
>
> As of release 4.2 there’s support for OAuth in the http component but
> nowhere to be found on how to use it.
>
> CAMEL-18637
>
> all I can find is a OAuth2ClientConfigurer class.
>
> /M



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


Re: using Camel with CloudKarafka

2024-02-29 Thread Claus Ibsen
Hi

Just a caution that the company sent out this EOL announcement
https://www.cloudkarafka.com/blog/end-of-life-announcement.html

On Fri, Mar 1, 2024 at 2:20 AM Chirag  wrote:

> Hi,
>
> I am working on a Proof of concept with CloudKarafka (Kafka hosting
> provider) and camel.
>
> I am using camel-jbang 4.4.0
>
> Route to write to Kafka@CloudKarafka works fine.
> But trying to read from Kafka seems to run into challenge.
>
> here is my route:
> - route:
> id: route-09c3
> nodePrefixId: route-229
> from:
>   id: from-f775
>   uri: kafka
>   parameters:
> topic: 4422e1r5-default
> brokers: moped.srvs.cloudkafka.com:9094
> saslJaasConfig: >-
>   org.apache.kafka.common.security.scram.ScramLoginModule
>   required username='user'
>   password='password' securityProtocol: SASL_SSL
>   steps:
> - log:
> id: log-1987
> message: ${body}
>
> Here are logs:
>  he.kafka.common.utils.AppInfoParser : Kafka version: 3.6.1
>  he.kafka.common.utils.AppInfoParser : Kafka commitId: 5e3c2b738d253ff5
>  he.kafka.common.utils.AppInfoParser : Kafka startTimeMs: 1709255355232
>  ort.classic.AssignmentAdapterHelper : Using NO-OP resume strategy
>  l.component.kafka.KafkaFetchRecords : Subscribing 4422e1r5-default-Thread
> 0 to topic 4422e1r5-default
>  afka.clients.consumer.KafkaConsumer : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Subscribed to topic(s):
> 4422e1r5-default
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Node -1 disconnected.
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Cancelled in-flight
> API_VERSIONS request with correlation id 1 due to node -1 being
> disconnected (elapsed time since creation: 401ms, elapsed time since send:
> 401ms, request timeout: 3ms)
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Bootstrap broker
> moped.srvs.cloudkafka.com:9094 (id: -1 rack: null) disconnected
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Node -1 disconnected.
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Cancelled in-flight
> API_VERSIONS request with correlation id 2 due to node -1 being
> disconnected (elapsed time since creation: 216ms, elapsed time since send:
> 216ms, request timeout: 3ms)
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Bootstrap broker
> moped.srvs.cloudkafka.com:9094 (id: -1 rack: null) disconnected
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Node -1 disconnected.
>  .apache.kafka.clients.NetworkClient : [Consumer
> clientId=consumer-12da9c71-2e7d-4726-935f-cf60c349fee3-1,
> groupId=12da9c71-2e7d-4726-935f-cf60c349fee3] Cancelled in-flight
> API_VERSIONS request with correlation id 3 due to node -1 being
> disconnected (elapsed time since creation: 313ms, elapsed time since send:
> 313ms, request timeout: 3ms)
>
> Does this require any other type of param to read successfully?
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>


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


Re: REST DSL: Request param validation possibilities & existing option "allowableValues" not working

2024-02-29 Thread Claus Ibsen
Hi

Ad 1)
https://issues.apache.org/jira/browse/CAMEL-20492

Ad 2)
Whats the use for this this, can you provide more detail and some example

Ad 3)
You can write a custom processor / ben / interceptor and do your own
validation - no need for pojo and all those crazy validation annotations.

On Wed, Feb 28, 2024 at 11:59 PM Ja Li  wrote:

> Dear devs and users,
>
> I just stumbled upon the REST DSL validation part:
> https://camel.apache.org/manual/rest-dsl.html#_client_request_validation
>
> 1) In case I use the "camel-restdsl-openapi-plugin" (Maven plugin) to
> generate REST DSL routes from an openapi specification, e.g.:
> ...
>
> testParam:
>
> name: testparam
>
> in: query
>
> required: true
>
> schema:
>
> type: integer
>
> format: int32
>
> enum: [0, 1, 2, 3, 4]
>
> ...
>
> it will generate the following Camel Route parameter for that:
>
> .param()
>
> .name("testparam")
>
> .type(RestParamType.query)
>
> .dataType("integer")
>
> .allowableValues("0,1,2,3,4")
>
> .required(true)
>
> .endParam()
>
>
> If I now enable the validation via
> "restConfiguration().component("jetty").clientRequestValidation(true);"
>
> I can still pass non-allowed values to the REST endpoint, e.g.
> localhost:8080/rest?testparam=6 and will get an HTTP 200.
>
>
> The documentation so far is only mentioning the "required" property (and
> this one is working) but as the ".allowableValues("0,1,2,3,4")" property
> obviously seems to already have been implemented I'm wondering why it is
> not validated then.
> My request is to add validation for this already existing option.
> It seems similar to the request years ago which has been answers by Claus:
> https://stackoverflow.com/a/50496017/5446400 and he points to the used
> HTTP
> component which should be responsible to actually fulfill the desired
> validation option defined in the route.
> I am currently using platform-http but also tried Jetty - it makes no
> difference.
>
>
> 2) Also can we maybe add support for the JSON property "allowEmptyValue"?
>
>
> 3) One last question which could also fit the user mailing list but as we
> are in the right context right now:
> Do you know any alternatives for validation of request parameters?
> Of course I could put them also into a json, send them to the REST endpoint
> and use a lot of validation annotations on its java data model (provided by
> libs as Jackson etc.) but we are using a HTTP GET endpoint and the RFC 7231
> standards do not allow GET requests with json bodies.
> So it seems as Camel doesn't provide full validation possibilities we have
> to manually check the incoming HTTP request parameter for validity?
>
> I am grateful for any tips!
>
> Kind regards
> Jacob
>


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


Re: [VOTE] Release Apache Camel Kamelets 4.4.0

2024-02-19 Thread Claus Ibsen
+1 (binding)

On Mon, Feb 19, 2024 at 3:14 PM Andrea Cosentino  wrote:

> Hello all,
>
> This is a vote for releasing camel-kamelets 4.4.0
>
> This is the first release of camel-kamelets supporting LTS Camel 4.4.0 and
> it contains many new Kamelets and a lot of fixes.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/4.4.0
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1681
> Kamelets Tag:
> https://github.com/apache/camel-kamelets/releases/tag/v4.4.0
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 4.4.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: Issue with SpringBootTest and camel-rest

2024-02-18 Thread Claus Ibsen
Hi

You can try using platform-http-starter instead of servlets

On Sun, Feb 18, 2024 at 3:09 PM Alphonse Bendt 
wrote:

> Hi folks,
>
> There is an issue when running tests for a SpringBoot application that
> uses camel-rest.
>
> When there are multiple tests that use a different configuration (e.g.,
> different properties), we run into this error:
>
>  Caused by:
> jakarta.servlet.ServletException: Duplicate
> ServletName detected: CamelServlet. Existing:
> CamelHttpTransportServlet[name=CamelServlet] This:
> CamelHttpTransportServlet[name=CamelServlet]. Its advised to use unique
> ServletName per Camel application.
> at
> app//org.apache.camel.component.servlet.CamelHttpTransportServlet.init(CamelHttpTransportServlet.java:68)
>
>
> I have created a standalone example to demonstrate the issue:
> https://github.com/abendt/camel-rest
>
> To reproduce:
> ./gradlew -i test
>
> The project contains two tests with different configurations (one has an
> additional active profile).
> I would expect the build to pass; however, it fails with the mentioned
> exception.
>
> As a workaround, it's possible to add @DirtiesContext. However, this hurts
> test performance and should be avoided if possible.
>
> Am i missing something or is this a current limitation of camel-rest?
>
> thanks,
>Alphonse



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


Re: Camel 4 and Weld CDI

2024-02-14 Thread Claus Ibsen
Hi

Try to search for something like cdi startup listener
There is some @Oberservation annotation where you can specify on startup /
shutdown, and have CDI invoke your methods.


On Wed, Feb 14, 2024 at 11:25 AM Jad Anouti  wrote:

> Interesting, I have 2 followup points from that.
>
> Point 1: I was watching a presentation video from my senior developer on
> the product I'm working on which is using camel. And he was saying that
> camel would natively support CDI In the newer version, so the need for the
> camel-cdi dependency would no longer be needed. From your response this
> statement seems to be incorrect and Camel no longer supports java CDI. The
> only 2 official ways of support is either spring boot or quarkus
>
> Point 2: Do you have any ideas or examples of how I could possibly control
> the startup and shutdown of the camel context using CDI ( more specifically
> Weld but any CDI implementation would do )
>
>
> On Wed, 14 Feb 2024, 12:16 pm Claus Ibsen,  wrote:
>
> > Hi
> >
> > camel-cdi is no longer supported and there is no plan.
> > You can with CDI have some way of startup listeners where you can create
> > Camel and load routes and whatnot, you may need.
> >
> >
> >
> > On Wed, Feb 14, 2024 at 11:11 AM Jad Anouti 
> > wrote:
> >
> > > Hello
> > >
> > > I have a question regarding the deprecation of camel CDI
> > > It seems that with the release of Camel 4 the dependency for Camel CDI
> > has
> > > been removed.
> > >
> > > I was wondering if that means that i will no longer be able to use
> Camel
> > in
> > > my Weld CDI application (Weld being a reference implementation of Java
> > EE),
> > > or is there an alternative to still be able to use Camel and Weld CDI
> > > together without the need for Camel-cdi.
> > >
> > > Since my tech stack is centered around Java EE, if I were to switch to
> > > camel-spring-boot I would have to migrate from Weld to spring boot. And
> > my
> > > company would realistically not allow me to switch to camel-quarkus,
> > since
> > > quarkus is not used in the application.
> > >
> > > Thank you for your assistance in this matter
> > >
> > > Regards
> > >
> > > Jad anouti
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>


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


Re: Camel 4 and Weld CDI

2024-02-14 Thread Claus Ibsen
Hi

camel-cdi is no longer supported and there is no plan.
You can with CDI have some way of startup listeners where you can create
Camel and load routes and whatnot, you may need.



On Wed, Feb 14, 2024 at 11:11 AM Jad Anouti  wrote:

> Hello
>
> I have a question regarding the deprecation of camel CDI
> It seems that with the release of Camel 4 the dependency for Camel CDI has
> been removed.
>
> I was wondering if that means that i will no longer be able to use Camel in
> my Weld CDI application (Weld being a reference implementation of Java EE),
> or is there an alternative to still be able to use Camel and Weld CDI
> together without the need for Camel-cdi.
>
> Since my tech stack is centered around Java EE, if I were to switch to
> camel-spring-boot I would have to migrate from Weld to spring boot. And my
> company would realistically not allow me to switch to camel-quarkus, since
> quarkus is not used in the application.
>
> Thank you for your assistance in this matter
>
> Regards
>
> Jad anouti
>


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


Re: Order of logName evaluation for log EIP

2024-02-13 Thread Claus Ibsen
Hi

Yeah the doc is a bit outdated, and we should also only use source
name:line if explicit enabled
https://issues.apache.org/jira/browse/CAMEL-20418

On Tue, Feb 13, 2024 at 8:03 PM Benjamin Graf 
wrote:

> Hi together,
>
> I'm struggling what would be the expected order for logName evaluation.
> The docs (
> https://camel.apache.org/components/4.0.x/eips/log-eip.html#_configuring_logging_name)
> says if not defined, it'll use the routeId set or a generated one. Looking
> into code of LogReifier (
> https://github.com/apache/camel/blob/3793981daa32567a25a2aa1628a986658f863171/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/LogReifier.java#L70)
> it would use getLineNumberLoggerName() before any kind of routeId first.
>
> What is the wanted order code or doc? Seems to be a bug, anyway :)
>
> Regards,
>
> Benjamin
>


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


Re: REST dsl in Kamelet

2024-02-11 Thread Claus Ibsen
Hi

Kamelets are for *routes* and not rest-dsl.



On Sun, Feb 11, 2024 at 6:03 AM Rohan Emmanuel 
wrote:

> hi,
> i was trying to move the REST dsl mentioned in the snippet below from the
> camel-context.xml to the kamelet yaml file.can anyone advice me on how to
> do this ?
> here, the REST endpoint invokes the ABC service which is defined in the
> Kamelet YAML file. was looking to add all camel-related endpoints in the
> YAML file. Thanks in advance.
>
> 
> This Context contains route for the verbs delete and
> put
> 
> 
> 
> 
> ...
> 
> 
> 
> 
> 
>
>
>
> --
> Regards,
> Rohan Emmanuel
>


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


Re: XML Io Dsl: Can a bean reference another bean?

2024-02-07 Thread Claus Ibsen
Hi


You use value="#bean:myBeanId"

https://camel.apache.org/manual/property-binding.html
https://camel.apache.org/components/next/others/java-xml-io-dsl.html



On Wed, Feb 7, 2024 at 4:35 PM Franz Paul Forsthofer
 wrote:

> Hello,
>
> in
> https://github.com/apache/camel/tree/main/dsl/camel-xml-io-dsl/src/test/resources/org/apache/camel/dsl/xml/io
> ,
> I found examples for the XML Io DSL. I did not see any example where a
> bean references another, something like the following
>
> 
>
> 
>   
> 
> 
> 
>
> Or where a bean reference an existing bean in the camel registry:
> 
>   
> 
> 
> 
>
> Is this not possible with XML Io Dsl? Is this planned as future
> improvement?
>
> Im using Camel Main 4.3 with Spring Boot. However, I cannot use Spring
> beans XML because I want to dynamically add the Camel routes after the
> Spring Boot application was started.
>
> Regards Franz
>


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


Re: How does Apache Camel (un)marshal with 'gzipDeflater' work?

2024-02-06 Thread Claus Ibsen
Hi

The doc is outdated, you need to have camel-zip-deflater JAR

On Tue, Feb 6, 2024 at 3:57 PM Quirin Ertl 
wrote:

> In this code snippet I want to unzip a gzip body using Camel. According to
> the Camel documentation, no other dependencies are needed apart from
> camel-core.
>
> Link:
> https://camel.apache.org/components/4.0.x/dataformats/gzipDeflater-dataformat.html#_dependencies
>
>
> public static void main(final String[] args) throws Exception {
> try (final CamelContext context = new DefaultCamelContext()) {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() {
>
> this.from("direct:test").unmarshal().gzipDeflater().to("seda:test2");
> }
> });
> context.start();
> context.createProducerTemplate().sendBody("direct:test", "this is
> not gzip but it does not matter.");
> Thread.currentThread().join();
> }
> }
>
>
> When I run the code I get this error:
>
> Caused by: java.lang.IllegalArgumentException: Data format 'gzipDeflater'
> could not be created. Ensure that the data format is valid and the
> associated Camel component is present on the classpath
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.createDataFormat(DataFormatReifier.java:279)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:152)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:112)
> at
> org.apache.camel.reifier.UnmarshalReifier.createProcessor(UnmarshalReifier.java:35)
> at
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:870)
> at
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:610)
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:213)
> ... 11 more
>
> The error message says I need another dependency, but the Camel
> documentation says I don't need one. How is this supposed to work?
>
>
>

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


Re: FTP not streaming to JMS

2024-02-06 Thread Claus Ibsen
Hi

btw there are some streaming and artemis options in camel-jms if you have
not seen that.

On Mon, Feb 5, 2024 at 12:19 PM Claus Ibsen  wrote:

> Hi
>
> If you use the Red Hat Camel / Messaging product then you can contact that
> vendor to get support.
>
>
> On Mon, Feb 5, 2024 at 11:52 AM Michael Rambichler 
> wrote:
>
>> Dear Camel group,
>>
>> Maybe I missed something.
>> But in my testcase/environment the JMS Endpoint does not stream and throws
>> an Java Heap Exception:
>>
>> I have used a simple Apache Camel 3.22.0 Spring boot Route:
>> My JMS is a current: Red Hat AMQ Broker 7.11.0 (locally setup as cluster)
>> The FTP is local org.apache.ftpserver
>>
>> In the example below it throws an Java Heap error. If I replace JMS with
>> direct it works.
>>
>> Any help would be appreciated.
>>
>> public void configure() {
>>
>> //from("ftp:admin:admin@localhost
>> :?filename=SmallFile.data=true=true=false")
>> from("ftp:admin:admin@localhost
>> :?filename=BigFile.data=true=true=false")
>> .routeId("Sending")
>> .doTry()
>> .to("jms:testjms_q?streamMessageTypeEnabled=true")
>> .doCatch(Throwable.class)
>> .process(exchange -> {
>> System.err.println("ERROR:" + exceptionMessage());
>> })
>> //.to("direct:process")
>> .log("Successfully finished exchange");
>>
>> from("jms:testjms_q")
>> //from("direct:process")
>> .routeId("Receiving Route")
>> .split().tokenize(",").streaming()
>> .process(exchange -> {
>> Long lineNumber =
>> exchange.getProperty("CamelSplitIndex", Long.class);
>> if ((lineNumber + 1) % 100 == 0) {
>>     exchange.getIn().getBody(String.class);
>> log.info("streamed Line {}: {}", lineNumber + 1,
>> exchange.getIn().getBody(String.class));
>> }
>> })
>> .end()
>> .log("Finished");
>>
>>
>>
>>
>> }
>>
>
>
> --
> 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: FTP not streaming to JMS

2024-02-05 Thread Claus Ibsen
Hi

If you use the Red Hat Camel / Messaging product then you can contact that
vendor to get support.


On Mon, Feb 5, 2024 at 11:52 AM Michael Rambichler 
wrote:

> Dear Camel group,
>
> Maybe I missed something.
> But in my testcase/environment the JMS Endpoint does not stream and throws
> an Java Heap Exception:
>
> I have used a simple Apache Camel 3.22.0 Spring boot Route:
> My JMS is a current: Red Hat AMQ Broker 7.11.0 (locally setup as cluster)
> The FTP is local org.apache.ftpserver
>
> In the example below it throws an Java Heap error. If I replace JMS with
> direct it works.
>
> Any help would be appreciated.
>
> public void configure() {
>
> //from("ftp:admin:admin@localhost
> :?filename=SmallFile.data=true=true=false")
> from("ftp:admin:admin@localhost
> :?filename=BigFile.data=true=true=false")
> .routeId("Sending")
> .doTry()
> .to("jms:testjms_q?streamMessageTypeEnabled=true")
> .doCatch(Throwable.class)
> .process(exchange -> {
> System.err.println("ERROR:" + exceptionMessage());
> })
> //.to("direct:process")
> .log("Successfully finished exchange");
>
> from("jms:testjms_q")
> //from("direct:process")
> .routeId("Receiving Route")
> .split().tokenize(",").streaming()
> .process(exchange -> {
> Long lineNumber =
> exchange.getProperty("CamelSplitIndex", Long.class);
> if ((lineNumber + 1) % 100 == 0) {
> exchange.getIn().getBody(String.class);
> log.info("streamed Line {}: {}", lineNumber + 1,
> exchange.getIn().getBody(String.class));
> }
> })
> .end()
> .log("Finished");
>
>
>
>
> }
>


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


Re: Camel 3.21.x to 3.22.x / Migration guide

2024-01-26 Thread Claus Ibsen
Yeah 3.22 is just very same with 1 or 2 new components. Spring Boot / Karaf
et all is the same.

On Fri, Jan 26, 2024 at 1:42 PM Ephemeris Lappis 
wrote:

> Hello.
>
> If I'm not wrong, there's no migration guide to go from 3.21.x to 3.22.x.
>
> Does it mean that there's no breaking change, neither in the code nor
> at runtime ?
>
> Thanks.
>
> Regards.
>


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


Re: basic question about where aggregation is appropriate

2024-01-18 Thread Claus Ibsen
Hi

Is each field name unique, and in the form

key1=value1
key2=value2

You can then load this into a java.util.Properties (that is a Map) then you
set that as a header.



On Wed, Jan 10, 2024 at 4:54 PM Mitch Trachtenberg  wrote:

> Hi,
>
> I am using the following approach in designing an application, but I am not
> sure whether this is the appropriate way of handling things.  Any advice
> appreciated.
>
> I have a String body with multiple lines, each line containing a field name
> and value.
>
> To use parameters in the SQL, I want to set headers in Camel.  I use split
> and aggregate to send one line at a time to a route which sets a header,
> and in the aggregation, I merge the headers.  This allows me to then issue
> a SQL call in YAML using the :#${header.x} syntax for multiple fields.
>
> While this works, I am suspicious that I'm taking a long way around and
> there is a more straightforward approach.  I'm assuming that I need the
> values in headers in order to send them in as parameters to a prepared
> statement to bypass the possibility of SQL injection.
>
> Am I missing a more straightforward approach, or is this how it's typically
> done?
>
> Thanks,
> Mitch
>


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


Re: [VOTE] Release Apache Camel Kamelets 4.0.3

2024-01-17 Thread Claus Ibsen
+1 (binding)

On Wed, Jan 17, 2024 at 9:32 AM Andrea Cosentino  wrote:

> Hello all,
>
> This is a vote for releasing camel-kamelets 4.0.3
>
> This release will support the 4.0.3 release of Apache Camel. The aim of the
> release is to have a catalog to use in generating camel-kafka-connector
> 4.0.3 release.
>
> Kamelets release files:
> https://dist.apache.org/repos/dist/dev/camel/camel-kamelets/4.0.3
> Kamelets staging repository:
> https://repository.apache.org/content/repositories/orgapachecamel-1668
> Kamelets Tag:
> https://github.com/apache/camel-kamelets/releases/tag/v4.0.3
>
> Please cast your vote.
>
> [ ] +1 Release camel-kamelets 4.0.3
> [ ] -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: spring xml DSL to YAML dsl

2024-01-16 Thread Claus Ibsen
Hi

No this is not possible out of the box with the old way of using WAR
deployments.
For Spring we focus on Spring Boot as the primary runtime.

If you want to do old style WAR you can implement a web context listener (
I forgot what its called ) that bootstrap your app, and there you can
manually
load your Camel routes, from files in the classpath. There is a bunch of
route loader API in camel you need to use for that. You can peek how camel
spring boot does it etc.








On Fri, Jan 5, 2024 at 3:49 PM Rohan Emmanuel 
wrote:

> hi,
> i am creating a web app containing camel routes using camel-spring xml dsl
> containing REST dsl in applicationContext.xml(this is referred by
> configuring CamelHttpTransportServlet
> <
> https://github.com/apache/camel/blob/main/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
> >
>   in web.xml )as mentioned in the snippet below and I deploy the web app on
> Tomcat webserver to access the routes.
>
> can anyone please guide me if the same can be done using YAML DSL instead
> of xml? any pointers to the documentation example would be helpful. Thanks.
>
>
>
> http://camel.apache.org/schema/spring;>
>   
>  Route for the path /organisation_endpoint
>
>  outType="com.xx.x.commons.Response" produces="application/json"
> uri="/deleting/">
> Route for the verb DELETE:-- From /deleting/ to
> Destination 1. ( Process:dd345)  
>
> 
>ref="organisation_endpoint.delete.ddl2java"/>
> 
> 
>  
> 
> 
> 
> --
> Regards,
> Rohan Emmanuel
>


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


Re: Camel JMS headers not updated by producer

2024-01-16 Thread Claus Ibsen
Hi

No this is not possible out of the box with dynamic queue names.

It may be desirable to enrich the message with
a CamelJmsDestinationNameProduced header that includes the name.
You are welcome to create a JIRA.





On Mon, Jan 8, 2024 at 10:05 AM Ephemeris Lappis 
wrote:

> Hello.
>
> If it's confirmed, it means that I can't retrieve the actual resulting
> queue the message is sent to ?
> I'd need to retrieve it in some event notifiers, out of the Camel
> routes code, that spies all the exchanges, the same way I do for
> generated files retrieving the header "CamelFileNameProduced".
>
> Not any other way to identify the destination ?
>
> Thanks for your help.
>
> Regards.
>
> Le dim. 7 janv. 2024 à 15:50, Jeremy Ross  a
> écrit :
> >
> > I think Camel only sets those headers when a JMS message is received.
> >
> >
> https://camel.apache.org/components/4.0.x/jms-component.html#_message_format_when_receiving
> >
> > On Thu, Jan 4, 2024 at 5:56 AM Ephemeris Lappis <
> ephemeris.lap...@gmail.com>
> > wrote:
> >
> > > Hello.
> > >
> > > I've observed that some JMS headers are not updated after a message is
> > > sent.
> > >
> > > For example, using this statement :
> > >
> > >   > >
> uri="jms:{{my.queue.prefix}}.${headers.entity}.{{my.queue.suffix}}?connectionFactory=#myJMS"
> > > /
> > >
> > > I expected to have the header "JMSDestination" set on the Camel
> > > message with the destination, but instead of that I still have the
> > > input JMS message's queue name.
> > >
> > > The same with the header "JMSMessageID" that seems not to be updated.
> > >
> > > Is it normal behavior of the JMS component ?
> > >
> > > I use Camel 3.21.3 and ActiveMQ 5.18.3.
> > >
> > > Thanks for your help.
> > >
>


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


Re: Adding http(s) compatibility to a component (for discoverable service compatibility)

2024-01-03 Thread Claus Ibsen
Hi Steve

Yeah sure we love contributions.

When you are done with the work on the dynamic router component then let us
know, and we can help find relevant work you may want to help with.
That said anyone is welcome to help, and you can find JIRA tickets with
outstanding tasks. And also ask on the zulip chat room.

And there is always a new component that can be coded that integrates Camel
with yet another thing.
And of course documentation, examples, help other community users, fix
tests, and whatnot.
Write blog posts, record videos and so on.

I will be on PTO for 2 weeks, so that is why I will be silent for a while.





On Mon, Jan 1, 2024 at 6:27 PM Steve973  wrote:

> Thank you for your insight, Claus!  While I am trying to add things that
> will be as useful as possible to people, I do not always know what would be
> best for the community.  Instead of discovery, I will add some
> component-specific JMX monitoring and control through the @Managed*
> annotations.  This will include subscription control, and
> filter/subscription statistics.  If you can think of anything else that I
> can add, or at least some popular use cases, or newer/emerging use cases
> that are gaining popularity, please let me know.  Also, if you know of some
> tickets that will help me learn Camel better, feel free to point me to
> them.  I can usually find some time to contribute more.
>
> Thanks,
> Steve
>
> On Sat, Dec 30, 2023 at 10:14 AM Claus Ibsen 
> wrote:
>
> > Hi
> >
> > There is this ticket
> > https://issues.apache.org/jira/browse/CAMEL-18546
> >
> > Its about being able to have a list of hosted services by the current
> Camel
> > application, that can be exposed for tooling and end users.
> > This is not intended as a distributed service registrt ala Consul or
> > whatever. But a quick way to find out if there is a service in this
> running
> > Camel application,
> > and if so, how to access it.
> >
> > However for your dynamic router component, it seems you talk about being
> > able to manage it via HTTP.
> >
> > Camel components are usually made managable via JMX, and then you can
> also
> > make a "dev console" that is intended for developers to quickly see some
> > information
> > from it via a http web console (not for production management), but those
> > dev consoles also comes with a HTTP JSon apit that can be used for basic
> > management.
> > This is some of the stuff we use for camel-jbang.
> >
> >
> >
> >
> > On Sat, Dec 30, 2023 at 3:57 PM Claus Ibsen 
> wrote:
> >
> > > Hi
> > >
> > > A discoverable service? Do you mean some kind of external service
> > registry
> > > ala Consul, Kubernetes ?
> > > Camel is not everyhing, and if you need a service registry then favour
> to
> > > use those kind of products that does that.
> > > Then you can make your component enlist itself into their service
> > > registries.
> > >
> > > However beware to not make your component doing too much and being to
> > > complex.
> > >
> > > Your component is a dynamic router that was intended to be for routing
> > > internally in Camel.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Sat, Dec 30, 2023 at 3:31 PM Steve973  wrote:
> > >
> > >> Hello.  In my component, I have a control channel component that
> > services
> > >> a
> > >> few types of administrative messages that configure the component in
> > >> certain ways.  I would like to experiment with making the control
> > >> component
> > >> endpoint a discoverable service, so I would like to try to clarify
> some
> > >> things before I start.
> > >>
> > >> First, I assume that I will need to create another component-endpoint
> > pair
> > >> that uses HTTP.  That seems really obvious, but I wanted to make sure
> > that
> > >> I am not missing something.  It certainly would not be the first time
> > that
> > >> has happened!
> > >>
> > >> Next, is the Undertow component the best example for me to learn how I
> > >> should approach it?  I should only need basic http/https functionality
> > to
> > >> accept the request information.  If possible, I would like to be able
> to
> > >> reuse the logic that my non-http control channel already implements.
> If
> > >> there is another component that provides an http endpoint as (mostly)
>

Re: Testing JMX with camel-test-junit5

2024-01-02 Thread Claus Ibsen
Hi

The mbean name you create is for a route, so it's a RouteMBean.

You can use jconsole to look inside the running Camel test and see what
mbeans there are etc.
You can just add a thread sleep (long value) to keep the jvm running.

Then find the right mbean you want to get and update your test code.

Also take a look at the existing tests in camel-management etc.





On Tue, Jan 2, 2024 at 6:53 PM Steve973  wrote:

> Hi, Claus.  Yes, I have included camel-management as a test-scoped
> dependency.
>
> On Tue, Jan 2, 2024 at 12:24 AM Claus Ibsen  wrote:
>
> > Hi
> >
> > Have you added camel-management as a dependency.
> >
> > On Tue, Jan 2, 2024 at 2:15 AM Steve973  wrote:
> >
> > > Hello.  I have a CamelSpringBootTest, and I am trying to test that my
> > > mbeans have been registered.  This is how I am trying to check:
> > >
> > > @CamelSpringTest
> > > @ContextConfiguration
> > > @DirtiesContext(classMode =
> > > DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
> > > class DynamicRouterJmxIT {
> > >
> > > @Autowired
> > > CamelContext camelContext;
> > >
> > > @Test
> > > void testExpectedMbeansExist() throws MalformedObjectNameException
> {
> > > Assertions.assertTrue(camelContext.isStarted());
> > > MBeanServer mBeanServer =
> > >
> >
> camelContext.getManagementStrategy().getManagementAgent().getMBeanServer();
> > > ObjectName name = new
> > >
> > >
> >
> ObjectName("org.apache.camel:context=camelContext,type=routes,name=\"testRoute\"");
> > > DynamicRouterControlService controlMbean =
> > > JMX.newMBeanProxy(mBeanServer, name,
> > > DynamicRouterControlService.class);
> > > DynamicRouterFilterService filterMbean =
> > > JMX.newMBeanProxy(mBeanServer, name,
> > > DynamicRouterFilterService.class);
> > > Assertions.assertNotNull(controlMbean);
> > > Assertions.assertNotNull(filterMbean);
> > > }
> > > }
> > >
> > > Here is the XML that I am using for it, called
> > > DynamicRouterJmxIT-context.xml:
> > >
> > > http://www.springframework.org/schema/beans;
> > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> > >xsi:schemaLocation="
> > >http://www.springframework.org/schema/beans
> > > http://www.springframework.org/schema/beans/spring-beans.xsd
> > >http://camel.apache.org/schema/spring
> > > http://camel.apache.org/schema/spring/camel-spring.xsd;>
> > >
> > >   http://camel.apache.org/schema/spring;>
> > > 
> > > 
> > > 
> > >   
> > >   
> > > 
> > > 
> > >   
> > >   
> > > 
> > >   
> > > 
> > >
> > >
> > > I keep getting this error:
> > >
> > > Cannot invoke "org.apache.camel.spi.ManagementAgent.getMBeanServer()"
> > > because the return value of
> > > "org.apache.camel.spi.ManagementStrategy.getManagementAgent()" is null
> > >
> > > What am I doing wrong?
> > >
> > > Thanks,
> > > Steve
> > >
> >
> >
> > --
> > 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: Testing JMX with camel-test-junit5

2024-01-01 Thread Claus Ibsen
Hi

Have you added camel-management as a dependency.

On Tue, Jan 2, 2024 at 2:15 AM Steve973  wrote:

> Hello.  I have a CamelSpringBootTest, and I am trying to test that my
> mbeans have been registered.  This is how I am trying to check:
>
> @CamelSpringTest
> @ContextConfiguration
> @DirtiesContext(classMode =
> DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
> class DynamicRouterJmxIT {
>
> @Autowired
> CamelContext camelContext;
>
> @Test
> void testExpectedMbeansExist() throws MalformedObjectNameException {
> Assertions.assertTrue(camelContext.isStarted());
> MBeanServer mBeanServer =
> camelContext.getManagementStrategy().getManagementAgent().getMBeanServer();
> ObjectName name = new
>
> ObjectName("org.apache.camel:context=camelContext,type=routes,name=\"testRoute\"");
> DynamicRouterControlService controlMbean =
> JMX.newMBeanProxy(mBeanServer, name,
> DynamicRouterControlService.class);
> DynamicRouterFilterService filterMbean =
> JMX.newMBeanProxy(mBeanServer, name,
> DynamicRouterFilterService.class);
> Assertions.assertNotNull(controlMbean);
> Assertions.assertNotNull(filterMbean);
> }
> }
>
> Here is the XML that I am using for it, called
> DynamicRouterJmxIT-context.xml:
>
> http://www.springframework.org/schema/beans;
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>xsi:schemaLocation="
>http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd;>
>
>   http://camel.apache.org/schema/spring;>
> 
> 
> 
>   
>   
> 
> 
>   
>   
> 
>   
> 
>
>
> I keep getting this error:
>
> Cannot invoke "org.apache.camel.spi.ManagementAgent.getMBeanServer()"
> because the return value of
> "org.apache.camel.spi.ManagementStrategy.getManagementAgent()" is null
>
> What am I doing wrong?
>
> Thanks,
> Steve
>


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


Re: Adding http(s) compatibility to a component (for discoverable service compatibility)

2023-12-30 Thread Claus Ibsen
Hi

There is this ticket
https://issues.apache.org/jira/browse/CAMEL-18546

Its about being able to have a list of hosted services by the current Camel
application, that can be exposed for tooling and end users.
This is not intended as a distributed service registrt ala Consul or
whatever. But a quick way to find out if there is a service in this running
Camel application,
and if so, how to access it.

However for your dynamic router component, it seems you talk about being
able to manage it via HTTP.

Camel components are usually made managable via JMX, and then you can also
make a "dev console" that is intended for developers to quickly see some
information
from it via a http web console (not for production management), but those
dev consoles also comes with a HTTP JSon apit that can be used for basic
management.
This is some of the stuff we use for camel-jbang.




On Sat, Dec 30, 2023 at 3:57 PM Claus Ibsen  wrote:

> Hi
>
> A discoverable service? Do you mean some kind of external service registry
> ala Consul, Kubernetes ?
> Camel is not everyhing, and if you need a service registry then favour to
> use those kind of products that does that.
> Then you can make your component enlist itself into their service
> registries.
>
> However beware to not make your component doing too much and being to
> complex.
>
> Your component is a dynamic router that was intended to be for routing
> internally in Camel.
>
>
>
>
>
>
>
>
> On Sat, Dec 30, 2023 at 3:31 PM Steve973  wrote:
>
>> Hello.  In my component, I have a control channel component that services
>> a
>> few types of administrative messages that configure the component in
>> certain ways.  I would like to experiment with making the control
>> component
>> endpoint a discoverable service, so I would like to try to clarify some
>> things before I start.
>>
>> First, I assume that I will need to create another component-endpoint pair
>> that uses HTTP.  That seems really obvious, but I wanted to make sure that
>> I am not missing something.  It certainly would not be the first time that
>> has happened!
>>
>> Next, is the Undertow component the best example for me to learn how I
>> should approach it?  I should only need basic http/https functionality to
>> accept the request information.  If possible, I would like to be able to
>> reuse the logic that my non-http control channel already implements.  If
>> there is another component that provides an http endpoint as (mostly) an
>> additional access point, I would be interested in seeing that.  The
>> undertow component is pretty substantial, and I do not know if it would be
>> worth that additional complexity and code to integrate with component
>> discovery.
>>
>> Lastly, what else should I be aware of?  The "Service Registry" page in
>> the
>> Camel online manual does not seem to be directed toward
>> developers, other than the idea of implementing DiscoverableService.  If I
>> end up doing all of this with my component, would it be helpful to add a
>> more detailed section to the manual to help others get started with
>> implementation?
>>
>> Thanks,
>> Steve
>>
>
>
> --
> 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: Adding http(s) compatibility to a component (for discoverable service compatibility)

2023-12-30 Thread Claus Ibsen
Hi

A discoverable service? Do you mean some kind of external service registry
ala Consul, Kubernetes ?
Camel is not everyhing, and if you need a service registry then favour to
use those kind of products that does that.
Then you can make your component enlist itself into their service
registries.

However beware to not make your component doing too much and being to
complex.

Your component is a dynamic router that was intended to be for routing
internally in Camel.








On Sat, Dec 30, 2023 at 3:31 PM Steve973  wrote:

> Hello.  In my component, I have a control channel component that services a
> few types of administrative messages that configure the component in
> certain ways.  I would like to experiment with making the control component
> endpoint a discoverable service, so I would like to try to clarify some
> things before I start.
>
> First, I assume that I will need to create another component-endpoint pair
> that uses HTTP.  That seems really obvious, but I wanted to make sure that
> I am not missing something.  It certainly would not be the first time that
> has happened!
>
> Next, is the Undertow component the best example for me to learn how I
> should approach it?  I should only need basic http/https functionality to
> accept the request information.  If possible, I would like to be able to
> reuse the logic that my non-http control channel already implements.  If
> there is another component that provides an http endpoint as (mostly) an
> additional access point, I would be interested in seeing that.  The
> undertow component is pretty substantial, and I do not know if it would be
> worth that additional complexity and code to integrate with component
> discovery.
>
> Lastly, what else should I be aware of?  The "Service Registry" page in the
> Camel online manual does not seem to be directed toward
> developers, other than the idea of implementing DiscoverableService.  If I
> end up doing all of this with my component, would it be helpful to add a
> more detailed section to the manual to help others get started with
> implementation?
>
> Thanks,
> Steve
>


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


Re: Using simple expression to get header value in spring xml

2023-12-03 Thread Claus Ibsen
Hi

That is just an endpoint, its not something evaluated for a given
exchange/message when being defined.

So you need to just configure them as string literals as-is.
So they have special meaning for your component. But what you do is wrong.

If you need dynamic uris in Camel then you use toD for example.

What a component often do, is to have known headers that can override
configuration options, like JMS has for some of its values.
https://camel.apache.org/components/4.0.x/jms-component.html#_message_headers


On Sun, Dec 3, 2023 at 10:19 PM Steve973  wrote:

> Hello.  I am writing tests for my component with Spring, and configuring in
> xml.  How can I specify these values so that it looks in the header,
> instead of interpreting these as literal string values?
>
>  uri="dynamic-router-control://subscribe">
> 
> 
> 
>     
> 
>
> Thanks,
> Steve
>


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


Re: org.apache.camel.springboot:camel-ftp-starter:4.2.0

2023-12-03 Thread Claus Ibsen
Hi

There is no plans.

The jsch library is here and its 100% in the open (open source, BSD
license, home on github, etc)
https://github.com/mwiede/jsch

It is actively maintained and has more frequent releases.
And it's based on the jsch that is used in a lot of places.
And the FTP component has been using jsch for 15+ years



On Sun, Dec 3, 2023 at 6:41 PM Ravi  wrote:

> Hello,
>
> Currently, we replace the JCraft's Jsch library with com.hithub.mwiede:jsch
> when we use org.apache.camel.springboot:camel-ftp-starter:4.2.0.
>
> Does anyone know if there's a plan to implement sshd-mina instead in the
> near future?
>
> Our security team is a bit worried about downloading
> com.hithub.mwiede:jsch as they deem that as a private library.
>
> Regards,
> Ravi
>


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


Re: Trying to simplify my component by using a reifier

2023-12-03 Thread Claus Ibsen
On Wed, Nov 29, 2023 at 9:06 PM Steve973  wrote:

> Hi, Claus.  Thanks for the recommendation.  Originally, I was going to use
> the RecipientList class and create an instance.  I thought that I would see
> how core was creating the processor, which led me to my interest in the
> reifier class.  When I looked at it, I saw the value in how it set up the
> executors/thread pools, and the aggregation strategy.  If I cannot (or do
> not) use the reifier, then I will have to duplicate or re-create that
> code.  Since a major point in my refactoring endeavor is to simplify this
> component, I am hesitant to do that.
>
> I am looking at an alternative, and I would like your opinion when you have
> the time to offer your thoughts.  I have a route template like this:
>
> routeTemplate("recipientListRouteTemplate")
> .templateParameter("channel")
> .from("direct:${channel}")
> .process("${channel}RecipientList");
>
> Then I create a route from this in my DynamicRouterProcessor class like
> this:
>
> String routeId = TemplatedRouteBuilder.builder(camelContext,
> "recipientListRouteTemplate")
> .parameter("channel", configuration.getChannel())
> .add();
> Route route = camelContext.getRoute(routeId);
>
> After that, I have code that translates the configuration params into a
> RecipientListDefinition.  After that, I have:
>
> RecipientListReifier reifier = new RecipientListReifier(route, definition);
> camelContext.getRegistry()
> .bind(configuration.getChannel() + "RecipientList",
> reifier.createProcessor());
>
> When a message comes in for the DynamicRouterProcessor instance to handle,
> the process method handles the exchange like this:
>
> prepareExchange(exchange);
> try (Producer producer = exchange.getContext().getEndpoint("direct:" +
> channel).createProducer()) {
> producer.process(exchange);
> }
>
> That was as far as I got yesterday in my implementation, so I was not yet
> able to test it.  Is this a terrible idea, or do you think it is worth
> trying?  Otherwise, if it's the best option, I could "borrow" the pertinent
> code in the reifier and create the RecipientList instance directly.
>
>
Hi

I think this seems to complicated and also caused a lot of routes to be
added dynamically based on channel names.
And that is overhead as the route would then just be a from -> to.





> Thanks,
> Steve
>
>
>
> On Wed, Nov 29, 2023 at 1:19 AM Claus Ibsen  wrote:
>
> > Hi
> >
> > If you need to create the RecipientListProcessor then you dont
> > necessary have to use reifier to do it.
> >
> > We have a few EIPs that are created via annotations
> >
> >
> https://github.com/apache/camel/blob/5235319d94fbb82f479ca3085b0780c0f144111b/core/camel-api/src/main/java/org/apache/camel/spi/AnnotationBasedProcessorFactory.java#L44
> >
> > You can just create the processor yourself and configure it accordingly.
> >
> >
> >
> >
> > On Tue, Nov 28, 2023 at 12:51 AM Steve973  wrote:
> >
> > > Hello.  I am attempting to simplify my Dynamic Router EIP component by
> > > using the existing RecipientList implementation from camel-core.
> > >
> > > I was looking at the RecipientListReifier, even though I will not be
> > adding
> > > anything to the Camel DSL.  It looks like it would be perfect for
> setting
> > > up the RecipientList instance.  I can take my configuration class, and
> > > adapt it to a RecipientListDefinition instance.  The problem that I am
> > > encountering is that the RecipientListReifier constructor wants a Route
> > > instance.  When routing recipients send their subscription information
> to
> > > the dynamic router component through its control channel, this is not
> the
> > > route that the actual routing will occur on.  So I have no idea what
> > Route
> > > instance I can provide to the Reifier constructor.  Furthermore, when
> the
> > > dynamic router receives a message, the producer simply calls the
> > processor,
> > > so there is no real route to speak of, even during runtime dynamic
> > routing.
> > >
> > > My questions are:
> > >
> > > 1. Is this a decent approach?  After a recent code review, it occurred
> to
> > > me that I needed to simplify everything, and this would do that.  The
> > > component would only need to manage subscriptions, and evaluate
> exchanges
> > > for recipients.
> > >
> > > 2. What should I use as the Route instance for 

Re: Registry binding, unbinding, and re-binding seems odd

2023-12-03 Thread Claus Ibsen
Hi

A route or processor will often lookup the bean once and use that same
instance all the time.

The bind/unbind is not intended for dynamic.

However the bean component has a cache option you can set to lookup always.
A processor does not.


On Sun, Dec 3, 2023 at 12:52 AM Steve973  wrote:

> Hello.  I am binding a processor in the registry, which works fine.  At
> some point, I unbind it, and then bind a different processor with the same
> bean name.  I am even printing out the class name after I bind, in order to
> verify it.
>
> The first print shows the original/temporary processor.
>
> After unbinding, it does not find the bean, so it is null.
>
> When I re-bind under the same name, it shows the proper class.
>
> So, that all seems like I would expect.  However, when I send an exchange
> to a route to use this processor, which references the bean by name, it is
> still using the original/temporary processor that I used "unbind" on!.  I
> confirmed this because that temporary processor prints out a LOG message at
> the error level.
>
> What could the problem be?
>
> Thanks,
> Steve
>


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


Re: How to instantiate out Exchange manually (or automatically)

2023-11-28 Thread Claus Ibsen
Hi

See this FAQ
https://camel.apache.org/manual/faq/using-getin-or-getout-methods-on-exchange.html

On Tue, Nov 21, 2023 at 5:11 PM Gallais, Baptiste
 wrote:

> Hello,
>
> Since the deprecation of inExchange.setOut and inExchange.getOut, i'd like
> to know if there is a solution to instanciate the out without using the
> setOut method.
> Currently, using the getMessage or setMessage only affect the In Exchange
> (which seems to be perfectly normal).
>
>
> Camel version : 3.20.2
>
> Spring version : 5.3.24
>
> Spring boot version : 2.7.6
>
> Thank you for your help,
> Have a nice day !
>
> Baptiste
> Ce message et toutes les pi?ces jointes (ci-apr?s le ) sont
> confidentiels et ?tablis ? l'intention exclusive de ses destinataires.
> Toute utilisation de ce message non conforme ? sa destination, toute
> diffusion ou toute publication, totale ou partielle, est interdite, sauf
> autorisation expresse. Si vous recevez ce message par erreur, merci de le
> d?truire sans en conserver de copie et d'en avertir imm?diatement
> l'exp?diteur. Internet ne permettant pas de garantir l'int?grit? de ce
> message, la Caisse des D?p?ts et Consignations d?cline toute responsabilit?
> au titre de ce message s'il a ?t? modifi?, alt?r?, d?form? ou falsifi?. Par
> ailleurs et malgr? toutes les pr?cautions prises pour ?viter la pr?sence de
> virus dans nos envois, nous vous recommandons de prendre, de votre c?t?,
> les mesures permettant d'assurer la non-introduction de virus dans votre
> syst?me informatique. This email message and any attachments ("the email")
> are confidential and intended only for the recipient(s) indicated. If you
> are not an intended recipient, please be advised that any use,
> dissemination, forwarding or copying of this email whatsoever is prohibited
> without prior written consent of Caisse des Depots et Consignations. If you
> have received this email in error, please delete it without saving a copy
> and notify the sender immediately. Internet emails are not necessarily
> secure, and Caisse des Depots et Consignations declines responsibility for
> any changes that may have been made to this email after it was sent. While
> we take all reasonable precautions to ensure that viruses are not
> transmitted via emails, we recommend that you take your own measures to
> prevent viruses from entering your computer system.
>
> Interne
>


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


Re: Trying to simplify my component by using a reifier

2023-11-28 Thread Claus Ibsen
Hi

If you need to create the RecipientListProcessor then you dont
necessary have to use reifier to do it.

We have a few EIPs that are created via annotations
https://github.com/apache/camel/blob/5235319d94fbb82f479ca3085b0780c0f144111b/core/camel-api/src/main/java/org/apache/camel/spi/AnnotationBasedProcessorFactory.java#L44

You can just create the processor yourself and configure it accordingly.




On Tue, Nov 28, 2023 at 12:51 AM Steve973  wrote:

> Hello.  I am attempting to simplify my Dynamic Router EIP component by
> using the existing RecipientList implementation from camel-core.
>
> I was looking at the RecipientListReifier, even though I will not be adding
> anything to the Camel DSL.  It looks like it would be perfect for setting
> up the RecipientList instance.  I can take my configuration class, and
> adapt it to a RecipientListDefinition instance.  The problem that I am
> encountering is that the RecipientListReifier constructor wants a Route
> instance.  When routing recipients send their subscription information to
> the dynamic router component through its control channel, this is not the
> route that the actual routing will occur on.  So I have no idea what Route
> instance I can provide to the Reifier constructor.  Furthermore, when the
> dynamic router receives a message, the producer simply calls the processor,
> so there is no real route to speak of, even during runtime dynamic routing.
>
> My questions are:
>
> 1. Is this a decent approach?  After a recent code review, it occurred to
> me that I needed to simplify everything, and this would do that.  The
> component would only need to manage subscriptions, and evaluate exchanges
> for recipients.
>
> 2. What should I use as the Route instance for the Reifier constructor?
> Would it be a good idea to create a RouteBuilder for each dynamic routing
> channel that subscribers are using?  It would go from "direct:channelName"
> and then to the processor.  That still leaves me confused about how to
> use my component/endpoint configuration to set the options on the
> RecipientList through the Reifier.  It's a chicken/egg scenario:  the
> RecipientListReifier needs the Route, and the Route needs the processor.
>
> 3. What other approach am I missing that might be better than this?
>
> Thanks,
> Steve
>


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


Re: camel-http: $USER:$PASSWORD@$SERVER notation for basic auth no longer supported?

2023-11-22 Thread Claus Ibsen
On Wed, Nov 22, 2023 at 7:17 PM Pascal Schumacher 
wrote:

> Hi,
>
> while migrating a Project from Camel 3 to Camel 4 I noticed that the
> $USER:$PASSWORD@$SERVER notation for basic authentication no longer works.
>
> `to("https://USER:PASSWORD@localhost
> :8080/example?authenticationPreemptive=true")`
> works in Camel 3.21.2
>
> but fails in Camel 4.0.3 with:
>
> org.apache.hc.client5.http.ClientProtocolException: No credentials for
> preemptive authentication
> at
>
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:173)
> at
>
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
> at
>
> org.apache.camel.component.http.HttpProducer.executeMethod(HttpProducer.java:487)
> at
> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:269)
> at
>
> org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:65)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
> at
>
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:475)
> at
>
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.executeReactiveWork(DefaultReactiveExecutor.java:196)
> at
>
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:164)
> at
>
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:163)
> at
>
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:383)
> at
>
> org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:81)
> at
>
> org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:32)
> at
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:132)
> at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:736)
> at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:696)
> at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:674)
> at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:330)
> at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:245)
> at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1239)
> at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1229)
> at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1122)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> at java.base/java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.hc.core5.http.HttpException: No credentials for
> preemptive authentication
> at
>
> org.apache.camel.component.http.PreemptiveAuthExecChainHandler.execute(PreemptiveAuthExecChainHandler.java:52)
> at
>
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
>
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
> ... 25 common frames omitted
>
> I did not find anything related to this in
> https://camel.apache.org/manual/camel-4-migration-guide.html
>
> Did I miss something? Is this an intentional behavior change or a bug?
>
> It works if I use
> `to("
> https://localhost:8080/example?authenticationPreemptive=true=USER=PAS

Re: Issues by using Camel Report Maven Plugin 3.21.x

2023-11-22 Thread Claus Ibsen
Hi

No we have not seen this. You are welcome to investigate. And can you with
an older Maven version.

On Wed, Nov 22, 2023 at 5:59 PM Esslinger, Michael <
michael.esslin...@barmer.de> wrote:

> Hi,
>
> has anybody used the Camel Report Maven Plugin version 3.21.x with the
> Maven Version 3.9.2 and got the following ERROR:
>
> [ERROR] Failed to execute goal
> org.apache.camel:camel-report-maven-plugin:3.21.2:validate (default) on
> project xxx: Execution default of goal
> org.apache.camel:camel-report-maven-plugin:3.21.2:validate failed: A
> required class was missing while executing
> org.apache.camel:camel-report-maven-plugin:3.21.2:validate:
> org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory
>
> Any ideas of how to fix that?
>
> Regards
> Michael
>
>

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


Re: aggregate EIP: wrong correlation key set for aggregate exchanges

2023-11-21 Thread Claus Ibsen
+ with correlation key: batch-1
> 06:34:33.367 TRACE [ file://in] e.AggregateProcessor : onAggregation +++
> end  +++ with correlation key: batch-1
> 06:34:33.367 DEBUG [ file://in] e.AggregateProcessor : Aggregation
> complete for correlation key batch-1 sending aggregated exchange:
> Exchange[7F40FFF506AA26C-000D]
> 06:34:33.367 DEBUG [ file://in] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-000D]
> 06:34:33.370 DEBUG [ file://in] e.AggregateProcessor : Aggregation
> complete for correlation key batch-1 sending aggregated exchange:
> Exchange[7F40FFF506AA26C-0009]
> 06:34:33.370 DEBUG [ file://in] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0009]
> 06:34:33.371 DEBUG [ file://in] e.AggregateProcessor : Aggregation
> complete for correlation key batch-1 sending aggregated exchange:
> Exchange[7F40FFF506AA26C-0005]
> 06:34:33.371 DEBUG [ file://in] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0005]
> 06:34:33.371 DEBUG [ file://in] e.AggregateProcessor : Aggregation
> complete for correlation key batch-1 sending aggregated exchange:
> Exchange[7F40FFF506AA26C-0001]
> 06:34:33.371 DEBUG [ file://in] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0001]
> 06:34:33.392 DEBUG [Aggregator] zip-files-2.yaml:106 : Processing batch
> batch-4 from exchange 7F40FFF506AA26C-000D
> 06:34:33.411  INFO [Aggregator] zip-files-2.yaml:132 : Wrote batch-4 to
> in/send/Processing-20231120063433118-batch-4.zip
> 06:34:33.413  INFO [Aggregator] zip-files-2.yaml:135 : Send batch-4
> 06:34:33.414 TRACE [Aggregator] e.AggregateProcessor : Aggregated exchange
> onComplete: Exchange[7F40FFF506AA26C-000D]
> 06:34:33.415 TRACE [Aggregator] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-000D] complete.
> 06:34:33.424 DEBUG [Aggregator] zip-files-2.yaml:106 : Processing batch
> batch-2 from exchange 7F40FFF506AA26C-0009
> 06:34:33.435 TRACE [Aggregator] e.AggregateProcessor : Aggregated exchange
> onComplete: Exchange[7F40FFF506AA26C-0009]
> 06:34:33.435 TRACE [Aggregator] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0009] complete.
> 06:34:33.445 DEBUG [Aggregator] zip-files-2.yaml:106 : Processing batch
> batch-3 from exchange 7F40FFF506AA26C-0005
> 06:34:33.460 TRACE [Aggregator] e.AggregateProcessor : Aggregated exchange
> onComplete: Exchange[7F40FFF506AA26C-0005]
> 06:34:33.460 TRACE [Aggregator] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0005] complete.
> 06:34:33.466 DEBUG [Aggregator] zip-files-2.yaml:106 : Processing batch
> batch-4 from exchange 7F40FFF506AA26C-0001
> 06:34:33.483  INFO [Aggregator] zip-files-2.yaml:132 : Wrote batch-4 to
> in/send/Processing-20231120063433118-batch-4.zip
> 06:34:33.485  INFO [Aggregator] zip-files-2.yaml:135 : Send batch-4
> 06:34:33.486 TRACE [Aggregator] e.AggregateProcessor : Aggregated exchange
> onComplete: Exchange[7F40FFF506AA26C-0001]
> 06:34:33.486 TRACE [Aggregator] e.AggregateProcessor : Processing
> aggregated exchange: Exchange[7F40FFF506AA26C-0001] complete.
> 06:34:34.962  INFO [2-thread-1] ainLifecycleStrategy : Duration max idle
> triggering shutdown of the JVM
> 06:34:34.965  INFO [melContext] AbstractCamelContext : Apache Camel 4.2.0
> (zip-files-2) is shutting down (timeout:5s0ms)
> 06:34:34.982  INFO [melContext] AbstractCamelContext : Routes stopped
> (stopped:1)
> 06:34:34.982  INFO [melContext] AbstractCamelContext : Stopped
> zip-files (file://in)
> 06:34:34.994  INFO [melContext] AbstractCamelContext : Apache Camel 4.2.0
> (zip-files-2) shutdown in 28ms (uptime:3s)
> 06:34:34.995  INFO [  main] mel.main.MainSupport : Apache Camel
> (JBang) 4.2.0 shutdown
>


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


Re: Event / Exchange / Message timestamps

2023-11-20 Thread Claus Ibsen
Hi

No see the javadoc

You need to turn on event timestamps

On Mon, Nov 20, 2023 at 4:32 PM ski n  wrote:

> In Camel 3.20.8 I use the event notifier (as described here
> https://dzone.com/articles/event-notifier-apache-camel).
>
> One of the things I try to get timestamps. These timestamps are available
> on several levels:
>
> 1. Event level
> 2. Exchange level
> 3. Message level
>
> When I used the following the get the timestamps:
>
> CamelEvent.ExchangeEvent exchangeEvent = (CamelEvent.ExchangeEvent) event;
>
> // Get the message exchange from exchange event
> Exchange exchange = exchangeEvent.getExchange();
>
> System.out.println("Timestamp 1 " + event.getTimestamp());
> System.out.println("Timestamp 2 " + exchangeEvent.getTimestamp());
> System.out.println("Timestamp 3 " + exchange.getCreated());
> System.out.println("Timestamp 4 " +
> exchange.getIn().getMessageTimestamp());
>
>
> Only timestamp 3 (exchange.getCreated()) gives a timestamp, but the others
> are 0. For message timestamps this can be correct (as that depends on
> ActiveMQ etc), but shouldn't the event always a timestamp?
>
> Raymond
>


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


Re: Question about Lombok use

2023-11-19 Thread Claus Ibsen
Hi

Okay it may sound harsh when I and other long term Camel core team
members say No to X or Y.
However its a very large code base and a project that is ongoing for
decades, currently 16 and half years old.
People come and go, and it's important that everything in Camel can be
picked up and maintained - also components contributed originally be
someone whom have left.
For example if you leave and we have to keep maintaining the dynamic router
component, and we have not spent hours into its code base, and then have
trouble doing so
because of bringing in the original author's favourite set of tools.
And even more now with a lot of focus on CVEs are other scanner tools that
make people nervous if they report something, and you have to constantly
chase around and update dependencies.

The code must be easier to maintain and last for decades. And this means
its standard Java only, and minimal dependencies. And uses Maven only as a
build system.
And that it must work with build from Maven (frankly the maven wrapper we
have in the source).
The camel builds system is also doing more than just compiling. We have all
components generate metadata that gets into a camel-catalog, and also into
generated DSLs (endpoint and component DSLs).
And we have a route parser library that can scan the source code and
generate a "visual report" etc that we use for tooling
(camel-maven-report-plugin) etc.
All of this makes it harder to maintain if components are not uniform
around being standard Java only.

The only place we have some non Java code is in the DSLs for groovy, kotlin
etc.

And also the camel-yaml-dsl unit tests are groovy based. But that is a semi
mistake and we eventually need to migrate that to plain Java.
But those tests are 95% focused only on loading some YAML and parse it via
the yaml-dsl parser, and not a ton of groovy code.

On the other side its is 100% okay to contribute examples that used Kotlin,
Lombok and have them on your own code repositories,
but also contribute some of these to Apache Camel in our example repos.
However the vast majority of those examples should be maintains Java and
easy to maintain as well.
But we are fine with having a set of examples that uses what I mentioned
before.

And as a component developer you will find out - okay I need to add many
unit tests to cover all its features and help ensure higher QE and ... yes
that means something you
need to write more unit tests code in standard Java with JUnit. And yes we
use docker test containers for integration tests, and there is the
"camel-test-infra" that can make this easier.




On Sun, Nov 19, 2023 at 2:12 PM Claus Ibsen  wrote:

> Hi
>
> No lombok is not allowed - we have as minimal dependency as possible.
>
>
>
> On Sun, Nov 19, 2023 at 2:06 PM Steve973  wrote:
>
>> Hello.  I completely understand the perspective of limiting the addition
>> of
>> libraries for various reasons, and especially when the library is included
>> in the distribution.  I know that I have asked about Lombok before, but it
>> is great for eliminating a lot of boilerplate code, especially when a
>> class
>> cannot be created as a Java 17 record.  Also, Lombok is a compile-only
>> dependency that uses annotation processing to generate the aforementioned
>> boilerplate.  The license also seems compatible.  Is this something that
>> can be used in the coding of a component?  If not, could somebody please
>> explain the problem with it?
>>
>> Thanks,
>> Steve
>>
>
>
> --
> 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: Question about Lombok use

2023-11-19 Thread Claus Ibsen
Hi

No lombok is not allowed - we have as minimal dependency as possible.



On Sun, Nov 19, 2023 at 2:06 PM Steve973  wrote:

> Hello.  I completely understand the perspective of limiting the addition of
> libraries for various reasons, and especially when the library is included
> in the distribution.  I know that I have asked about Lombok before, but it
> is great for eliminating a lot of boilerplate code, especially when a class
> cannot be created as a Java 17 record.  Also, Lombok is a compile-only
> dependency that uses annotation processing to generate the aforementioned
> boilerplate.  The license also seems compatible.  Is this something that
> can be used in the coding of a component?  If not, could somebody please
> explain the problem with it?
>
> Thanks,
> Steve
>


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


Re: Jetty Component how to add additional steps after send http response back to the client

2023-11-19 Thread Claus Ibsen
Hi

You can also look at using onCompletion
https://camel.apache.org/manual/oncompletion.html

On Sat, Nov 18, 2023 at 8:36 PM Claus Ibsen  wrote:

> Hi
>
> I would also add that HTTP servers like Tomcat, Jetty, JBoss etc have an
> access log that logs how long time each request takes. And they often have
> a API / plugin you can use to have your custom code triggered by the HTTP
> server
> so you can do any kind of "how long time it takes" you need.
>
>
> On Sat, Nov 18, 2023 at 8:34 PM Claus Ibsen  wrote:
>
>> Hi
>>
>> Camel will send back the response at the end of the route in the
>> consumer, so what you do in that route example will not work.
>> However if you want to do some kind of custom logging of how long it
>> takes, then Camel Jetty has send back the response to the client, when the
>> UnitOfWork is done.
>> So you can use Camel's UoW done to do any custom code for "backend
>> response timestamp ...".
>>
>> See the docs for UnitOfWork or its also covered in the CiA2 book.
>>
>>
>>
>> On Tue, Nov 14, 2023 at 5:11 AM Han Yainsun  wrote:
>>
>>> Dear Camel Community and Camel users,
>>>
>>> Greetings to you!
>>>
>>> Camel version: 3.20.4
>>> Spring Boot version: 2.7.11
>>> JDK: Amazon Corretto 17
>>> Platform: Windows server 2019
>>> IDE: IntelliJ IDEA 2021.3.2 (Community Edition)
>>>
>>> I have an requirement that need calculate each message process time,
>>> incould total process time and backend process time. the route likes below,
>>> it seems that the jetty managed the http session and send the response
>>> back to client automatically at the end of route.
>>>
>>> Is it possible to explicitly inform jetty send the resonse at specific
>>> point?
>>>
>>> Thansk in advance.
>>>
>>> from("jetty:http://0.0.0.0:8080/test;)
>>> .process(exchange -> exchange.setProperty("inbound timestamp",
>>> System.currentTimeMillis()))
>>> .to("http://localhost/mockbackend;)
>>> .process(exchange -> exchange.setProperty("backend respond timestamp",
>>> System.currentTimeMillis()))
>>> .setBody(constant("hello"))
>>> // I expect jetty send response back to client here.
>>> .process(exchange -> exchange.setProperty("backend respond timestamp",
>>> System.currentTimeMillis()));
>>>
>>>
>>
>> --
>> 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: How to check if an message on an exchange has attachments?

2023-11-19 Thread Claus Ibsen
Hi

I am adding a function to simple language so this can be done via simple in
the future
https://issues.apache.org/jira/browse/CAMEL-20127

At first its a bit long in the tooth

${messageAs(org.apache.camel.language.simple.MyAttachmentMessage).hasAttachments}



On Sun, Nov 19, 2023 at 12:55 PM Claus Ibsen  wrote:

> Hi
>
> You can look in the source of camel-attachments and see how they are
> stored and then do it by checking for exchange property
> key CamelAttachmentObjects exists and is not empty
>
> On Tue, Nov 14, 2023 at 9:21 PM ski n  wrote:
>
>> As a workaround, I implemented it as follows:
>>
>> public class MyBean {
>>
>>public boolean hasAttachements(Exchange exchange) {
>>return
>> exchange.getIn(AttachmentMessage.class).hasAttachments();
>>}
>>
>> }
>>
>> And then call it from the Java DSL as:
>>
>> > method="hasAttachements"/>
>>
>> If there are better solution, I like to hear it.
>>
>> Raymond
>>
>>
>> On Tue, Nov 14, 2023 at 8:12 PM ski n  wrote:
>>
>> >
>> > I need to check if a message has an attachment.
>> >
>> > In Camel2 I used the following expression:
>> >
>> > ${exchange.getIn().hasAttachments}
>> >
>> > As attachment was modularized in Camel 3, the hasAttachments method
>> isn't
>> > directly available on the exchange anymore (it now extends Message).
>> >
>> > Based on the documentation:
>> >
>> > https://camel.apache.org/components/3.20.x/others/attachments.html
>> >
>> > I tried:
>> >
>> >
>> ${exchange.getIn(AttachmentMessage.class).hasAttachments}
>> >
>> > Using Java code directly this works, but from the XML DSL this gives:
>> >
>> > org.apache.camel.component.bean.ParameterBindingException: Error during
>> > parameter binding on method: public abstract java.lang.Object
>> > org.apache.camel.Exchange.getIn(java.lang.Class) at parameter #0 with
>> type:
>> > class java.lang.Class with value type: class java.lang.String and value:
>> > AttachmentMessage.class
>> >
>> > The parameter is seen as a String object, instead of AttachmentMessage
>> > object. How to properly pass the type parameter in the XML DSL with a
>> > simple expression? If there is an alternative way to check attachments
>> this
>> > also fine, but I'm trying to avoid using processors or bean invocation
>> > though.
>> >
>> > 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: How to check if an message on an exchange has attachments?

2023-11-19 Thread Claus Ibsen
Hi

You can look in the source of camel-attachments and see how they are
stored and then do it by checking for exchange property
key CamelAttachmentObjects exists and is not empty

On Tue, Nov 14, 2023 at 9:21 PM ski n  wrote:

> As a workaround, I implemented it as follows:
>
> public class MyBean {
>
>public boolean hasAttachements(Exchange exchange) {
>return exchange.getIn(AttachmentMessage.class).hasAttachments();
>}
>
> }
>
> And then call it from the Java DSL as:
>
>  method="hasAttachements"/>
>
> If there are better solution, I like to hear it.
>
> Raymond
>
>
> On Tue, Nov 14, 2023 at 8:12 PM ski n  wrote:
>
> >
> > I need to check if a message has an attachment.
> >
> > In Camel2 I used the following expression:
> >
> > ${exchange.getIn().hasAttachments}
> >
> > As attachment was modularized in Camel 3, the hasAttachments method isn't
> > directly available on the exchange anymore (it now extends Message).
> >
> > Based on the documentation:
> >
> > https://camel.apache.org/components/3.20.x/others/attachments.html
> >
> > I tried:
> >
> >
> ${exchange.getIn(AttachmentMessage.class).hasAttachments}
> >
> > Using Java code directly this works, but from the XML DSL this gives:
> >
> > org.apache.camel.component.bean.ParameterBindingException: Error during
> > parameter binding on method: public abstract java.lang.Object
> > org.apache.camel.Exchange.getIn(java.lang.Class) at parameter #0 with
> type:
> > class java.lang.Class with value type: class java.lang.String and value:
> > AttachmentMessage.class
> >
> > The parameter is seen as a String object, instead of AttachmentMessage
> > object. How to properly pass the type parameter in the XML DSL with a
> > simple expression? If there is an alternative way to check attachments
> this
> > also fine, but I'm trying to avoid using processors or bean invocation
> > though.
> >
> > Raymond
> >
> >
>


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


Re: Is URI redirection possible?

2023-11-19 Thread Claus Ibsen
Hi

We have migration guides so it's fine to add in the docs that end users
need to migrate.
Also since its isolated to a single component then most users is not
affected in any way.





On Sun, Nov 19, 2023 at 12:50 PM Steve973  wrote:

> Hello.  In a component, if I want to change the format of a URI, and still
> want to retain compatibility with the previous URI format, is there a way
> (within the module) to redirect to the new URI after translation?  I want
> to split some functionality off to another endpoint.  So, rather than
> deprecate the old code, it would be cleaner if I could redirect, if
> possible.
>
> Thank you!
> Steve
>


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


Re: Jetty Component how to add additional steps after send http response back to the client

2023-11-18 Thread Claus Ibsen
Hi

I would also add that HTTP servers like Tomcat, Jetty, JBoss etc have an
access log that logs how long time each request takes. And they often have
a API / plugin you can use to have your custom code triggered by the HTTP
server
so you can do any kind of "how long time it takes" you need.


On Sat, Nov 18, 2023 at 8:34 PM Claus Ibsen  wrote:

> Hi
>
> Camel will send back the response at the end of the route in the consumer,
> so what you do in that route example will not work.
> However if you want to do some kind of custom logging of how long it
> takes, then Camel Jetty has send back the response to the client, when the
> UnitOfWork is done.
> So you can use Camel's UoW done to do any custom code for "backend
> response timestamp ...".
>
> See the docs for UnitOfWork or its also covered in the CiA2 book.
>
>
>
> On Tue, Nov 14, 2023 at 5:11 AM Han Yainsun  wrote:
>
>> Dear Camel Community and Camel users,
>>
>> Greetings to you!
>>
>> Camel version: 3.20.4
>> Spring Boot version: 2.7.11
>> JDK: Amazon Corretto 17
>> Platform: Windows server 2019
>> IDE: IntelliJ IDEA 2021.3.2 (Community Edition)
>>
>> I have an requirement that need calculate each message process time,
>> incould total process time and backend process time. the route likes below,
>> it seems that the jetty managed the http session and send the response
>> back to client automatically at the end of route.
>>
>> Is it possible to explicitly inform jetty send the resonse at specific
>> point?
>>
>> Thansk in advance.
>>
>> from("jetty:http://0.0.0.0:8080/test;)
>> .process(exchange -> exchange.setProperty("inbound timestamp",
>> System.currentTimeMillis()))
>> .to("http://localhost/mockbackend;)
>> .process(exchange -> exchange.setProperty("backend respond timestamp",
>> System.currentTimeMillis()))
>> .setBody(constant("hello"))
>> // I expect jetty send response back to client here.
>> .process(exchange -> exchange.setProperty("backend respond timestamp",
>> System.currentTimeMillis()));
>>
>>
>
> --
> 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: Jetty Component how to add additional steps after send http response back to the client

2023-11-18 Thread Claus Ibsen
Hi

Camel will send back the response at the end of the route in the consumer,
so what you do in that route example will not work.
However if you want to do some kind of custom logging of how long it takes,
then Camel Jetty has send back the response to the client, when the
UnitOfWork is done.
So you can use Camel's UoW done to do any custom code for "backend response
timestamp ...".

See the docs for UnitOfWork or its also covered in the CiA2 book.



On Tue, Nov 14, 2023 at 5:11 AM Han Yainsun  wrote:

> Dear Camel Community and Camel users,
>
> Greetings to you!
>
> Camel version: 3.20.4
> Spring Boot version: 2.7.11
> JDK: Amazon Corretto 17
> Platform: Windows server 2019
> IDE: IntelliJ IDEA 2021.3.2 (Community Edition)
>
> I have an requirement that need calculate each message process time,
> incould total process time and backend process time. the route likes below,
> it seems that the jetty managed the http session and send the response
> back to client automatically at the end of route.
>
> Is it possible to explicitly inform jetty send the resonse at specific
> point?
>
> Thansk in advance.
>
> from("jetty:http://0.0.0.0:8080/test;)
> .process(exchange -> exchange.setProperty("inbound timestamp",
> System.currentTimeMillis()))
> .to("http://localhost/mockbackend;)
> .process(exchange -> exchange.setProperty("backend respond timestamp",
> System.currentTimeMillis()))
> .setBody(constant("hello"))
> // I expect jetty send response back to client here.
> .process(exchange -> exchange.setProperty("backend respond timestamp",
> System.currentTimeMillis()));
>
>

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


Re: Route group

2023-11-17 Thread Claus Ibsen
1 see the DSL doc - its not much doc as its just a human description and
has no logic
2 no
3 no

This is not a desired feature and to APIs and controllers to manage
lifecycle of routes is already complex and vast and need to deal with many
things.



On Fri, Nov 17, 2023 at 10:58 AM ski n  wrote:

> OK, then another three questions (one less):
>
> 1. Do you have a link to the documentation on this feature (can find it,
> only jgroups)
> 2. Is an API for this (a new one or enhancement of routecontroller API)
> planned
> 3. If the API is not planned yet, should I make a Jira issue for this as
> enhancement request?
>
> Raymond
>
> On Fri, Nov 17, 2023 at 9:07 AM Claus Ibsen  wrote:
>
> > 1 2 3 yes
> > 4 no
> >
> >
> >
> > On Fri, Nov 17, 2023 at 8:26 AM ski n  wrote:
> >
> > > Recently, a “route group“ was added:
> > >
> > > https://issues.apache.org/jira/browse/CAMEL-11669
> > >
> > > The ticket mentioned that the route group is a “logical group” that one
> > or
> > > more routes are attached to. Some questions about this new feature:
> > >
> > > 1. Is the syntax still the same as in the ticket?
> > > 2. Is this already documented?
> > > 3. Is this also part of Camel 4? (The fixed version is 3.22.0. Probably
> > > this also added to Camel 4)
> > > 4. Is there also an API for this feature (for example to retrieve the
> > group
> > > of a route, or to start/stop a complete group of routes). I have
> similar
> > > functionality in Assimbly (a group of routes is called a flow there)
> and
> > > would rather port this functionality to Camel 4 if if rich enough.
> > >
> > > What I currently do to manage a group of routes is to have routeid that
> > is
> > > build up like this:
> > >
> > > groupid_routeid
> > >
> > > Then I can stop a group like this:
> > >
> > > List routeList = getRoutesByFlowId(id);
> > >
> > > for (Route route : routeList) {
> > > String routeId = route.getId();
> > > log.info("Stopping step | flowid=" + route.getId());
> > > routeController.stopRoute(routeId, stopTimeout, TimeUnit.SECONDS);
> > > context.removeRoute(routeId);
> > > if(route.getConfigurationId()!=null) {
> > >removeRouteConfiguration(route.getConfigurationId());
> > > }
> > > }
> > >
> > > The getRoutesByFlouwId gets the related routes for a group and then
> loops
> > > them one by one. This however with large groups can take a while. Would
> > be
> > > nice to do something like this:
> > >
> > > routeController.stopGroup("groupId")
> > >
> > > 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: Route group

2023-11-17 Thread Claus Ibsen
1 2 3 yes
4 no



On Fri, Nov 17, 2023 at 8:26 AM ski n  wrote:

> Recently, a “route group“ was added:
>
> https://issues.apache.org/jira/browse/CAMEL-11669
>
> The ticket mentioned that the route group is a “logical group” that one or
> more routes are attached to. Some questions about this new feature:
>
> 1. Is the syntax still the same as in the ticket?
> 2. Is this already documented?
> 3. Is this also part of Camel 4? (The fixed version is 3.22.0. Probably
> this also added to Camel 4)
> 4. Is there also an API for this feature (for example to retrieve the group
> of a route, or to start/stop a complete group of routes). I have similar
> functionality in Assimbly (a group of routes is called a flow there) and
> would rather port this functionality to Camel 4 if if rich enough.
>
> What I currently do to manage a group of routes is to have routeid that is
> build up like this:
>
> groupid_routeid
>
> Then I can stop a group like this:
>
> List routeList = getRoutesByFlowId(id);
>
> for (Route route : routeList) {
> String routeId = route.getId();
> log.info("Stopping step | flowid=" + route.getId());
> routeController.stopRoute(routeId, stopTimeout, TimeUnit.SECONDS);
> context.removeRoute(routeId);
> if(route.getConfigurationId()!=null) {
>removeRouteConfiguration(route.getConfigurationId());
> }
> }
>
> The getRoutesByFlouwId gets the related routes for a group and then loops
> them one by one. This however with large groups can take a while. Would be
> nice to do something like this:
>
> routeController.stopGroup("groupId")
>
> Raymond
>


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


Re: Stream closed while unzipping in a container

2023-11-03 Thread Claus Ibsen
Hi

Which Camel version, and have you tried with latest releases.

On Thu, Nov 2, 2023 at 9:00 PM ski n  wrote:

> I have a route where I want to unzip zipfile (containing 1 or more files).
> This is the route:
>
> ZipFileDataFormat zipFile = new ZipFileDataFormat();
> zipFile.setUsingIterator(true);
>
>
> from("file:src/test/resources/org/apache/camel/dataformat/zipfile/?delay=1000=true")
> .unmarshal(zipFile)
> .split(bodyAs(Iterator.class)).streaming()
> .process(new UnZippedMessageProcessor())
> .end();
>
> When I tested this locally on my Windows machine everything goes well,
> but when I pack in into a container (Alpine)
>
> and run it on a server (Ubuntu) I get the following error:
>
> org.apache.camel.StreamCacheException: Error during type conversion
> from type: org.apache.camel.dataformat.zipfile.ZipInputStreamWrapper
>  to the required type: org.apache.camel.StreamCache with value
> org.apache.camel.dataformat.zipfile.ZipInputStreamWrapper@10538c67
> due to org.apache.camel.TypeConversionException: Error during type
> conversion from type:
> org.apache.camel.dataformat.zipfile.ZipInputStreamWrapper
>  to the required type: org.apache.camel.StreamCache with value
> org.apache.camel.dataformat.zipfile.ZipInputStreamWrapper@10538c67 due
> to java.io.IOException: Stream closed
>
> Based on the error message I'm unsure, is this really a conversion
> error or more a permission problem to the spooldirectory or is this
> something else?
>
> Raymond
>


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


Re: camel-k access context from different integrations

2023-10-30 Thread Claus Ibsen
Hi

No, they run in their own pod.

But you can run them together in the same pod but then it will be in the
same camel / jvm

kamel run a.groovy b.groovy



On Mon, Oct 30, 2023 at 5:30 PM Narsi Reddy Nallamilli <
narsi.nallami...@gmail.com> wrote:

> Hi,
>
> Can we access the context of one camel-k integration from another camel-k
> integration?
>
> e.g a.groovy has bean 'a'
> Can we access bean 'a' from b.groovy ?
>
> Thank you,
> Narsi
>


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


Re: DefaultMaskingFormatter

2023-10-21 Thread Claus Ibsen
Hi

Log masking is only a best effort. What kind of message content do you
have, can you post an example.
Also tell us what Camel version you use. And try with the latest release
also.

If you have a very special message content then you can also implement your
own message formatter and do your own masking.

On Sat, Oct 21, 2023 at 8:57 PM first last 
wrote:

> Hello,
>
> When masking is enabled on a log statement that formats the entire
> exchange, patterns used to identify message type (e.g.
> source.startsWith("<")) fail, and the whole message body is logged.
> I am unsure if this is a known issue, of I have configured masking
> incorrectly.
>
> Best regards
>


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


Re: YAML DSL route loader seems to ignore "id" attribute

2023-10-19 Thread Claus Ibsen
.version}
> > 
> > 
> > 
> >
> > Application.java:
> > @SpringBootApplication
> > public class Application {
> > public static void main(String[] args) {
> > SpringApplication.run(Application.class, args);
> > }
> > }
> >
> > Routes (placed in $PROJECT_HOME/camel/, autodetected by
> > camel-spring-boot-starter):
> > myroute1.xml:
> > http://camel.apache.org/schema/spring;>
> > 
> > 
> > 
> > Hello Camel!
> > 
> > 
> > 
> > 
> >
> > myroute2.yaml:
> > - from:
> > id: myRoute2
> > uri: timer:tick
> > steps:
> > - setBody:
> > constant: Hello Camel!
> > - to:
> > uri: log:info2
> >
> > I understand that both routes should be doing the same thing and the only
> > difference is the ID.
> >
> > When I start the application, the log shows this:
> > ...
> > 023-10-19T10:41:34.142+02:00  INFO 17160 --- [   main]
> > o.a.c.impl.engine.AbstractCamelContext   : Routes startup (started:2)
> > 2023-10-19T10:41:34.142+02:00  INFO 17160 --- [   main]
> > o.a.c.impl.engine.AbstractCamelContext   : Started myRoute1
> > (timer://tick)
> > 2023-10-19T10:41:34.142+02:00  INFO 17160 --- [   main]
> > o.a.c.impl.engine.AbstractCamelContext   : Started route1
> (timer://tick)
> > 2023-10-19T10:41:34.142+02:00  INFO 17160 --- [   main]
> > o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 4.0.1 (camel-1)
> > started in 15ms (build:0ms init:0ms start:15ms)
> > ...
> >
> > Note that the XML route was loaded using the correct ID (myRoute1), but
> > the YAML is using a generic ID (route1). I would expect that the output
> is:
> > Routes startup (started:2)
> > Started myRoute1 (timer://tick)
> > Started myRoute2 (timer://tick)
> > Apache Camel 4.0.1 (camel-1) started in ...
> >
> > Tested and verified with Camel v4.0.1 and v4.1.0
> >
> > So, it seems like a bug in the YAML route builder. What do you think?
> >
> > Thank you & kind regards,
> > Steffen
> >
> > // added to skip company footer: 27948 //
>


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


Re: HttpServletRequest and Platform HTTP

2023-10-18 Thread Claus Ibsen
On Wed, Oct 18, 2023 at 4:26 PM Fyodor Kravchenko  wrote:

> Hi, thank you!
>
> Good that the http headers are abstracted from the actual underlying
> http technology.
>
> What about Cookies? Will getHeader(Exchange.COOKIE_HANDLER) work with
> the Platform Http? Couldn't find if I can specify anything like
> "|?cookieHandler=#exchangeCookieHandler|" in the route url... Or can I
> access and parse the multiple cookie *headers* from the Message?
>
> Accessing the Vert.x objects in Camel 4.2.0 is good, but what if we
> decide to switch platform in the future (again :) Would be nice to have
> a cookie handler or some other session abstraction.
>
>
There is no cookie handler for platform-http. That would require
camel-platform-http-vertx to add support for this.
You are welcome to look into this and if possible create a JIRA and send PR.





> Regards,
>
> Fyodor
>
> On 17.10.2023 10:59, Claus Ibsen wrote:
> > Hi
> >
> > You usually just set the a camel message header with the HTTP key/value
> for
> > redirect, something ala:
> >
> >
> > exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, 302);
> >  exchange.getMessage().setHeader("location",
> "http
> > url of the redirect location");
> >
> >
> > On Mon, Oct 16, 2023 at 1:17 PM Fyodor Kravchenko 
> wrote:
> >
> >> Thank you, Claus, I'll get familiarized myself with the Vert.X
> >> internals! In the meantime, there must be some way to "send redirect"
> >> (respond with the 302 header) by the Camel means, can you please give
> >> some hint on that?
> >>
> >> On 16.10.2023 11:18, Claus Ibsen wrote:
> >>> Hi
> >>>
> >>> I created a ticket
> >>> https://issues.apache.org/jira/browse/CAMEL-19994
> >>>
> >>> Yeah check vertx-http docs what it offers
> >>> https://vertx.io/docs/vertx-web/java/
> >>>
> >>>
> >>>
> >>> On Mon, Oct 16, 2023 at 10:12 AM Fyodor Kravchenko 
> >> wrote:
> >>>> Hi, thanks, I get that. And without the Vertx object, what would be a
> >>>> correct way to obtain somewhat like a session attributes? I'm having
> >>>> trouble to navigate the documentation and find "vertx-http"
> description,
> >>>> can't get how to see and set, for example, the cookies. There are 3
> >>>> "vertx" entries in the docs, the client, the websocket and some "vertx
> >>>> json eventbus", so I'm sorry to admit I'm a bit lost.
> >>>>
> >>>> in essence I need 2 things: organize some sort of a session with a
> >>>> session state (through cookies or if camel vertx component allows,
> >>>> differently), and be able to read/print raw bytes to/from the web
> >> client.
> >>>> On 16.10.2023 09:33, Claus Ibsen wrote:
> >>>>> Hi
> >>>>>
> >>>>> platform-http-main is based on vertx-http as HTTP server and this is
> >> NOT
> >>>>> servlet based.
> >>>>> But vertx-http has a similar API where you can get access to headers
> /
> >>>>> cookies etc.
> >>>>> However we don't store the "raw vertx object" that makes this easy
> with
> >>>>> Camel.
> >>>>>
> >>>>> This needs to be enhanced in camel-platform-http-vertx.
> >>>>>
> >>>>>
> >>>>> On Sun, Oct 15, 2023 at 9:17 PM Fyodor Kravchenko 
> >>>> wrote:
> >>>>>> Hello,
> >>>>>>
> >>>>>> in Camel 2 and Jetty I used to get my hands on HttpServletRequest by
> >>>>>>
> >>>>>> HttpMessage http =
> exchange.getIn(HttpMessage.class);
> >>>>>> HttpServletRequest request = http.getRequest();
> >>>>>>
> >>>>>> , but now I'm migrating to 4.0.1 and platform-http (currently
> >>>>>> camel-platform-http-main), and now I'm getting null instead of the
> >>>>>> HttpMessage.
> >>>>>>
> >>>>>> Is it related to the note in  the Camel 4 migration guide - " And
> all
> >>>>>> |HttpMessage| has been changed to generic |Message| types"? What is
> >> the
> >>>>>> correct method of getting the raw HttpServletRequest and its
> internals
> >>>>>> like headers, sessions and cookies, if there is any? Can't find a
> >>>>>> documented way of doing this, for example, by calling
> >>>>>> `HttpServletRequest request =
> >> http.getBody(HttpServletRequest.class);`.
> >>>>>>
> >>>>>> Thank you!
> >>>>>>
> >>>>>> -fedd
> >>>>>>
> >>>>>>
> >
>


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


Re: Converter not loading properly with Camel4

2023-10-18 Thread Claus Ibsen
Hi

If you want to use generateLoader=true (you should only set this on class
annotation).
Then you need to use the camel-component-maven-plugin as well that
generates needed metadata files.

Otherwise you can use the old 2.x way, where you need to turn on type
converter classpath scanner.

https://camel.apache.org/manual/type-converter.html#_type_converter_registry

On Tue, Oct 17, 2023 at 5:33 PM Kushagra Bindal 
wrote:

> Hi,
>
> While trying to migrate from Camel2-->Camel4, I am facing one
> challenge i.e. earlier in one of my class I use to have multiple
> converter methods which was working fine. But now with latest version,
> I observed that only 1st method of the converter class is loaded and
> rest are not loaded.
>
> @Converter(generateLoader = true)
> public class CommandConverter {
>
>
> @Converter(generateLoader = true)
> public final CommandCost toCommandCost(final String command) {
> ..
> ..
> ..
> }
>
> @Converter(generateLoader = true)
> public final CommandCost1 toCommandCost1(final String command1) {
> ..
> ..
> ..
> }
>
> @Converter(generateLoader = true)
> public final CommandCost2 toCommandCost2(final String command2) {
> ..
> ..
> ..
> }
>
> }
>
> In above example earlier all 3 mappings use to get reflected in
> typeMapping but now with camel4 it is only showing 1st mapping
> (toCommandCost)
> Am I missing something? If there any configuration or dependency that
> needs to be added in pom.xml or somewhere else to make it working then
> please let me know.
>
> --
> Regards,
> Kushagra
>


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


Re: HttpServletRequest and Platform HTTP

2023-10-17 Thread Claus Ibsen
Hi

You usually just set the a camel message header with the HTTP key/value for
redirect, something ala:


exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, 302);
exchange.getMessage().setHeader("location", "http
url of the redirect location");


On Mon, Oct 16, 2023 at 1:17 PM Fyodor Kravchenko  wrote:

> Thank you, Claus, I'll get familiarized myself with the Vert.X
> internals! In the meantime, there must be some way to "send redirect"
> (respond with the 302 header) by the Camel means, can you please give
> some hint on that?
>
> On 16.10.2023 11:18, Claus Ibsen wrote:
> > Hi
> >
> > I created a ticket
> > https://issues.apache.org/jira/browse/CAMEL-19994
> >
> > Yeah check vertx-http docs what it offers
> > https://vertx.io/docs/vertx-web/java/
> >
> >
> >
> > On Mon, Oct 16, 2023 at 10:12 AM Fyodor Kravchenko 
> wrote:
> >
> >> Hi, thanks, I get that. And without the Vertx object, what would be a
> >> correct way to obtain somewhat like a session attributes? I'm having
> >> trouble to navigate the documentation and find "vertx-http" description,
> >> can't get how to see and set, for example, the cookies. There are 3
> >> "vertx" entries in the docs, the client, the websocket and some "vertx
> >> json eventbus", so I'm sorry to admit I'm a bit lost.
> >>
> >> in essence I need 2 things: organize some sort of a session with a
> >> session state (through cookies or if camel vertx component allows,
> >> differently), and be able to read/print raw bytes to/from the web
> client.
> >>
> >> On 16.10.2023 09:33, Claus Ibsen wrote:
> >>> Hi
> >>>
> >>> platform-http-main is based on vertx-http as HTTP server and this is
> NOT
> >>> servlet based.
> >>> But vertx-http has a similar API where you can get access to headers /
> >>> cookies etc.
> >>> However we don't store the "raw vertx object" that makes this easy with
> >>> Camel.
> >>>
> >>> This needs to be enhanced in camel-platform-http-vertx.
> >>>
> >>>
> >>> On Sun, Oct 15, 2023 at 9:17 PM Fyodor Kravchenko 
> >> wrote:
> >>>> Hello,
> >>>>
> >>>> in Camel 2 and Jetty I used to get my hands on HttpServletRequest by
> >>>>
> >>>>HttpMessage http = exchange.getIn(HttpMessage.class);
> >>>>HttpServletRequest request = http.getRequest();
> >>>>
> >>>> , but now I'm migrating to 4.0.1 and platform-http (currently
> >>>> camel-platform-http-main), and now I'm getting null instead of the
> >>>> HttpMessage.
> >>>>
> >>>> Is it related to the note in  the Camel 4 migration guide - " And all
> >>>> |HttpMessage| has been changed to generic |Message| types"? What is
> the
> >>>> correct method of getting the raw HttpServletRequest and its internals
> >>>> like headers, sessions and cookies, if there is any? Can't find a
> >>>> documented way of doing this, for example, by calling
> >>>> `HttpServletRequest request =
> http.getBody(HttpServletRequest.class);`.
> >>>>
> >>>>
> >>>> Thank you!
> >>>>
> >>>> -fedd
> >>>>
> >>>>
> >
>


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


Re: HttpServletRequest and Platform HTTP

2023-10-16 Thread Claus Ibsen
Hi

I created a ticket
https://issues.apache.org/jira/browse/CAMEL-19994

Yeah check vertx-http docs what it offers
https://vertx.io/docs/vertx-web/java/



On Mon, Oct 16, 2023 at 10:12 AM Fyodor Kravchenko  wrote:

> Hi, thanks, I get that. And without the Vertx object, what would be a
> correct way to obtain somewhat like a session attributes? I'm having
> trouble to navigate the documentation and find "vertx-http" description,
> can't get how to see and set, for example, the cookies. There are 3
> "vertx" entries in the docs, the client, the websocket and some "vertx
> json eventbus", so I'm sorry to admit I'm a bit lost.
>
> in essence I need 2 things: organize some sort of a session with a
> session state (through cookies or if camel vertx component allows,
> differently), and be able to read/print raw bytes to/from the web client.
>
> On 16.10.2023 09:33, Claus Ibsen wrote:
> > Hi
> >
> > platform-http-main is based on vertx-http as HTTP server and this is NOT
> > servlet based.
> > But vertx-http has a similar API where you can get access to headers /
> > cookies etc.
> > However we don't store the "raw vertx object" that makes this easy with
> > Camel.
> >
> > This needs to be enhanced in camel-platform-http-vertx.
> >
> >
> > On Sun, Oct 15, 2023 at 9:17 PM Fyodor Kravchenko 
> wrote:
> >
> >> Hello,
> >>
> >> in Camel 2 and Jetty I used to get my hands on HttpServletRequest by
> >>
> >>   HttpMessage http = exchange.getIn(HttpMessage.class);
> >>   HttpServletRequest request = http.getRequest();
> >>
> >> , but now I'm migrating to 4.0.1 and platform-http (currently
> >> camel-platform-http-main), and now I'm getting null instead of the
> >> HttpMessage.
> >>
> >> Is it related to the note in  the Camel 4 migration guide - " And all
> >> |HttpMessage| has been changed to generic |Message| types"? What is the
> >> correct method of getting the raw HttpServletRequest and its internals
> >> like headers, sessions and cookies, if there is any? Can't find a
> >> documented way of doing this, for example, by calling
> >> `HttpServletRequest request = http.getBody(HttpServletRequest.class);`.
> >>
> >>
> >> Thank you!
> >>
> >> -fedd
> >>
> >>
>


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


Re: HttpServletRequest and Platform HTTP

2023-10-16 Thread Claus Ibsen
Hi

platform-http-main is based on vertx-http as HTTP server and this is NOT
servlet based.
But vertx-http has a similar API where you can get access to headers /
cookies etc.
However we don't store the "raw vertx object" that makes this easy with
Camel.

This needs to be enhanced in camel-platform-http-vertx.


On Sun, Oct 15, 2023 at 9:17 PM Fyodor Kravchenko  wrote:

> Hello,
>
> in Camel 2 and Jetty I used to get my hands on HttpServletRequest by
>
>  HttpMessage http = exchange.getIn(HttpMessage.class);
>  HttpServletRequest request = http.getRequest();
>
> , but now I'm migrating to 4.0.1 and platform-http (currently
> camel-platform-http-main), and now I'm getting null instead of the
> HttpMessage.
>
> Is it related to the note in  the Camel 4 migration guide - " And all
> |HttpMessage| has been changed to generic |Message| types"? What is the
> correct method of getting the raw HttpServletRequest and its internals
> like headers, sessions and cookies, if there is any? Can't find a
> documented way of doing this, for example, by calling
> `HttpServletRequest request = http.getBody(HttpServletRequest.class);`.
>
>
> Thank you!
>
> -fedd
>
>

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


Re: Kafka client default values out of sync to the origin one

2023-10-10 Thread Claus Ibsen
Hi

Did we change those default settings?

On Tue, Sep 26, 2023 at 5:21 PM Andrea Cosentino  wrote:

> Yes, it is possible.
>
> Can you raise an issue where you list the out of sync options?
>
> https://issues.apache.org/jira/projects/CAMEL/issues
>
> Thank you
>
> Il mar 26 set 2023, 17:09 Esslinger, Michael (BARMER) <
> michael.esslin...@barmer.de> ha scritto:
>
> > Hi,
> >
> > is it possible, that some default values of the Kafka client are set from
> > Camel were out of sync with the origin one?
> >
> > For example:
> >   - session.timeout.ms (
> >
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-735%3A+Increase+default+consumer+session+timeout
> > )
> >   - request.timeout.ms (
> >
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-266%3A+Fix+consumer+indefinite+blocking+behavior
> > )
> >
> > Regards
> > Michael
> >
>


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


Re: Undertow HTTP client

2023-10-10 Thread Claus Ibsen
Hi

You need to configure undertow component with SSL security settings
https://camel.apache.org/components/4.0.x/undertow-component.html

You can find some SSL unit tests in camel-undertow that can lead you in the
right direction

On Mon, Oct 9, 2023 at 12:44 PM Martin Möller
 wrote:

> Hi we are trying to use the Undertow HTTP component to make a HTTP request
> to a HTTPS server. This fails with
> "java.io.IOException: UT65: SSL must be specified to connect to a
> https URL"
> All required certificates are already installed on the system and other
> Java-HTTP-clients already use them without any configuration.
>
> How can we configure the undertow component to use the default system
> certificates?
>
> Thanks
> Martin
>



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


Re: How to properly remove a routeConfiguration

2023-10-07 Thread Claus Ibsen
Hi

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



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

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


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


  1   2   3   4   5   6   7   8   9   10   >