Re: Camel AWS2-S3 Unable to find valid certification path to the requested target”

2024-07-02 Thread Chirag
How do you run your app? is trust store overridden somehow?


On Tue, Jul 2, 2024 at 6:10 PM Srikant Mantha 
wrote:

> Hi,
> I am using camel aws s3 to upload a file in my camel-springboot
> microservice with camel aws version as 4.5.0. I am facing connectivity
> issues to the S3 bucket with the
>
> exception message like “unable to find valid certification path to the
> requested target”
>
> Below is my config and endpoint call
>
> My Camel Processor code
>
> //set the payload in the exchange body and the S3 url is constructed in
> the S3Config
> String endpointUri = “s3://”+s3Config.getBucketName();
> producerTemplate.send(endpointUri, exchange);
>
> Reference of S3Config
>
> String awsBucketAccessKey = "your_access_key";
> String awsBucketSecretKey = "your_secret_key";
>
> //exposed as a @Bean(“s3”)
> AWS2S3Component s3 = new AWS2S3Component();
> s3.setConfiguration(getConfiguration());
> s3.setHealthCheckProducerEnabled(true);
> s3.setLazyStartProducer(true);
>
> //autowire and register the bean
> camelContext.addComponent(“aws2-s3”, s3);
>
>
> getConfiguration() method
> AWS2S3Configuration configuration = new AWS2S3Configuration();
>
> S3Client s3Client =
> S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(awsBucketAccessKey,
> awsBucketSecretKey)))
> .region(Region.US_EAST_1).build();
>
> configuration.setAmazonS3Client(s3Client);
> configuration.setAutoDiscoverClient(true); -• I cannot find this property
> in camel-aws 4.5.0
> configuration.setBucketName("s3bucket2020");
> configuration.setRegion("us-east-1");
>
>
> From the application SSL DEBUG logs, I see problems in establishing
> connection
>
>   1.  Connecting socket to AMAZON S3 HOSTNAME
>   2.  Enabled Protocols
>   3.  Enabled cipher suites
>   4.  Starting handshake
>   5.  Shutdown connection
>   6.  Connection discarded
>
> Is there any SSL Configuration that I must set at the configuration level,
> I am confused now since I am already passing the credentials. What am I
> missing here ?
>
> -Regards
> Srikant Mantha
>


Re: Camel 4.6 activemq issue

2024-08-28 Thread Chirag
What is the advantage of bean approach ?

On Tue, Aug 27, 2024, 08:22 ski n  wrote:

> No, you need to put all to false
>
> On Tue, Aug 27, 2024 at 2:17 PM Sujeet Singh 
> wrote:
>
> > Hi Raymond,
> >
> > Did you mean to say, add lazy-init="true" in mqConnectionFactory as well.
> >
> > Thanks,
> > Sujeet
> >
> > On Tue, 27 Aug 2024, 17:32 Sujeet Singh, 
> > wrote:
> >
> > > Hi,
> > > In the code that I pasted it is already set to lazy-init="true".
> > >
> > > Please correct me if I am wrong.
> > >
> > > Thanks,
> > > Sujeet
> > >
> > >
> > > On Tue, 27 Aug 2024, 17:26 ski n,  wrote:
> > >
> > >> You are creating a custom component with its own name " jmsMQ". This
> is
> > >> not
> > >> uncommon for the JMSComponent, however in your case, the component is
> > not
> > >> available as endpoint when you load it. You may try to set
> > >> lazy-init="true"
> > >> from to false.
> > >>
> > >> Raymond
> > >>
> > >> On Tue, Aug 27, 2024 at 1:26 PM Sujeet Singh <
> > sujeetkumarsi...@gmail.com>
> > >> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > The endpoint url is below
> > >> >
> > >> > jmsMQ://queue:ABC.INT.QUEUE
> > >> >
> > >> > jmsMQ is a bean reference id. Its definition is below
> > >> >
> > >> > 
> > >> >  > >> > xmlns="http://www.springframework.org/schema/beans";
> > >> > xmlns:context="http://www.springframework.org/schema/context";
> > >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:jdbc="
> > >> > http://www.springframework.org/schema/jdbc"; xmlns:util="
> > >> > http://www.springframework.org/schema/util";
> > >> > xsi:schemaLocation="
> > >> > http://www.springframework.org/schema/beans
> > >> > http://www.springframework.org/schema/beans/spring-beans.xsd
> > >> > http://www.springframework.org/schema/jdbc
> > >> > http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
> > >> > http://www.springframework.org/schema/context
> > >> > http://www.springframework.org/schema/context/spring-context.xsd
> > >> > http://www.springframework.org/schema/util
> > >> > http://www.springframework.org/schema/util/spring-util.xsd";>
> > >> > 
> > >> > < > >> > lazy-init="true">  > >> > ref="mqConnectionFactory" />
> > >> >  value="SESSION_TRANSACTED"/>
> > >> > 
> > >> > 
> > >> >  > >> > lazy-init="true">  > >> > ref="mqConnectionFactory" /> 
> > >> >  > >> > class="com.ibm.mq.jms.MQQueueConnectionFactory">  > >> > name="transportType">${TRANSPORT_TYPE}
> > >>  > >> > name="queueManager">${DBUS_MQ_QUEUE_MGR}
> > >> >  > name="hostName">${DBUS_MO_HOST_NAME}
> > >> > ${DBUS_MO_PORT}
> > >> > ${DBUS_MO_CHANNEL_NAME}
> > >> 
> > >> > ${DBUS MQ
> CIPHER_SUITE}
> > >> > 
> > >> > 
> > >> > 
> > >> >
> > >> > Thanks,
> > >> > Sujeet
> > >> >
> > >> >
> > >> >
> > >> > On Tue, 27 Aug 2024, 16:31 Aurélien Pupier, 
> > wrote:
> > >> >
> > >> > > Hello,
> > >> > >
> > >> > > Can you precise the endpoint URL you are trying to use please?
> > >> > >
> > >> > > Note that there are different components to use ActiveMQ, each
> with
> > >> > > specific ids and specific dependency:
> > >> > > * JMS
> https://camel.apache.org/components/4.4.x/jms-component.html
> > >> > > * ActiveMQ 5
> > >> > > https://camel.apache.org/components/4.4.x/activemq-component.html
> > >> > > * ActiveMQ 6
> > >> > > https://camel.apache.org/components/next/activemq6-component.html
> > >> > >
> > >> > > regards,
> > >> > >
> > >> > > On Tue, Aug 27, 2024 at 11:50 AM Sujeet Singh <
> > >> > sujeetkumarsi...@gmail.com>
> > >> > > wrote:
> > >> > >
> > >> > > > Hi,
> > >> > > >
> > >> > > > We have added camel-activemq depedency for activemq.
> > >> > > >
> > >> > > > We are getting error like below
> > >> > > >
> > >> > > > Caused by: org.apache.camel.NoSuchEndpointException: No endpoint
> > >> could
> > >> > be
> > >> > > > found for jmsMQ://queue:ABC.INT.QUEUE, please check your
> classpath
> > >> > > contains
> > >> > > > the needed Camel component jar.
> > >> > > > at
> > >> > > >
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:836)
> > >> > > >
> > >> > > > Anything we are missing here?
> > >> > > >
> > >> > > > Thanks,
> > >> > > > Sujeet
> > >> > > >
> > >> > >
> > >> >
> > >>
> > >
> >
>


Re: Camel JMS headers

2024-09-13 Thread Chirag
Is Tibco seeing it as DeliveryMode or with Camel name on it? Do you also
see DeliveryMode?

regards,



On Thu, Sep 12, 2024 at 10:13 AM Bálint Baráth 
wrote:

> Hello!
>
> FYI if somebody runs into the same problem:
> I managed to create a workaround, after finding where the header gets
> added. It's inside the tibco jms implementation, where all the properties
> on the message get added as jms headers, so the CamelJmsDeliveryMode int
> property was added.
> I created a messageCreatedStrategy implementation, that runs just before
> tibco code, and removed the int property.
>
> Bálint Baráth  ezt írta (időpont: 2024. szept.
> 12.,
> Cs, 8:35):
>
> > Hello!
> >
> > I'm using camel 4.0.6 with java 17 and springboot 3.2.6.
> > When using camel with JMS and using a request-reply EIP, camel puts some
> > extra headers on the reply message. The CamelMessageTimestamp can be
> > removed using the removeHeaders("Camel*") feature, but there is a header
> > named "*CamelJmsDeliveryMode*".
> > Even when I remove it with removeHeaders it gets added to the reply.
> > I wrote a HeaderFilterStrategy, but this header seems to get added
> > afterwards.
> >
> > Is there a way to turn this off, or turn off extra camel headers
> > altogether?
> >
> > Thanks for the reply in advance.
> > Best regards,
> >
> > Bálint
> >
> >
>


Re: Camel JMS headers

2024-09-16 Thread Chirag
Thanks Claus.

Balint, fix is on a new branch and not on 4.0.x. Would you know how to
cherrypick to 4.0.x branch to get it in version you need and validate?


On Mon, Sep 16, 2024 at 4:55 AM Bálint Baráth 
wrote:

> Thanks for the quick response, and the fix!
>
> Claus Ibsen  ezt írta (időpont: 2024. szept. 14.,
> Szo 11:31):
>
> > Hi
> >
> > Yeah lets investigate this I created a ticket
> > https://issues.apache.org/jira/browse/CAMEL-21219
> >
> > On Thu, Sep 12, 2024 at 8:36 AM Bálint Baráth 
> > wrote:
> >
> > > Hello!
> > >
> > > I'm using camel 4.0.6 with java 17 and springboot 3.2.6.
> > > When using camel with JMS and using a request-reply EIP, camel puts
> some
> > > extra headers on the reply message. The CamelMessageTimestamp can be
> > > removed using the removeHeaders("Camel*") feature, but there is a
> header
> > > named "*CamelJmsDeliveryMode*".
> > > Even when I remove it with removeHeaders it gets added to the reply.
> > > I wrote a HeaderFilterStrategy, but this header seems to get added
> > > afterwards.
> > >
> > > Is there a way to turn this off, or turn off extra camel headers
> > > altogether?
> > >
> > > Thanks for the reply in advance.
> > > Best regards,
> > >
> > > Bálint
> > >
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>


Using camel-main, xml route, referencing a java class as processor

2022-01-17 Thread Chirag
Hello,
I have a scenario where I am using camel-main with XML Route and a Java
Class as a Processor.

It gives me following error:

Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
Failed to create route route1 at: >>>
process[ref:#class:org.myorg.camel.MyProcessor] <<< in route:
Route(route1)[From[timer://foo?fixedRate=true&period=6] ... because of
No bean could be found in the registry for:
#class:org.myorg.camel.MyProcessor of type: org.apache.camel.Processor
at
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
at
org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
at
org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:868)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:758)
at
org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2861)
at
org.apache.camel.support.service.BaseService.init(BaseService.java:83)
at
org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2567)
at
org.apache.camel.support.service.BaseService.start(BaseService.java:111)
at
org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2586)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:247)
at org.apache.camel.main.Main.doStart(Main.java:116)
at
org.apache.camel.support.service.BaseService.start(BaseService.java:119)
at org.apache.camel.main.MainSupport.run(MainSupport.java:69)
at
org.apache.camel.main.MainCommandLineSupport.run(MainCommandLineSupport.java:174)
at org.myorg.camel.MyMainApp.main(MyMainApp.java:21)
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in
the registry for: #class:org.myorg.camel.MyProcessor of type:
org.apache.camel.Processor
at
org.apache.camel.support.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:241)
at
org.apache.camel.reifier.AbstractReifier.mandatoryLookup(AbstractReifier.java:145)
at
org.apache.camel.reifier.ProcessReifier.createProcessor(ProcessReifier.java:40)
at
org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:838)
at
org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:579)
at
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:236)
... 15 more

Example Code is described:
https://github.com/chiragsanghavi/camel-experiments/tree/main/processor

Basically referring to processor using  in route directly as described
in
https://camel.apache.org/manual/processor.html#_referring_to_beans_using_class_syntax
.

But it doesn't seem to work.

Are there any other conditions to using #class ?


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Using camel-main, xml route, referencing a java class as processor

2022-01-17 Thread Chirag
I use Camel 3.14.0

I haven't figured out how to reply to thead using gmail so please bear with
me.

On Sun, Jan 16, 2022 at 7:46 PM Chirag  wrote:

> Hello,
> I have a scenario where I am using camel-main with XML Route and a Java
> Class as a Processor.
>
> It gives me following error:
>
> Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
> Failed to create route route1 at: >>>
> process[ref:#class:org.myorg.camel.MyProcessor] <<< in route:
> Route(route1)[From[timer://foo?fixedRate=true&period=6] ... because of
> No bean could be found in the registry for:
> #class:org.myorg.camel.MyProcessor of type: org.apache.camel.Processor
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
> at
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
> at
> org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:868)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:758)
> at
> org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2861)
> at
> org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> at
> org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2567)
> at
> org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> at
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2586)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:247)
> at org.apache.camel.main.Main.doStart(Main.java:116)
> at
> org.apache.camel.support.service.BaseService.start(BaseService.java:119)
> at org.apache.camel.main.MainSupport.run(MainSupport.java:69)
> at
> org.apache.camel.main.MainCommandLineSupport.run(MainCommandLineSupport.java:174)
> at org.myorg.camel.MyMainApp.main(MyMainApp.java:21)
> Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in
> the registry for: #class:org.myorg.camel.MyProcessor of type:
> org.apache.camel.Processor
> at
> org.apache.camel.support.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:241)
> at
> org.apache.camel.reifier.AbstractReifier.mandatoryLookup(AbstractReifier.java:145)
> at
> org.apache.camel.reifier.ProcessReifier.createProcessor(ProcessReifier.java:40)
> at
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:838)
> at
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:579)
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:236)
> ... 15 more
>
> Example Code is described:
> https://github.com/chiragsanghavi/camel-experiments/tree/main/processor
>
> Basically referring to processor using  ref="#class:org.myorg.camel.MyProcessor"/> in route directly as described
> in
> https://camel.apache.org/manual/processor.html#_referring_to_beans_using_class_syntax
> .
>
> But it doesn't seem to work.
>
> Are there any other conditions to using #class ?
>
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>


Re: Re[2]: Using camel-main, xml route, referencing a java class as processor

2022-01-18 Thread Chirag
Will try bean.

For now - I ended up doing a bind in the default registry.
I was mainly trying to find a low-code way of doing this.


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Tue, Jan 18, 2022 at 2:53 AM Claus Ibsen  wrote:

> Hi
>
> In Camel 3.14 you can use bean instead of process to refer to the #class.
>
> On Tue, Jan 18, 2022 at 7:28 AM Claus Ibsen  wrote:
> >
> > Hi
> >
> > Yes this is not supported currently. I have created a JIRA and have a
> > fix for this:
> > https://issues.apache.org/jira/browse/CAMEL-17508
> >
> > On Tue, Jan 18, 2022 at 6:12 AM Chirag Sanghavi
> >  wrote:
> > >
> > > I am trying with Camel 3.14.0.
> > >
> > > While debugging I noticed that
> > >
> > > call gets to ProcessReifier.java
> > >
> > >   public Processor createProcessor() {
> > >  Processor answer =
> > > ((ProcessDefinition)this.definition).getProcessor();
> > >  if (answer == null) {
> > >
> > > ObjectHelper.notNull(((ProcessDefinition)this.definition).getRef(),
> > > "ref", this.definition);
> > >  answer =
> > >
> (Processor)this.mandatoryLookup(((ProcessDefinition)this.definition).getRef(),
> > > Processor.class);
> > >  }
> > >
> > > at that point - variables are as below:
> > >
> > > definition = {ProcessDefinition@3684}
> > > "process[ref:#class:org.myorg.camel.MyProcessor]"
> > >   ref = "#class:org.myorg.camel.MyProcessor"
> > >   processor = null
> > >   log = {Logger@3741}
> "Logger[org.apache.camel.model.ProcessDefinition]"
> > >   inheritErrorHandler = null
> > >   blocks = {LinkedList@3742}  size = 0
> > >   parent = {RouteDefinition@3358}
> > > "Route(route1)[From[timer://foo?fixedRate=true&period=6] ->
> > > [SetBody[simple{Hello}],
> > > process[ref:#class:org.myorg.camel.MyProcessor], To[log:hello]]]"
> > >   interceptStrategies = {ArrayList@3743}  size = 0
> > >   index = 2
> > >   id = "process1"
> > >   customId = null
> > >   description = null
> > >
> > > ((ProcessDefinition)this.definition).getProcessor() , returns null and
> > > then it performs a lookup on registry.
> > >
> > > It never seemed to get to
> > > public Object lookupByName(String name) {
> > >  if (name != null && name.startsWith("#class:")) {
> > >  return this.createBean(name, Object.class);
> > >  } else {
> > >  return name != null && name.startsWith("#type:") ?
> > > this.lookupBean(name, Object.class) :
> > > this.getRegistry().lookupByName(name);
> > >  }
> > >  }
> > >
> > > if it may have - it may have identified that the class starts with
> > > #class: and needs to be bypassing registry.
> > >
> > > -- Original Message --
> > > From: "Claus Ibsen" 
> > > To: users@camel.apache.org
> > > Sent: 1/17/2022 4:38:12 AM
> > > Subject: Re: Using camel-main, xml route, referencing a java class as
> > > processor
> > >
> > > >What camel version do you use
> > > >
> > > >On Mon, Jan 17, 2022 at 9:27 AM Chirag 
> wrote:
> > > >>
> > > >>  Hello,
> > > >>  I have a scenario where I am using camel-main with XML Route and a
> Java
> > > >>  Class as a Processor.
> > > >>
> > > >>  It gives me following error:
> > > >>
> > > >>  Exception in thread "main"
> org.apache.camel.FailedToCreateRouteException:
> > > >>  Failed to create route route1 at: >>>
> > > >>  process[ref:#class:org.myorg.camel.MyProcessor] <<< in route:
> > > >>  Route(route1)[From[timer://foo?fixedRate=true&period=6] ...
> because of
> > > >>  No bean could be found in the registry for:
> > > >>  #class:org.myorg.camel.MyProcessor of type:
> org.apache.camel.Processor
> > > >>  at
> > > >>
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
> > > >>  at
> > > >>
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
> > > >>  at
> > > >>

Debezium Component

2022-01-25 Thread Chirag
In Debezium component, a parameter is referred to as
"databaseHistoryFileName" in documentation as well as texts - but code only
works if it is set to databaseHistoryFileFileName.

e.g.
https://camel.apache.org/components/3.14.x/debezium-mongodb-component.html

In Parameters - it is databaseHistoryFileFileName, but in example it is
databaseHistoryFileName.
Even unit tests seem to use databaseHistoryFileName.

Should we fix documentation and tests to use databaseHistoryFileFileName?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Debezium Component

2022-01-26 Thread Chirag
This is done now.
https://github.com/apache/camel/pull/6832
ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Wed, Jan 26, 2022 at 12:44 AM Claus Ibsen  wrote:

> Hi
>
> Yes the docs should be updated, you are welcome to send a PR
>
> On Wed, Jan 26, 2022 at 6:17 AM Chirag  wrote:
> >
> > In Debezium component, a parameter is referred to as
> > "databaseHistoryFileName" in documentation as well as texts - but code
> only
> > works if it is set to databaseHistoryFileFileName.
> >
> > e.g.
> >
> https://camel.apache.org/components/3.14.x/debezium-mongodb-component.html
> >
> > In Parameters - it is databaseHistoryFileFileName, but in example it is
> > databaseHistoryFileName.
> > Even unit tests seem to use databaseHistoryFileName.
> >
> > Should we fix documentation and tests to use databaseHistoryFileFileName?
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


Debezium, Camel 3.14.x and TypeConverter - in a Camel-Main app

2022-01-26 Thread Chirag
I am trying out following
https://camel.apache.org/blog/2020/05/CdcWithCamelAndDebezium/

with few changes:
1. Using MySQL
2. Trying to use a TypeConverter

I have created a class called Customer - Here is snippet:

public class Customer {
public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public String getFirst_name() {
return first_name;
}

With that - Created a TypeConverter class with a method as below.

@Converter
public static Customer toCustomer(final Struct struct) {
logger.debug("toCustomer");
return new Customer(struct.getInt64("ID"),
struct.getString("FIRST_NAME"),struct.getString("LAST_NAME"),
struct.getString("EMAIL"));
}

The class is listed in
Project\src\main\resources\META-INF\services\org\apache\camel\TypeConverter file

Following fails:

from("debezium-mysql:mydb).convertBodyTo(Customer.class)
.marshal().json(JsonLibrary.Gson)
.to("file:/Folder/SomeData");

Following Works:
from("debezium-mysql:mydb).convertBodyTo(Map.class)
.marshal().json(JsonLibrary.Gson)
.to("file:/Folder/SomeData");

With Map.class my understanding is that it invokes -
debeziumtypeconverter and works fine.

Similarly - I want to invoke My Customerl.class.

org.apache.camel.InvalidPayloadException: No body available of type:
com.company.Customer but has value:
Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}
of type: org.apache.kafka.connect.data.Struct on: Message.
Caused by: No type converter available to convert from type:
org.apache.kafka.connect.data.Struct to the required type:
com.company.Customer with value
Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}.
Exchange[0EDB7CF530EA352-0001].
Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
type converter available to convert from type:
org.apache.kafka.connect.data.Struct to the required type:
com.company.Customer with value
Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}]
at 
org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
at 
org.apache.camel.support.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:118)
at org.apache.camel.support.processor.ConvertBodyProcessor.proce

Question:
1. Does Camel-Main support Annotation and the ability to register
TypeConverter automatically?
2. I see a slightly different way of defining  TypeConverter
https://github.com/debezium/debezium-examples/blob/main/camel-component/qa-camel/src/main/java/io/debezium/examples/camel/pipeline/Converters.java
- but this doesn't even seem to use META-INF  or a registry - so not
sure how it would work.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Debezium, Camel 3.14.x and TypeConverter - in a Camel-Main app

2022-01-27 Thread Chirag
It doesn't seem to be helping.
Let me do some digging.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Jan 27, 2022 at 3:16 AM Claus Ibsen  wrote:
>
> Hi
>
> Ah yeah there is no classpath annotation scanning like you can have
> with spring boot / quarkus.
>
> However for loading custom type converters where you have that file in
> the classpath, then you can try setting
> camel.main.loadTypeConverters=true
>
>
> On Thu, Jan 27, 2022 at 5:37 AM Chirag  wrote:
> >
> > I am trying out following
> > https://camel.apache.org/blog/2020/05/CdcWithCamelAndDebezium/
> >
> > with few changes:
> > 1. Using MySQL
> > 2. Trying to use a TypeConverter
> >
> > I have created a class called Customer - Here is snippet:
> >
> > public class Customer {
> > public long getId() {
> > return id;
> > }
> >
> > public void setId(long id) {
> > this.id = id;
> > }
> >
> > public String getFirst_name() {
> > return first_name;
> > }
> >
> > With that - Created a TypeConverter class with a method as below.
> >
> > @Converter
> > public static Customer toCustomer(final Struct struct) {
> > logger.debug("toCustomer");
> > return new Customer(struct.getInt64("ID"),
> > struct.getString("FIRST_NAME"),struct.getString("LAST_NAME"),
> > struct.getString("EMAIL"));
> > }
> >
> > The class is listed in
> > Project\src\main\resources\META-INF\services\org\apache\camel\TypeConverter 
> > file
> >
> > Following fails:
> >
> > from("debezium-mysql:mydb).convertBodyTo(Customer.class)
> > .marshal().json(JsonLibrary.Gson)
> > .to("file:/Folder/SomeData");
> >
> > Following Works:
> > from("debezium-mysql:mydb).convertBodyTo(Map.class)
> > .marshal().json(JsonLibrary.Gson)
> > .to("file:/Folder/SomeData");
> >
> > With Map.class my understanding is that it invokes -
> > debeziumtypeconverter and works fine.
> >
> > Similarly - I want to invoke My Customerl.class.
> >
> > org.apache.camel.InvalidPayloadException: No body available of type:
> > com.company.Customer but has value:
> > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}
> > of type: org.apache.kafka.connect.data.Struct on: Message.
> > Caused by: No type converter available to convert from type:
> > org.apache.kafka.connect.data.Struct to the required type:
> > com.company.Customer with value
> > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}.
> > Exchange[0EDB7CF530EA352-0001].
> > Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
> > type converter available to convert from type:
> > org.apache.kafka.connect.data.Struct to the required type:
> > com.company.Customer with value
> > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}]
> > at 
> > org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
> > at 
> > org.apache.camel.support.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:118)
> > at org.apache.camel.support.processor.ConvertBodyProcessor.proce
> >
> > Question:
> > 1. Does Camel-Main support Annotation and the ability to register
> > TypeConverter automatically?
> > 2. I see a slightly different way of defining  TypeConverter
> > https://github.com/debezium/debezium-examples/blob/main/camel-component/qa-camel/src/main/java/io/debezium/examples/camel/pipeline/Converters.java
> > - but this doesn't even seem to use META-INF  or a registry - so not
> > sure how it would work.
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Debezium, Camel 3.14.x and TypeConverter - in a Camel-Main app

2022-01-27 Thread Chirag
I stumbled upon :)

https://camel.apache.org/components/3.14.x/others/main.html

It says - Its recommended to migrate to use fast type converter
loading by setting Converter(loader = true) on your custom type
converter classes.

I couldn't make the original method work - but it does work with
@Converter(generateLoader = true), and running mvn package.




ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Jan 27, 2022 at 12:58 PM Chirag  wrote:
>
> It doesn't seem to be helping.
> Let me do some digging.
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
> On Thu, Jan 27, 2022 at 3:16 AM Claus Ibsen  wrote:
> >
> > Hi
> >
> > Ah yeah there is no classpath annotation scanning like you can have
> > with spring boot / quarkus.
> >
> > However for loading custom type converters where you have that file in
> > the classpath, then you can try setting
> > camel.main.loadTypeConverters=true
> >
> >
> > On Thu, Jan 27, 2022 at 5:37 AM Chirag  wrote:
> > >
> > > I am trying out following
> > > https://camel.apache.org/blog/2020/05/CdcWithCamelAndDebezium/
> > >
> > > with few changes:
> > > 1. Using MySQL
> > > 2. Trying to use a TypeConverter
> > >
> > > I have created a class called Customer - Here is snippet:
> > >
> > > public class Customer {
> > > public long getId() {
> > > return id;
> > > }
> > >
> > > public void setId(long id) {
> > > this.id = id;
> > > }
> > >
> > > public String getFirst_name() {
> > > return first_name;
> > > }
> > >
> > > With that - Created a TypeConverter class with a method as below.
> > >
> > > @Converter
> > > public static Customer toCustomer(final Struct struct) {
> > > logger.debug("toCustomer");
> > > return new Customer(struct.getInt64("ID"),
> > > struct.getString("FIRST_NAME"),struct.getString("LAST_NAME"),
> > > struct.getString("EMAIL"));
> > > }
> > >
> > > The class is listed in
> > > Project\src\main\resources\META-INF\services\org\apache\camel\TypeConverter
> > >  file
> > >
> > > Following fails:
> > >
> > > from("debezium-mysql:mydb).convertBodyTo(Customer.class)
> > > .marshal().json(JsonLibrary.Gson)
> > > .to("file:/Folder/SomeData");
> > >
> > > Following Works:
> > > from("debezium-mysql:mydb).convertBodyTo(Map.class)
> > > .marshal().json(JsonLibrary.Gson)
> > > .to("file:/Folder/SomeData");
> > >
> > > With Map.class my understanding is that it invokes -
> > > debeziumtypeconverter and works fine.
> > >
> > > Similarly - I want to invoke My Customerl.class.
> > >
> > > org.apache.camel.InvalidPayloadException: No body available of type:
> > > com.company.Customer but has value:
> > > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}
> > > of type: org.apache.kafka.connect.data.Struct on: Message.
> > > Caused by: No type converter available to convert from type:
> > > org.apache.kafka.connect.data.Struct to the required type:
> > > com.company.Customer with value
> > > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}.
> > > Exchange[0EDB7CF530EA352-0001].
> > > Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
> > > type converter available to convert from type:
> > > org.apache.kafka.connect.data.Struct to the required type:
> > > com.company.Customer with value
> > > Struct{ID=1,FIRST_NAME=MyName,LAST_NAME=MyLastName,EMAIL=myem...@myorg.com}]
> > > at 
> > > org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
> > > at 
> > > org.apache.camel.support.processor.ConvertBodyProcessor.process(ConvertBodyProcessor.java:118)
> > > at org.apache.camel.support.processor.ConvertBodyProcessor.proce
> > >
> > > Question:
> > > 1. Does Camel-Main support Annotation and the ability to register
> > > TypeConverter automatically?
> > > 2. I see a slightly different way of defining  TypeConverter
> > > https://github.com/debezium/debezium-examples/blob/main/camel-component/qa-camel/src/main/java/io/debezium/examples/camel/pipeline/Converters.java
> > > - but this doesn't even seem to use META-INF  or a registry - so not
> > > sure how it would work.
> > >
> > > ચિરાગ/चिराग/Chirag
> > > --
> > > Sent from My Gmail Account
> >
> >
> >
> > --
> > Claus Ibsen
> > -
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2


Re: Debezium, Camel 3.14.x and TypeConverter - in a Camel-Main app

2022-01-28 Thread Chirag
Yes and it worked successfully. I could not get the original method to
work (including application.properties or other properties set at
context). This is primarily POC so I am happy that the "fast" method
worked.

I feel that 
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_4.html#_using_custom_type_converters
should be updated to indicate that if project is using maven then
might as well move to @Converter (generateLoader = true).



ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Fri, Jan 28, 2022 at 4:18 AM Claus Ibsen  wrote:
>
> On Thu, Jan 27, 2022 at 8:36 PM Chirag  wrote:
> >
> > I stumbled upon :)
> >
> > https://camel.apache.org/components/3.14.x/others/main.html
> >
> > It says - Its recommended to migrate to use fast type converter
> > loading by setting Converter(loader = true) on your custom type
> > converter classes.
> >
> > I couldn't make the original method work - but it does work with
> > @Converter(generateLoader = true), and running mvn package.
> >
>
> Ah good, then you are using the maven plugin to generate the loader source 
> code,
> which Camel then detects when starting up and can find your custom
> type converter.
>
> Then this converter is loaded in the same way as the out of the box 
> converters.
>
> >
> >
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Thu, Jan 27, 2022 at 12:58 PM Chirag  wrote:
> > >
> > > It doesn't seem to be helping.
> > > Let me do some digging.
> > >
> > > ચિરાગ/चिराग/Chirag
> > > --
> > > Sent from My Gmail Account
> > >
> > > On Thu, Jan 27, 2022 at 3:16 AM Claus Ibsen  wrote:
> > > >
> > > > Hi
> > > >
> > > > Ah yeah there is no classpath annotation scanning like you can have
> > > > with spring boot / quarkus.
> > > >
> > > > However for loading custom type converters where you have that file in
> > > > the classpath, then you can try setting
> > > > camel.main.loadTypeConverters=true
> > > >
> > > >
> > > > On Thu, Jan 27, 2022 at 5:37 AM Chirag  
> > > > wrote:
> > > > >
> > > > > I am trying out following
> > > > > https://camel.apache.org/blog/2020/05/CdcWithCamelAndDebezium/
> > > > >
> > > > > with few changes:
> > > > > 1. Using MySQL
> > > > > 2. Trying to use a TypeConverter
> > > > >
> > > > > I have created a class called Customer - Here is snippet:
> > > > >
> > > > > public class Customer {
> > > > > public long getId() {
> > > > > return id;
> > > > > }
> > > > >
> > > > > public void setId(long id) {
> > > > > this.id = id;
> > > > > }
> > > > >
> > > > > public String getFirst_name() {
> > > > > return first_name;
> > > > > }
> > > > >
> > > > > With that - Created a TypeConverter class with a method as below.
> > > > >
> > > > > @Converter
> > > > > public static Customer toCustomer(final Struct struct) {
> > > > > logger.debug("toCustomer");
> > > > > return new Customer(struct.getInt64("ID"),
> > > > > struct.getString("FIRST_NAME"),struct.getString("LAST_NAME"),
> > > > > struct.getString("EMAIL"));
> > > > > }
> > > > >
> > > > > The class is listed in
> > > > > Project\src\main\resources\META-INF\services\org\apache\camel\TypeConverter
> > > > >  file
> > > > >
> > > > > Following fails:
> > > > >
> > > > > from("debezium-mysql:mydb).convertBodyTo(Customer.class)
> > > > > .marshal().json(JsonLibrary.Gson)
> > > > > .to("file:/Folder/SomeData");
> > > > >
> > > > > Following Works:
> > > > > from("debezium-mysql:mydb).convertBodyTo(Map.class)
> > > > > .marshal().json(JsonLibrary.Gson)
> > > > > .to("file:/Folder/SomeData");
> > > > >
> > > > > With Map.c

Re: Camel AWS SQS and concurrentConsumers

2022-02-02 Thread Chirag
Can you please post or point to a prototype ?
Have you tried with putting large number if messages ?

On Wed, Feb 2, 2022, 17:35 Narsi Reddy Nallamilli <
narsi.nallami...@gmail.com> wrote:

> Hi Arnaud,
>
> Yup, It used to work before because I use it in my project and was not
> aware of the bug till you reported.
>
> Can you open up a jira for the same?
>
> On Thu, 3 Feb, 2022, 01:00 Arnaud Level,  wrote:
>
> > Hi again Narsi,
> >
> > I read more about the *delay* component and you are right! Using it with
> a
> > custom (or even the default) thread pool profile we can have the expected
> > behavior without the thread pool being exhausted as I was thinking. This
> is
> > a workaround to the concurrentConsumer bug not being taken into account.
> > I still think we should open an issue as this behavior is supposed to be
> > supported by the concurrentConsumer URI parameter of the SQS component.
> > What do you think?
> >
> > Thanks for your help again!
> > Arnaud
> >
> >
> >
> >
> >
> > On Wed, Feb 2, 2022 at 6:42 PM Arnaud Level 
> wrote:
> >
> > > Hi Narsi,
> > >
> > > Thank you for the reply! Indeed it works but not exactly as expected. I
> > am
> > > not sure to understand the behavior because with this delay it is not
> > > limited to the number of concurrent consumers. If I set
> > > concurrentConsumers=3 and I send 5 messages (which are read 1 by 1
> with 5
> > > pollings) I will see the 5 messages being consumed immediately even
> > though
> > > they all are entering in a sleep of 5 secs each.
> > > The expected behavior would be to see 3 immediately and then the next 2
> > > when two of the first 3 wakes up (=after the 5 s sleep).
> > >
> > > From a behavior perspective, it looks like a new thread is created
> every
> > > time a message is available on the queue but without any limit. If this
> > is
> > > the case we can easily end up with an exhausted thread pool. I had a
> > quick
> > > look at the delay component and it is by default async which would
> > explain
> > > the behavior we are seeing. What do you think ?
> > >
> > > Regarding the concurrentConsumers parameter, if this is a bug, I
> believe
> > > it is a regression because according to this article
> > > <
> >
> https://blog.christianposta.com/camel/very-fast-camels-and-cloud-messaging/
> >
> > it
> > > has worked in the past. Shouldn't we open an issue ?
> > >
> > > Thanks again!
> > > Arnaud
> > >
> > > On Wed, Feb 2, 2022 at 5:52 PM Narsi Reddy Nallamilli <
> > > narsi.nallami...@gmail.com> wrote:
> > >
> > >> Hi Arnaud,
> > >>
> > >> Yes, you are correct, 'concurrentConsumers; uri attribute is not
> working
> > >> as
> > >> expected and this is some bug.
> > >>
> > >> However I found when you use delay in the route it works as expected.
> > >>
> > >>
> > >>
> >
> from("aws2-sqs://queuexxx?concurrentConsumers=5&amazonSQSClient=#sqsClient&
> > >> waitTimeSeconds=20")
> > >> .delay(1L)
> > >> .process(exchange -> {
> > >> System.out.println("Message received...");
> > >> })
> > >> .process(exchange -> {
> > >> try {
> > >> Thread.sleep(5000);
> > >> } catch (InterruptedException e) {
> > >> e.printStackTrace();
> > >> }});
> > >>
> > >> try it and let me know.
> > >>
> > >> On Mon, Jan 31, 2022 at 11:48 PM Arnaud Level 
> > >> wrote:
> > >>
> > >> > Hi Larry,
> > >> >
> > >> > Thank you for your message! Your reply makes sense to me and I've
> > tried
> > >> > what you suggested to test it with a queue like:
> > >> >
> > >> >
> > >>
> >
> from("aws2-sqs://aramark-notifications?maxMessagesPerPoll=1&concurrentConsumers=5&amazonSQSClient=#sqsClient")
> > >> > but it does not change, I still see the messages with a delay of 5
> > >> seconds
> > >> > between each of them.
> > >> >
> > >> > If I turn on the trace with
> > >> > (logging.level.org.apache.camel.component.aws2.sqs=TRACE). I see
> that
> > >> the
> > >> > next polling is only triggered after
> > >> > the Delete message of a consumed message is sent. And in the logs I
> > see
> > >> "1
> > >> > message received" but no polling will occur until the Delete message
> > is
> > >> > sent which occurs only after the sleep of 5 secs. Only 1 message is
> > read
> > >> > per polling and I should see at least 5 of them since
> > >> > concurrentConsumers=5.
> > >> > It looks to me there is still only 1 concurrent consumer and I don't
> > >> > understand why.
> > >> >
> > >> > Arnaud
> > >> >
> > >> > On Mon, Jan 31, 2022 at 3:27 PM Larry Shields <
> > larry.shie...@gmail.com>
> > >> > wrote:
> > >> >
> > >> > > Hi Arnaud,
> > >> > >
> > >> > > I think what may be happening is that you first consumer is
> grabbing
> > >> all
> > >> > of
> > >> > > the messages from the queue that are available.  The default
> message
> > >> poll
> > >> > > size is unlimited so your other 4 consumers are polling for
> nothing
> > o

RE: How Camel consumes files using multithreading

2022-02-25 Thread Chirag
Were you able to solve this?

why would threads in SEDA itself not work?

On 2021/10/25 06:07:47 "robbenp...@foxmail.com" wrote:
> Dear all,
>  I am using Apache Camel to handle files from SFTP. Becausethere are too 
> many file in the same directoty, I want to use multithreading to handle these 
> files.

>
> Hera is my code.
> from("sftp://${sftp.username}:${sftp.password}@${sftp.host}:${sftp.port}/myDirectory?";
>  +
> 
> "readLock=changed&readLockMinAge=10s&autoCreate=true&move=finish/$simple{date:now:MMdd}/$simple{file:onlyname}"
>  +

> 
> "&moveFailed=failed/$simple{date:now:MMdd}/$simple{file:onlyname}")
> .to("seda:img");
>
> from("seda:img")
> .threads(5,20)
> .keepAliveTime(20)
> .process(parseTypeProcessor)
> .process(uploadToOSSProcessor)
> .process(saveImgProcessor)
> .end();
> But it does not work.
>
> Is there any way to use multithreading  in Apache Camel?
>
> Any help or information that you can provide will be greatly appreciated.
>
> Sincerely,
> Robben
>
>
> robbenp...@foxmail.com
>


Re: Apache Camel and hawt.io debugging: Body/Header not visible at breakpoint

2022-03-16 Thread Chirag
Bert,

I am trying to build something similar.
can you point me in the right direction to enabling Jolokia with
hawtio and camel-main?
I am currently running embedded hawtio.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Mar 14, 2022 at 2:50 AM Bert Speckels  wrote:
>
> Yes, maybe. But yesterday evening the situation has changed:
>
> After some changes concerning other aspects of my application (like
> assigning an ID to most of the route nodes) debugging works now
> including the display of body and headers.
>
> I have no clue what changed to make it work.
> And at the same time my application property
> "camel.main.debugging=true" failed on startup:
>
> Error binding property (camel.main.debugging=true) with name:
> debugging on bean: org.apache.camel.main.MainConfigurationProperties
>
> I had to enabled debugging at the context like this:
> getContext().setDebugging(true);
>
> Has anybody any idea?
>
> Am Mo., 14. März 2022 um 06:46 Uhr schrieb Tadayoshi Sato
> :
> >
> > Hi Bert,
> >
> > It's likely that the problem is in Hawtio. Hawtio is not yet updated with 
> > the latest Camel versions.
> > Feel free to file your issue at 
> > https://github.com/hawtio/hawtio-integration/issues
> >
> > Thanks,
> > Tadayoshi
> >
> > On Mon, Mar 14, 2022 at 3:20 AM Bert Speckels  
> > wrote:
> >>
> >> Hi
> >>
> >> I am quite new with Apache Camel and assigned to this mailing list
> >> just a few minutes ago.
> >> So please be kind to me :-D
> >>
> >> ---
> >>
> >> Until now I was very successful with using Camel. It is exactly what
> >> we need for our project.
> >> But I wouldn't write here if I didn't have a problem ...
> >>
> >> I'm currently working with Apache Camel and hawt.io for monitoring and
> >> debugging my Camel routes.
> >> This works wonderfully, even if some important information is somewhat
> >> hidden in the documentation. For example, it took me a bit to turn on
> >> debugging.
> >>
> >> However, if I set a breakpoint in debugging mode then the message
> >> processing stops at that point in the route.
> >> My problem is that I can't see any "body" or "headers" of the Camel
> >> Exchange at that point.
> >>
> >> I've tried all sorts of settings:
> >> - tracing / backlog tracing enabled on CamelContext
> >> - tracing / backlog tracing enabled on route
> >> - Adjusted settings on MBean "BacklogDebugger" and "BacklogTracer".
> >>
> >> On the other side tracing works: If I activate tracing in the "Trace"
> >> tab, I can see the flow of my messages through all nodes of the route.
> >> Only in "Debugging" tab there is no body nor header when  the route
> >> stopped at the breakpoint.
> >>
> >> Here is some information:
> >>
> >> - I don't use any special framework: Plain old Java with a Main method
> >> in which I start Camel-Main.
> >> - Apache Camel: 3.14.1
> >> - Jolokai Agent: 1.7.1
> >> - hawt.io: 2.14.5
> >> - Exchange body type: DOMSource
> >>
> >> Maybe anyone has an idea what I can try to get the exchange content
> >> while debugging via jmx/hawt.io
> >>
> >> This is my route:
> >>
> >> getCamelContext().setBacklogTracing(true);
> >>
> >> --
> >> from(rabbitMqFactory.queueConnect("tso11", "tso11-to-nms", "username"))
> >>   .routeGroup("Workflow")
> >>   .routeId("Workflow-to-NMS|Map-TSO11-to-NMS42")
> >>   .routeDescription("Mapping of TSO11 Message to NMS42")
> >>   .convertBodyTo(DOMSource.class)
> >>   .log("Message for '$simple{header:tenant}' received")
> >>   .process(tso11ToNmsMappingProcessor)
> >>   .to("xslt:xslt/tso11-to-nms42.xslt")
> >>   .to("direct:send");
> >> --
> >>
> >> ANd these are current properties:
> >>
> >> --
> >> camel.main.name=TSO11
> >> camel.main.jmxEnabled=true
> >> camel.main.debugging=true
> >> camel.main.backlogTracing=true
> >> camel.main.lightweight=false
> >> camel.main.tracing=false
> >> camel.main.useBreadcrumb=true
> >> --
> >>
> >> Thanks for reading
> >> With kind regards
> >
> >
> >
> > --
> > Tadayoshi Sato


Re: Using the RoutesLoader

2022-04-11 Thread Chirag
Hello Raymond,

Are you trying to use Camel 3 ?
Would you use Maven or Gradle to build?

Here is an example:
https://github.com/chiragsanghavi/camel-experiments/tree/main/processor
if this helps.

This example was built to demonstrate a bug- but if you update maven
to use camel 3.1.5 - it should work.
Only thing needed to support YAML is a change in pom.xml to include
yaml dsl and create yaml files and put them into "routes" folder.


org.apache.camel
camel-yaml-dsl




ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Apr 11, 2022 at 6:15 AM ski n  wrote:
>
> Hi All,
>
> I like to use the routesLoader (
> https://javadoc.io/static/org.apache.camel/camel-api/3.16.0/org/apache/camel/spi/annotations/RoutesLoader.html
> ).
> I have some questions about how to properly use it.
>
> 1) Is there any documentation on how to use it? (At
> https://camel.apache.org/manual/ or
> https://camel.apache.org/components/next/index.html).
>
> 2) I could find some examples (https://github.com/apache/camel-examples),
> there the routesloader example says:
>
> 
>
> 
> 
> 
> 
>
> These examples loads xml, can it also loads other DSL's? (Like yaml or
> Java).
>
> 3) How to use OnException with the RouteLoader?
>
> I thought maybe like this
>
> http://camel.apache.org/schema/spring";>
> 
>  java.lang.Exception
>  
>  true
>  
> 
> 
> 
> 
> 
> 
>
> But this gave me a nullpointer exception.
>
> 4) Load from string directly
>
> In Camel 2 you could load routes directly from string like this:
>
> ManagedCamelContext managed =
> context.getExtension(ManagedCamelContext.class);
> managedContext = managed.getManagedCamelContext();
> managedContext.addOrUpdateRoutesFromXml(routeAsString);
>
> In Camel 3 the "addOrUpdateRoutesFromXml" is depracated. With routeLoader
> from string I do it like this:
>
> ExtendedCamelContext extendedCamelContext =
> context.adapt(ExtendedCamelContext.class);
> RoutesLoader loader = extendedCamelContext.getRoutesLoader();
> Resource resource = ResourceHelper.fromString("any.xml", route);
>
> loader.updateRoutes(resource);
>
> Is this the only way in Camel 3, or is there also a specific method to use
> strings directly (and maybe only specify the DSL used) like:
>
> loader.updateRoutes(routeAsString, "xml");
>
>
> Raymond


Re: Using the RoutesLoader

2022-04-11 Thread Chirag
You could wrap it using try/catch.

See:  https://camel.apache.org/manual/try-catch-finally.html

My experience with it is - it depends on the endpoint involved to
throw exceptions and enter doCatch appropriately.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Apr 11, 2022 at 11:10 AM Claus Ibsen  wrote:
>
> Hi
>
> See routes configuration
> https://camel.apache.org/manual/route-configuration.html
>
> On Mon, Apr 11, 2022 at 4:30 PM ski n  wrote:
> >
> > I am indeed using Camel 3 (Currently 3.14.2) and using Maven. I just use
> > plain Java (camel core), so I have a similar setup as your example (only
> > I'm using Java, instead of the application.properties to configure the
> > Camel context and its routes). Your example helped me to also use the Yaml
> > dsl.
> >
> > I am still wondering how to do proper errorHandling/onException with the
> > routesloader.
> >
> > I can set for example the errorHandler globally:
> >
> > extendedCamelContext.setErrorHandlerFactory(routeErrorHandler);
> >
> > But I rather set it per route / per exception (and best of all from the
> > xml/yaml files). Like it used to be done like this:
> >
> >   http://camel.apache.org/schema/spring";>
> > 
> > 
> >   org.apache.camel.CamelAuthorizationException
> >   
> > true
> >   
> >   
> > Access Denied with the Policy of ${exception.policyId}
> > !
> >   
> > 
> >
> > 
> >   
> >   
> >   
> > 
> >   Normal user can access this service
> > 
> >   
> > 
> >
> > 
> >   
> >   
> >   
> > 
> >   Call the admin operation OK
> > 
> >   
> > 
> >
> >   
> >
> > But such files are not accepted by the routesLoader.
> >
> > I also tried setting the error handler on a specific route from Java like
> > this:
> >
> > Route route = context.getRoute(myRouteId);
> > route.setErrorHandlerFactory(routeErrorHandler);
> >
> > But that didn't change anything.
> >
> > Raymond
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Apr 11, 2022 at 3:36 PM Chirag  wrote:
> >
> > > Hello Raymond,
> > >
> > > Are you trying to use Camel 3 ?
> > > Would you use Maven or Gradle to build?
> > >
> > > Here is an example:
> > > https://github.com/chiragsanghavi/camel-experiments/tree/main/processor
> > > if this helps.
> > >
> > > This example was built to demonstrate a bug- but if you update maven
> > > to use camel 3.1.5 - it should work.
> > > Only thing needed to support YAML is a change in pom.xml to include
> > > yaml dsl and create yaml files and put them into "routes" folder.
> > >
> > > 
> > > org.apache.camel
> > > camel-yaml-dsl
> > > 
> > >
> > >
> > >
> > > ચિરાગ/चिराग/Chirag
> > > --
> > > Sent from My Gmail Account
> > >
> > > On Mon, Apr 11, 2022 at 6:15 AM ski n  wrote:
> > > >
> > > > Hi All,
> > > >
> > > > I like to use the routesLoader (
> > > >
> > > https://javadoc.io/static/org.apache.camel/camel-api/3.16.0/org/apache/camel/spi/annotations/RoutesLoader.html
> > > > ).
> > > > I have some questions about how to properly use it.
> > > >
> > > > 1) Is there any documentation on how to use it? (At
> > > > https://camel.apache.org/manual/ or
> > > > https://camel.apache.org/components/next/index.html).
> > > >
> > > > 2) I could find some examples (https://github.com/apache/camel-examples
> > > ),
> > > > there the routesloader example says:
> > > >
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > These examples loads xml, can it also loads other DSL's? (Like yaml or
> > > > Java).
> > > >
> > > > 3) How to use OnException with the RouteLoader?
> > > >
> > > > I thought maybe like this
> > > >
> > > > http://camel.apache.org/schema/spring";>
> > > > 
> > > >  java.lang.Exception
> >

Re: Using the RoutesLoader

2022-04-12 Thread Chirag
Raymond,

to summarise:
You want to load route configuration using XML?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Tue, Apr 12, 2022 at 7:59 AM ski n  wrote:
>
> Loading the routeconfiguration through:
>
> loader.loadRoutes(resource);
>
> also doesn't work. Directly from Java is no problem. Is this a bug or
> should the XML RouteConfiguration loaded differently?
>
> Raymond
>
> On Mon, Apr 11, 2022 at 10:26 PM ski n  wrote:
>
> > As a note:
> >
> > When when using the routeConfiguration from Java and load it:
> >
> > public class MyJavaErrorHandler extends RouteConfigurationBuilder {
> >
> > @Override
> > public void configuration() throws Exception {
> > routeConfiguration("xmlError")
> > .onException(Exception.class).handled(true)
> > .log("Java WARN: ${exception.message}");
> > }
> > }
> >
> > context.addRoutes(new MyJavaErrorHandler());
> >
> > then it works as expected. Thus, it must be because of the way the
> > routeconfiguration was loaded. I loaded it using:
> >
> > loader.updateRoutes(resource);
> >
> > I assumed it worked similar to the old "addOrUpdateXml" method as it says
> >
> > "Loads or updates existing RoutesBuilder". However it works differently
> > (at least for RouteConfiguration). When changing the
> > routeConfiguration to:
> >
> > loader.loadRoutes(resource);
> >
> > then it worked.
> >
> > Raymond
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Apr 11, 2022 at 9:13 PM ski n  wrote:
> >
> >> Yes, with the try-catch-finally clause one can have more fine-grained.
> >> However, I am not the one who writes the routes. I am only loading them.
> >> That's why I need a more generic behavior (errorHandler) with some
> >> configuration options (routeConfiguration).
> >>
> >> I assumed that the XML routeConfiguration can be loaded the same as a
> >> 'normal' xml route. I loaded the following:
> >>
> >> 
> >> 
> >> java.lang.Exception
> >> true
> >> 
> >> 
> >>
> >> And then the route:
> >>
> >> 
> >> 
> >> 
> >> 
> >>
> >>
> >> I see the error thrown "Some kind of XML error", but I don't see it
> >> handled (for example the XML WARN message). Is there something that I am
> >> missing?
> >>
> >> Raymond
> >>
> >>
> >>
> >>
> >>
> >> On Mon, Apr 11, 2022 at 6:06 PM Chirag  wrote:
> >>
> >>> You could wrap it using try/catch.
> >>>
> >>> See:  https://camel.apache.org/manual/try-catch-finally.html
> >>>
> >>> My experience with it is - it depends on the endpoint involved to
> >>> throw exceptions and enter doCatch appropriately.
> >>>
> >>> ચિરાગ/चिराग/Chirag
> >>> --
> >>> Sent from My Gmail Account
> >>>
> >>> On Mon, Apr 11, 2022 at 11:10 AM Claus Ibsen 
> >>> wrote:
> >>> >
> >>> > Hi
> >>> >
> >>> > See routes configuration
> >>> > https://camel.apache.org/manual/route-configuration.html
> >>> >
> >>> > On Mon, Apr 11, 2022 at 4:30 PM ski n 
> >>> wrote:
> >>> > >
> >>> > > I am indeed using Camel 3 (Currently 3.14.2) and using Maven. I just
> >>> use
> >>> > > plain Java (camel core), so I have a similar setup as your example
> >>> (only
> >>> > > I'm using Java, instead of the application.properties to configure
> >>> the
> >>> > > Camel context and its routes). Your example helped me to also use
> >>> the Yaml
> >>> > > dsl.
> >>> > >
> >>> > > I am still wondering how to do proper errorHandling/onException with
> >>> the
> >>> > > routesloader.
> >>> > >
> >>> > > I can set for example the errorHandler globally:
> >>> > >
> >>> > > extendedCamelContext.setErrorHandlerFactory(routeErrorHandler);
> >>> > >
> >>> &g

Re: Using the RoutesLoader

2022-04-13 Thread Chirag
while performing XML route, route needs to be explicitly associated
with configuration to use it.



Example on 
https://camel.apache.org/manual/route-configuration.html#_route_configuration_in_xml
works.

I think the gap is - when defining a framework based on camel - how to
associate specific routeconfigurations to all routes.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Apr 13, 2022 at 3:27 AM ski n  wrote:
>
> I also created an issue for this with an example:
> https://issues.apache.org/jira/browse/CAMEL-17953
>
>
> On Wed, Apr 13, 2022 at 9:25 AM ski n  wrote:
>
> > Yes, based on the link Claus send:
> >
> > https://camel.apache.org/manual/route-configuration.html
> >
> > There is an example of how to do it in Java and how to add it to the
> > CamelContext. There is also an example of how to do it with XML:
> >
> > 
> > 
> > java.lang.Exception
> > true
> > 
> > 
> >
> >
> > But there is nothing about how to add this to the CamelContext. I assumed
> > I need to do this through the RoutesLoader (the same as a normal route).
> > Note I add routes as String to the RoutesLoader. However this doesn't seem
> > to work.
> >
> > Raymond
> >
> >
> >
> > On Tue, Apr 12, 2022 at 11:38 PM Chirag  wrote:
> >
> >> Raymond,
> >>
> >> to summarise:
> >> You want to load route configuration using XML?
> >>
> >> ચિરાગ/चिराग/Chirag
> >> --
> >> Sent from My Gmail Account
> >>
> >> On Tue, Apr 12, 2022 at 7:59 AM ski n  wrote:
> >> >
> >> > Loading the routeconfiguration through:
> >> >
> >> > loader.loadRoutes(resource);
> >> >
> >> > also doesn't work. Directly from Java is no problem. Is this a bug or
> >> > should the XML RouteConfiguration loaded differently?
> >> >
> >> > Raymond
> >> >
> >> > On Mon, Apr 11, 2022 at 10:26 PM ski n 
> >> wrote:
> >> >
> >> > > As a note:
> >> > >
> >> > > When when using the routeConfiguration from Java and load it:
> >> > >
> >> > > public class MyJavaErrorHandler extends RouteConfigurationBuilder {
> >> > >
> >> > > @Override
> >> > > public void configuration() throws Exception {
> >> > > routeConfiguration("xmlError")
> >> > > .onException(Exception.class).handled(true)
> >> > > .log("Java WARN: ${exception.message}");
> >> > > }
> >> > > }
> >> > >
> >> > > context.addRoutes(new MyJavaErrorHandler());
> >> > >
> >> > > then it works as expected. Thus, it must be because of the way the
> >> > > routeconfiguration was loaded. I loaded it using:
> >> > >
> >> > > loader.updateRoutes(resource);
> >> > >
> >> > > I assumed it worked similar to the old "addOrUpdateXml" method as it
> >> says
> >> > >
> >> > > "Loads or updates existing RoutesBuilder". However it works
> >> differently
> >> > > (at least for RouteConfiguration). When changing the
> >> > > routeConfiguration to:
> >> > >
> >> > > loader.loadRoutes(resource);
> >> > >
> >> > > then it worked.
> >> > >
> >> > > Raymond
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> > > On Mon, Apr 11, 2022 at 9:13 PM ski n 
> >> wrote:
> >> > >
> >> > >> Yes, with the try-catch-finally clause one can have more
> >> fine-grained.
> >> > >> However, I am not the one who writes the routes. I am only loading
> >> them.
> >> > >> That's why I need a more generic behavior (errorHandler) with some
> >> > >> configuration options (routeConfiguration).
> >> > >>
> >> > >> I assumed that the XML routeConfiguration can be loaded the same as a
> >> > >> 'normal' xml route. I loaded the following:

Re: Download of latest relase JAR of hawt.io

2022-06-07 Thread Chirag
Bert,

Hawt.io documentation could also use some help for sure.
It does have its own group for discussion if you want to share feedback there.
https://groups.google.com/g/hawtio

 ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Tue, Jun 7, 2022 at 4:26 AM Bert Speckels  wrote:
>
> Hello there
>
> I know  this is not really a Camel question but it is related to
> Camel since hawt.io is a widely used tool for Apache Camel, isn't it?!
>
> I have always had difficulties finding the latest hawt.io JAR file for 
> download.
> All that I can see on the hawt.io homepage is the source code. Do I
> miss something or is the release of a JAR file still pending?
> Even the available JAR file for 2.14.5 is hard to find.
>
> WIth kind regards
> Bert Speckels


Re: netty http component - SNI missing in SSL handshake

2022-09-21 Thread Chirag
Ashitosh,

you are more likely to get answers if you are able to validate if the
issue is present in a higher version of netty connector.  Having said
that, your application architecture is very advanced as you seem to
use webSphere, akka and camel. Since IBM supports webSphere and can
also provide support for Camel (Referring to response from Claus),
have you asked IBM?

Issue may not be so much of Camel, but netty itself. see
https://github.com/netty/netty project where you may find SNI related
issues and fixes (https://github.com/netty/netty/issues/9643). You may
have to identify if the problem lies in Netty and if you can port fix
to version of netty library used in your application.

Lastly, you can always modify OSS code and create a version that works
for your needs.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Sep 15, 2022 at 9:54 AM Somvanshi, Ashitosh
 wrote:
>
> Hello Miranda,
>
> Thank you so much for your response. Unfortunately we cannot upgrade to 
> latest version because of application compatibility, currently we are using 
> 2.18.3.
> Is there any way to ask netty to not to force SSL and let app server(web 
> sphere) handle SSL. I am asking this because in same application we are using 
> nimbus library for OAuth, where SSL is handled by web sphere, we just 
> configure URL in application. In this case server name is going in client 
> hello, so can we do same with netty as well?
>
>
> Regards,
> Ashitosh Somvanshi
>
> From: Claudio Miranda 
> Sent: Thursday, September 15, 2022 4:30 PM
> To: users@camel.apache.org
> Cc: Claus Ibsen ; Somvanshi, Ashitosh 
> 
> Subject: Re: netty http component - SNI missing in SSL handshake
>
> On Thu, Sep 15, 2022 at 7: 00 AM Bheda, Nitesh  dieboldnixdorf. com> wrote: > > Artifact : camel-netty-http version : 2. 18. 
> 3 Can you try a more recent version, see https: //urldefense. proofpoint. 
> com/v2/url?u=https-3A__camel. apache. 
> org_download_&d=DwIBaQ&c=7my1DiYA8Epq5UwiA7n6nQ&r=anbIU-AWNbNwN9mk1yXNKHQ9fLiQrfEwRFpEUpkPBYnjcGlTYVI8mBzvjeDV8gkk&m=_RIn8CSLLlB7Xsx72ubcffFbyLlM_wy22SsbW0Dxe7EYG0BrMrOKjvhhu0IMsVZ2&s=wuFjxJb4mujYBTForV1ny3UeXBCP0wNBHWqZ3EeEpcw&e=
>
>
> On Thu, Sep 15, 2022 at 7:00 AM Bheda, Nitesh
>
> mailto:nitesh.bh...@dieboldnixdorf.com>> 
> wrote:
>
> >
>
> >  Artifact : camel-netty-http version : 2.18.3
>
>
>
> Can you try a more recent version, see 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__camel.apache.org_download_&d=DwIBaQ&c=7my1DiYA8Epq5UwiA7n6nQ&r=anbIU-AWNbNwN9mk1yXNKHQ9fLiQrfEwRFpEUpkPBYnjcGlTYVI8mBzvjeDV8gkk&m=_RIn8CSLLlB7Xsx72ubcffFbyLlM_wy22SsbW0Dxe7EYG0BrMrOKjvhhu0IMsVZ2&s=wuFjxJb4mujYBTForV1ny3UeXBCP0wNBHWqZ3EeEpcw&e=
>
> Try it on a dev machine, if it is fixed on it.
>
>
>
> --
>
>   Claudio Miranda
>
>
>
> clau...@claudius.com.br<mailto:clau...@claudius.com.br>
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.claudius.com.br&d=DwIBaQ&c=7my1DiYA8Epq5UwiA7n6nQ&r=anbIU-AWNbNwN9mk1yXNKHQ9fLiQrfEwRFpEUpkPBYnjcGlTYVI8mBzvjeDV8gkk&m=_RIn8CSLLlB7Xsx72ubcffFbyLlM_wy22SsbW0Dxe7EYG0BrMrOKjvhhu0IMsVZ2&s=nAEG5GdA8AUdMHvNtorc6jlRG3FbO-3vRzY0lG1nzz0&e=


Re: how to create Camel HTTP route with async handling

2022-10-04 Thread Chirag
In your scenario, how do you invoke route 1 from source ?

On Mon, Oct 3, 2022, 06:10 Chio Chuan Ooi  wrote:

> Hi,
>
> But in the camel route, how to have the route to wait for the webhook.
>
> Eventually, I need to expose 2 http consumer routes which 1 is for the
> request and another is for the webhook.
>
> After the request receipt from route 1, it will make an async call then
> holding the thread and waiting for the webhook to receive notification (in
> route 2) and then only responding back to route 1 request.
>
> Thanks,
> Chio Chuan
>
>
> On Tue, Sep 27, 2022 at 10:20 PM ski n  wrote:
>
> > With the Jetty component you set the option: *continuationTimeout* to 0
> > which means it will never expire (default is 30 seconds).
> >
> > When you use a JMS Broker (like ActiveMQ) there also an option to set the
> > request Timout (
> > https://camel.apache.org/components/3.18.x/jms-component.html) and for
> > Kafka there is the option: *consumerRequestTimeoutMs*.
> >
> > Raymond
> >
> > On Tue, Sep 27, 2022 at 12:39 PM  wrote:
> >
> >> Hi,
> >>
> >> I looking with async components that can do like below
> >> Flowchart Maker & Online Diagram Software
> >> <
> https://viewer.diagrams.net/index.html?tags=%7B%7D&highlight=ff&edit=_blank&layers=1&nav=1&title=http-async.drawio#R5Vprc5s4FP01%2FpgOAuPHx9h5dKfZ2U6TnbafOjLIRhuBWCFqs79%2BJRBPgSHxK21mMhPrIATcc8%2B9R9gja%2Bnv7hkMvT%2Bpi8jINNzdyLoZmSYYm%2BZI%2FhlukiHTqQI2DLtqUgk84v%2BQAg2FxthFUW0ip5RwHNZBhwYBcngNg4zRbX3ampL6VUO4QRrw6ECio1%2Bxy70MndlGiX9EeOPlVwaGOuLDfLICIg%2B6dFuBrNuRtWSU8uyTv1siIoOXxyU7767jaHFjDAV8yAlWEC%2FudmzuJA9GGPz19cmE91dqlZ%2BQxOqBl9BPKbwOQ3XfPMmDIR4hlB9jnzzgNSI4EKNFiBj2EUdMHCEK%2FlxiC0ENhwKTx0E6JgSGEV6lyxoCYciJWYR%2Foi8oyjIgRWkcuMhVoyJ86YAz%2BlwQIhfVo5E%2FGmIc7SqQis49ouIGWSKm5Edz6lSqztRwW%2FJeTPEqnFs5CFWubYqlSzrEB8XIC9gxNXY0SkKKA55e116M7JsGHZRxj25oAEmVkAMDuzeRBkd7bNeCPW0Lth7rAjx6rC0t1l%2FQvzGKuBZy%2BYxYVIhrgjeBgFaUc%2BqnwYOMX8uiI0MvVhIYCtwcWRHqPOfTVKWbHZsAsfYG7ZunUgi5tbqn08QQgVxIsl5RW6KuTv0sE7Gk92pqtPKbrxDRmDlIndSgrriLQWzeO%2FRj8Ef4YzeBcP6D%2Fk0%2BLZ6uwKxfOqUMZJi3HuboMYSOPLoVzUxgHvdJjQUtvYcS0ykDux4mYA7TARifSgd64DzOwzQhXiiHltQXkWLJNwFcGR8MkAPfc8DsV0N6ws1OHc9GSXVUKXQp2NkYsgzsV0pVUa25diZFmdN6xQSTYZLSF5r3LJQ98em0qWWY8Bq6PN%2B82egpBvt1b00vaDb2pfEbMBs9ge1OqqFmozXYeqybPetooda9xie4foYCeqIhdsT%2FxTuTg31J793K0fiXloP1EjkAe5gejuE5Wu%2FW1kIrm%2BmjGpaBvC3RRiDLOQ%2BUhip8%2FyDOE2W0Ycxpm6NrdO1ep7Cvo%2FU6hQ5WDjQGTe0IUbzOGNhmz0IdxkC4PJhUpildnMA6TDRRwigJZMEM4xXBkaclklAOr%2FMOlU91BM2pJJsG1seum6WYrIiwLJW63mVWqaoJCgUvKaGyAAQ0LdFrTEgDOkbBbHJlDK6YJxKxvnEQts56Z31sYr21Pjb%2FpfvY7EV9bH5hX5df7LyNrLaptmq7agGYB%2Byaj9IcxwOb4%2FwYzbG7FbW3vAlolNEp2Nsie%2BaLD9kdHHfDDC6SVjvMv6U5ZKvR98qRMpnkIKkMmqlUpCf4AGaN7Jwb0wtn51zPzu6XQcd%2Fp9Po4tbBjqvjOo3XjNbY2Jvm%2Bvz9stCeY3wOWejbaPWqcotWHqXPrap5gCtETucIO1ud%2BoJSnTwqItb%2FZmO%2F4xBFH4D8Ikntkq9NznwKXa8jdJpXgONLVLTXlY1zloOGiga%2BmH1pNWiKe2KMTi9WWxOrMOohDSKkpcLvumcbN%2BLe8tplds4dG5hcxFfkfkC0%2F3ndDphgdmE7YJ7JDhzG27Sr8bH3Jimzsd8Grb8jOKeo8hpeIWcLsay%2Ba%2FHswgdAQlbQEebkrrApFd4m0JffPAerKCwi9A54BI2eZNq2xmPRHg%2FkUQzLX11l%2Fa387Zp1%2Bz8%3D
> >
> >> viewer.diagrams.net
> >> <
> https://viewer.diagrams.net/index.html?tags=%7B%7D&highlight=ff&edit=_blank&layers=1&nav=1&title=http-async.drawio#R5Vprc5s4FP01%2FpgOAuPHx9h5dKfZ2U6TnbafOjLIRhuBWCFqs79%2BJRBPgSHxK21mMhPrIATcc8%2B9R9gja%2Bnv7hkMvT%2Bpi8jINNzdyLoZmSYYm%2BZI%2FhlukiHTqQI2DLtqUgk84v%2BQAg2FxthFUW0ip5RwHNZBhwYBcngNg4zRbX3ampL6VUO4QRrw6ECio1%2Bxy70MndlGiX9EeOPlVwaGOuLDfLICIg%2B6dFuBrNuRtWSU8uyTv1siIoOXxyU7767jaHFjDAV8yAlWEC%2FudmzuJA9GGPz19cmE91dqlZ%2BQxOqBl9BPKbwOQ3XfPMmDIR4hlB9jnzzgNSI4EKNFiBj2EUdMHCEK%2FlxiC0ENhwKTx0E6JgSGEV6lyxoCYciJWYR%2Foi8oyjIgRWkcuMhVoyJ86YAz%2BlwQIhfVo5E%2FGmIc7SqQis49ouIGWSKm5Edz6lSqztRwW%2FJeTPEqnFs5CFWubYqlSzrEB8XIC9gxNXY0SkKKA55e116M7JsGHZRxj25oAEmVkAMDuzeRBkd7bNeCPW0Lth7rAjx6rC0t1l%2FQvzGKuBZy%2BYxYVIhrgjeBgFaUc%2BqnwYOMX8uiI0MvVhIYCtwcWRHqPOfTVKWbHZsAsfYG7ZunUgi5tbqn08QQgVxIsl5RW6KuTv0sE7Gk92pqtPKbrxDRmDlIndSgrriLQWzeO%2FRj8Ef4YzeBcP6D%2Fk0%2BLZ6uwKxfOqUMZJi3HuboMYSOPLoVzUxgHvdJjQUtvYcS0ykDux4mYA7TARifSgd64DzOwzQhXiiHltQXkWLJNwFcGR8MkAPfc8DsV0N6ws1OHc9GSXVUKXQp2NkYsgzsV0pVUa25diZFmdN6xQSTYZLSF5r3LJQ98em0qWWY8Bq6PN%2B82egpBvt1b00vaDb2pfEbMBs9ge1OqqFmozXYeqybPetooda9xie4foYCeqIhdsT%2FxTuTg31J793K0fiXloP1EjkAe5gejuE5Wu%2FW1kIrm%2BmjGpaBvC3RRiDLOQ%2BUhip8%2FyDOE2W0Ycxpm6NrdO1ep7Cvo%2FU6hQ5WDjQGTe0IUbzOGNhmz0IdxkC4PJhUpildnMA6TDRRwigJZMEM4xXBkaclklAOr%2FMOlU91BM2pJJsG1seum6WYrIiwLJW63mVWqaoJCgUvKaGyAAQ0LdFrTEgDOkbBbHJlDK6YJxKxvnEQts56Z31sYr21Pjb%2FpfvY7EV9bH5hX5df7LyNrLaptmq7agGYB%2Byaj9IcxwOb4%2FwYzbG7FbW3vAlolNEp2Nsie%2BaLD9kdHHfDDC6SVjvMv6U5ZKvR98qRMpnkIKkMmqlUpCf4AGaN7Jwb0wtn51zPzu6XQcd%2Fp9Po4tbBjqvjOo3XjNbY2Jvm%2Bvz9stCeY3wOWejbaPWqcotWHqXPrap5gCtETucIO1ud%2BoJSnTwqItb%2FZmO%2F4xBFH4D8Ikntkq9NznwKXa8jdJpXgONLVLTXlY1zloOGiga%2BmH1pNWiKe2KMTi9WWxOrMOohDSKkpcLvumcbN%2BLe8tplds4dG5hcxFfkfkC0%2F3ndDphgdmE7YJ7JDhzG27Sr8bH3Jimzsd8Grb8jOKeo8hpeIWcLsay%2Ba%2FHswgdAQlbQEebkrrApFd4m0JffPAerKCwi9A54BI2eZNq2xmPRHg%2FkUQzLX11l%2Fa387Zp1%2Bz8%3D
> >
> >> [image: apple-touc

Re: Can we use custom socket connection in RabbitMQ camel component

2022-11-11 Thread Chirag
what type of proxy are you using?
are you able to make connection to RabbitMQ using Proxy using Java
outside of Camel program?
have you reviewed https://www.rabbitmq.com/networking.html#proxy-protocol


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Nov 10, 2022 at 4:55 AM N Venkatesh  wrote:
>
> Classification: Confidential
> Hi Team,
>
> Can you please help us for below request.
>
> Regards,
> Venkatesh
>
> From: N Venkatesh
> Sent: Wednesday, November 9, 2022 11:22 AM
> To: users@camel.apache.org
> Cc: Iliyas Shaik ; Santosh Kumar Mohapatra 
> ; Chetan Kumar Chauhan 
> ; Chavan Rohit Shankar 
> 
> Subject: Can we use custom socket connection in RabbitMQ camel component
>
> Classification: Confidential
> Hi Team,
>
> We are trying to connect RabbitMQ server connection through existing camel 
> component using customized socket connection. Here we want to supply proxy 
> host and proxy port via customized socket connection object.
>
> Can you please tell us, RabbitMQ camel component will support customized 
> socket connection .
>
> We tried below approach using java code:
>
> SocketConfigurator socketConfigurator = 
> SocketConfigurators.defaultConfigurator();
>socketConfigurator.configure(customSocket);
>
>
> endpoint.getConnectionFactory().setSocketConfigurator(socketConfigurator);
>
>
> Note:
> endpoint : it is a existing RabbitMQ camel component endpoint 
> (https://camel.apache.org/components/3.18.x/rabbitmq-component.html)
> customSocket : it is a customized java socket object from java.net.Socket 
> package.
>
> Regards,
> Venkatesh
> ::DISCLAIMER::
> 
> The contents of this e-mail and any attachment(s) are confidential and 
> intended for the named recipient(s) only. E-mail transmission is not 
> guaranteed to be secure or error-free as information could be intercepted, 
> corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses 
> in transmission. The e mail and its contents (with or without referred 
> errors) shall therefore not attach any liability on the originator or HCL or 
> its affiliates. Views or opinions, if any, presented in this email are solely 
> those of the author and may not necessarily reflect the views or opinions of 
> HCL or its affiliates. Any form of reproduction, dissemination, copying, 
> disclosure, modification, distribution and / or publication of this message 
> without the prior written consent of authorized representative of HCL is 
> strictly prohibited. If you have received this email in error please delete 
> it and notify the sender immediately. Before opening any email and/or 
> attachments, please check them for viruses and other defects.
> 


Alibaba MNS and Camel

2022-11-28 Thread Chirag
I found a camel based adapter that runs in SAP CPI.

https://www.integration-excellence.com/alibabacloud-mns-adapter-sap-cpi/

Is there a component that can run on plain vanilla camel?


Re: How to contribute component?

2022-12-01 Thread Chirag
Hi Sheng

do you have the component already published in a repo?
How are you packaging component currently in your environment?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Wed, Nov 30, 2022 at 11:15 PM Zheng Feng  wrote:
>
> Hi,
>
> Please refer to https://camel.apache.org/community/contributing/ at first
> and I think you could describe your component. It's also helpful to open a
> JIRA on https://issues.apache.org/jira/browse/CAMEL for a new component.
>
> Thanks,
> Zheng Feng
>
> On Thu, Dec 1, 2022 at 11:35 AM sheng zhou 
> wrote:
>
> > Hi there, i recently write a component based on
> > [camel-archetype-component](
> > https://camel.apache.org/manual/camel-maven-archetypes.html), i want to
> > know how to contribute it to camel repo
> >


Re: need help

2022-12-24 Thread Chirag
Karthik,
while you can always write a new component, but is specific usecase
not supported by any existing component?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Dec 19, 2022 at 6:08 AM Claus Ibsen  wrote:
>
> On Mon, Dec 19, 2022 at 11:27 AM Kartheek Veebhudi <
> kartheek.veebh...@gmail.com> wrote:
>
> > Hi Camel Users,
> >
> > We have a file transmission application which uses Apache Camel which is a
> > legacy application running on 2.25 version. We have created a custom
> > endpointConfiguration like
> >  > uri="ndmfile://prpertiesfile.xml?delay=12000/> > uri="ndm:send"/>
> >
> > ndmfile is an customEndpoint and using endpoint.setEndPointConfiguration()
> > and getEndPointConfiguration().
> >
> > Currently we are in a situation to upgrade it to 3.14/3.16 version and
> > these method got deprecated and deleted from 3.x version. Is there any
> > alternative for this method in new updated versions?
> >
> >
> No there is no alternative, they were AFAIR also deprecated in 2.x.
> https://github.com/apache/camel/blob/camel-2.25.x/camel-core/src/main/java/org/apache/camel/EndpointConfiguration.java#L25
>
> Just write the component like any other standard component, you can look at
> one of the existing components that is is somewhat similar to your
> component as inspiration.
>
>
>
> >
> > *Thanks & Regards,*
> > *Kartheek.Veebhudi*
> >
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Camel-JBang - File -> Split -> File

2023-02-01 Thread Chirag
Hello Fellow Camelriders,
https://camel.apache.org/components/3.20.x/eips/split-eip.html#_streaming_big_xml_payloads_using_xml_tokenize_language

I tried using camel jbang to run XML Split with Streaming.
Here is how my route is defined:



  //Batch
  




Stacktrace
---
org.apache.camel.InvalidPayloadException: No body available of type:
java.io.InputStream but has type:
org.apache.camel.component.file.GenericFile on: Batch.xml. Caused by:
No type converter available to convert from type:
org.apache.camel.component.file.GenericFile to the required type:
java.io.InputStream. Exchange[6D6CB32F70B1126-0007].
Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
type converter available to convert from type:
org.apache.camel.component.file.GenericFile to the required type:
java.io.InputStream]
at 
org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
~[camel-support-3.19.0.jar:3.19.0]
at 
org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.doEvaluate(XMLTokenExpressionIterator.java:151)
~[camel-stax-3.19.0.jar:3.19.0]
at 
org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.evaluate(XMLTokenExpressionIterator.java:134)
~[camel-stax-3.19.0.jar:3.19.0]
at 
org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
~[camel-support-3.19.0.jar:3.19.0]
at 
org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:143)
~[camel-core-processor-3.19.0.jar:3.19.0]
at 
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:295)
~[camel-core-processor-3.19.0.jar:3.19.0]
at org.apache.camel.processor.Splitter.process(Splitter.java:136)
~[camel-core-processor-3.19.0.jar:3.19.0]
at 
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
~[camel-core-processor-3.19.0.jar:3.19.0]
at 
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
~[camel-base-engine-3.19.0.jar:3.19.0]
at 
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
~[camel-base-engine-3.19.0.jar:3.19.0]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:175)
~[camel-core-processor-3.19.0.jar:3.19.0]
at 
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
~[camel-base-engine-3.19.0.jar:3.19.0]
at 
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:492)
~[camel-file-3.19.0.jar:3.19.0]
at 
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:245)
~[camel-file-3.19.0.jar:3.19.0]
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:206)
~[camel-file-3.19.0.jar:3.19.0]
at 
org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:202)
~[camel-support-3.19.0.jar:3.19.0]
at 
org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:116)
~[camel-support-3.19.0.jar:3.19.0]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
~[?:?]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
~[?:?]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: org.apache.camel.NoTypeConversionAvailableException: No
type converter available to convert from type:
org.apache.camel.component.file.GenericFile to the required type:
java.io.InputStream
at 
org.apache.camel.impl.converter.CoreTypeConverterRegistry.mandatoryConvertTo(CoreTypeConverterRegistry.java:274)
~[camel-base-3.19.0.jar:3.19.0]
at 
org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:123)
~[camel-support-3.19.0.jar:3.19.0]
... 22 more

I am using camel 3.19.0.

Is there a better way of doing this?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


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

2023-02-02 Thread Chirag
Upgrading to Camel 3.20.1 helped.

Thank you.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Feb 2, 2023 at 12:47 AM Claus Ibsen  wrote:
>
> Hi
>
> Upgrade to Camel 3.20.1
>
> On Thu, Feb 2, 2023 at 12:46 AM Chirag  wrote:
>
> > Hello Fellow Camelriders,
> >
> > https://camel.apache.org/components/3.20.x/eips/split-eip.html#_streaming_big_xml_payloads_using_xml_tokenize_language
> >
> > I tried using camel jbang to run XML Split with Streaming.
> > Here is how my route is defined:
> > 
> > 
> > 
> >   //Batch
> >   
> > 
> >
> > 
> >
> > Stacktrace
> >
> > ---
> > org.apache.camel.InvalidPayloadException: No body available of type:
> > java.io.InputStream but has type:
> > org.apache.camel.component.file.GenericFile on: Batch.xml. Caused by:
> > No type converter available to convert from type:
> > org.apache.camel.component.file.GenericFile to the required type:
> > java.io.InputStream. Exchange[6D6CB32F70B1126-0007].
> > Caused by: [org.apache.camel.NoTypeConversionAvailableException - No
> > type converter available to convert from type:
> > org.apache.camel.component.file.GenericFile to the required type:
> > java.io.InputStream]
> > at
> > org.apache.camel.support.MessageSupport.getMandatoryBody(MessageSupport.java:125)
> > ~[camel-support-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.doEvaluate(XMLTokenExpressionIterator.java:151)
> > ~[camel-stax-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.language.xtokenizer.XMLTokenExpressionIterator.evaluate(XMLTokenExpressionIterator.java:134)
> > ~[camel-stax-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
> > ~[camel-support-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:143)
> > ~[camel-core-processor-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:295)
> > ~[camel-core-processor-3.19.0.jar:3.19.0]
> > at org.apache.camel.processor.Splitter.process(Splitter.java:136)
> > ~[camel-core-processor-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
> > ~[camel-core-processor-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
> > ~[camel-base-engine-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> > ~[camel-base-engine-3.19.0.jar:3.19.0]
> > at org.apache.camel.processor.Pipeline.process(Pipeline.java:175)
> > ~[camel-core-processor-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
> > ~[camel-base-engine-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:492)
> > ~[camel-file-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:245)
> > ~[camel-file-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:206)
> > ~[camel-file-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:202)
> > ~[camel-support-3.19.0.jar:3.19.0]
> > at
> > org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:116)
> > ~[camel-support-3.19.0.jar:3.19.0]
> > at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
> > ~[?:?]
> > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
> > ~[?:?]
> > at
> > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> > ~[?:?]
> > at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
> > ~[?:?]
> > at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java

camel init works - but leaves errors

2023-02-16 Thread Chirag
I am running camel init b.xml (i tried yaml as well).

I am noticing that file is getting created - but then it  is erroring out

C:\work\jb>jbang --version
0.101.0
C:\work\jb>camel -V
3.20.2

It seems to not resolve sys:pid variable?

Here is complete stacktrace:

C:\work\jb>camel init b.xml
2023-02-16 12:53:30,548 main ERROR FileManager
(C:\Users\myuser/.camel/${sys:pid}.log) java.io.IOException: The
filename, directory name, or volume label syntax is incorrect
java.io.IOException: The filename, directory name, or volume label
syntax is incorrect
at java.base/java.io.WinNTFileSystem.canonicalize0(Native Method)
at 
java.base/java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:465)
at java.base/java.io.File.getCanonicalPath(File.java:626)
at java.base/java.io.File.getCanonicalFile(File.java:651)
at 
org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:139)
at 
org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:436)
at 
org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:423)
at 
org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:144)
at 
org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
at 
org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:183)
at 
org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:99)
at 
org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:52)
at 
org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1133)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1058)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:659)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:257)
at 
org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:303)
at 
org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
at 
org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
at 
org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
at 
org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
at 
org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
at 
org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
at 
org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
at 
org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
at 
org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
at org.apache.camel.util.FileUtil.(FileUtil.java:39)
at org.apache.camel.dsl.jbang.core.commands.Init.call(Init.java:85)
at org.apache.camel.dsl.jbang.core.commands.Init.call(Init.java:44)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at 
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at 
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
at main.CamelJBang.main(CamelJBang.java:36)

2023-02-16 12:53:30,556 main ERROR Could not create plugin of type
class org.apache.logging.log4j.core.appender.FileAppender for element
File: java.lang.IllegalStateException: ManagerFactory
[org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory@f99f5e0]
unable to create manager for [C:\Users\myuser/.camel/$

Re: camel init works - but leaves errors

2023-02-16 Thread Chirag
Created :
https://issues.apache.org/jira/browse/CAMEL-19067

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Feb 16, 2023 at 3:52 PM Claus Ibsen  wrote:
>
> Hi
>
> Thanks for reporting - yeah that smells like a windows problem/bug with
> camel-jbang.
> Can you create a JIRA ticket
>
> On Thu, Feb 16, 2023 at 7:02 PM Chirag  wrote:
>
> > I am running camel init b.xml (i tried yaml as well).
> >
> > I am noticing that file is getting created - but then it  is erroring out
> >
> > C:\work\jb>jbang --version
> > 0.101.0
> > C:\work\jb>camel -V
> > 3.20.2
> >
> > It seems to not resolve sys:pid variable?
> >
> > Here is complete stacktrace:
> >
> > C:\work\jb>camel init b.xml
> > 2023-02-16 12:53:30,548 main ERROR FileManager
> > (C:\Users\myuser/.camel/${sys:pid}.log) java.io.IOException: The
> > filename, directory name, or volume label syntax is incorrect
> > java.io.IOException: The filename, directory name, or volume label
> > syntax is incorrect
> > at java.base/java.io.WinNTFileSystem.canonicalize0(Native Method)
> > at java.base/java.io
> > .WinNTFileSystem.canonicalize(WinNTFileSystem.java:465)
> > at java.base/java.io.File.getCanonicalPath(File.java:626)
> > at java.base/java.io.File.getCanonicalFile(File.java:651)
> > at
> > org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:139)
> > at
> > org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:436)
> > at
> > org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:423)
> > at
> > org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:144)
> > at
> > org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
> > at
> > org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:183)
> > at
> > org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:99)
> > at
> > org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:52)
> > at
> > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1133)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1058)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:659)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:257)
> > at
> > org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:303)
> > at
> > org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
> > at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
> > at
> > org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
> > at
> > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
> > at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
> > at
> > org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
> > at
> > org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
> > at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
> > at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
> > at
> > org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
> > at
> > org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
> > at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
> > at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
> > at org.apache.camel.util.FileUtil.(FileUtil.java:39)
> > at org.apache.camel.dsl.jbang.core

Re: camel init works - but leaves errors

2023-02-21 Thread Chirag
Yes  -I saw the commits. Thank you for the fixes.  I didn't realize,
but it seems to have ended up becoming a larger fix.



ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account
On Fri, Feb 17, 2023 at 3:47 AM Claus Ibsen  wrote:
>
> Hi
>
> Thanks so we have a fix for this in next release.
> So the init command does not work for you on windows, but the run command
> should work.
>
>
>
> On Thu, Feb 16, 2023 at 10:29 PM Chirag  wrote:
>
> > Created :
> > https://issues.apache.org/jira/browse/CAMEL-19067
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Thu, Feb 16, 2023 at 3:52 PM Claus Ibsen  wrote:
> > >
> > > Hi
> > >
> > > Thanks for reporting - yeah that smells like a windows problem/bug with
> > > camel-jbang.
> > > Can you create a JIRA ticket
> > >
> > > On Thu, Feb 16, 2023 at 7:02 PM Chirag 
> > wrote:
> > >
> > > > I am running camel init b.xml (i tried yaml as well).
> > > >
> > > > I am noticing that file is getting created - but then it  is erroring
> > out
> > > >
> > > > C:\work\jb>jbang --version
> > > > 0.101.0
> > > > C:\work\jb>camel -V
> > > > 3.20.2
> > > >
> > > > It seems to not resolve sys:pid variable?
> > > >
> > > > Here is complete stacktrace:
> > > >
> > > > C:\work\jb>camel init b.xml
> > > > 2023-02-16 12:53:30,548 main ERROR FileManager
> > > > (C:\Users\myuser/.camel/${sys:pid}.log) java.io.IOException: The
> > > > filename, directory name, or volume label syntax is incorrect
> > > > java.io.IOException: The filename, directory name, or volume label
> > > > syntax is incorrect
> > > > at java.base/java.io.WinNTFileSystem.canonicalize0(Native
> > Method)
> > > > at java.base/java.io
> > > > .WinNTFileSystem.canonicalize(WinNTFileSystem.java:465)
> > > > at java.base/java.io.File.getCanonicalPath(File.java:626)
> > > > at java.base/java.io.File.getCanonicalFile(File.java:651)
> > > > at
> > > >
> > org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:139)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:436)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.FileManager$FileManagerFactory.createManager(FileManager.java:423)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:144)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:183)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:99)
> > > > at
> > > >
> > org.apache.logging.log4j.core.appender.FileAppender$Builder.build(FileAppender.java:52)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:124)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1133)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1058)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1050)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:659)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:257)
> > > > at
> > > >
> > org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:303)
> > > > at
> > > >
> > org.apache.logging.log4j.core.LoggerContext.setConfigur

Karavan + JBang + YAML DSL ; trying to use xtokenize

2023-02-28 Thread Chirag
This is actually two questions in one:

I am trying to build YAML to perform an XML Splitter (I was able to
build one using XML DSL).

Now trying with YAML DSL.

Here is YAML that I came up with using Karavan that looks / feels
similar to XML DSL.
- route:
id: route-a6b4
from:
  uri: file:/work/batchsplit/in
  id: from-d1ca
  steps:
- split:
id: split-6d45
expression:
  xtokenize:
id: xtokenize-460a
path: //Batchmaster
mode: w
streaming: true
steps:
  - to:
  uri: file:/work/batchsplit/out?fileName=${exchangeId}.xml
  id: to-1a10

It is erroring out:

C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
2023-02-28 13:25:15.565  INFO 5972 --- [   main]
org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
starting
2023-02-28 13:25:15.860  INFO 5972 --- [   main]
org.apache.camel.main.MainSupport   : Using Java 19.0.1 with PID 5972.
Started by csanghavi in C:\work\batchsplit
2023-02-28 13:25:15.873  INFO 5972 --- [   main]
mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
Unsupported field: path
 in file:batchsplitversion1.camel.yaml, line 12, column 23:
path: "//Batchmaster"
  ^

at 
org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
at 
org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
at 
org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)

a) what would be the right way to provide xpath for splitting to xtokenize.
b) how to provide that using Karavan (Screenshot attached).

Info:
Karavan running within Visual Studio Code on Windows. Route running
under Jbang 3.20.2 on Windows.

Regards,

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Karavan + JBang + YAML DSL ; trying to use xtokenize

2023-03-01 Thread Chirag
I am using 3.20.0


Here is my route in XML DSL:



http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://camel.apache.org/schema/spring";
xsi:schemaLocation="
http://camel.apache.org/schema/spring
https://camel.apache.org/schema/spring/camel-spring.xsd";>






//BatchMaster







Trying to redefine this to be Yaml so that this could be
edited/maintained thru Karavan.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account
On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen  wrote:
>
> Hi
>
> What karavan version do you use?
>
> xtokenize only have
> - mode
> - group
>
> as options so it may seem you use an outdated karavan version, or something?
>
> You can try karavan online via
> https://karavan.space/
>
> And I copied your code and there is no "path" in the UI. Remove that.
>
>
>
> On Tue, Feb 28, 2023 at 7:40 PM Chirag  wrote:
>
> > This is actually two questions in one:
> >
> > I am trying to build YAML to perform an XML Splitter (I was able to
> > build one using XML DSL).
> >
> > Now trying with YAML DSL.
> >
> > Here is YAML that I came up with using Karavan that looks / feels
> > similar to XML DSL.
> > - route:
> > id: route-a6b4
> > from:
> >   uri: file:/work/batchsplit/in
> >   id: from-d1ca
> >   steps:
> > - split:
> > id: split-6d45
> > expression:
> >   xtokenize:
> > id: xtokenize-460a
> > path: //Batchmaster
> > mode: w
> > streaming: true
> > steps:
> >   - to:
> >   uri: file:/work/batchsplit/out?fileName=${exchangeId}.xml
> >   id: to-1a10
> >
> > It is erroring out:
> >
> > C:\work\batchsplit>camel run batchsplitversion1.camel.yaml
> > 2023-02-28 13:25:15.565  INFO 5972 --- [   main]
> > org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
> > starting
> > 2023-02-28 13:25:15.860  INFO 5972 --- [   main]
> > org.apache.camel.main.MainSupport   : Using Java 19.0.1 with PID 5972.
> > Started by csanghavi in C:\work\batchsplit
> > 2023-02-28 13:25:15.873  INFO 5972 --- [   main]
> > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > Unsupported field: path
> >  in file:batchsplitversion1.camel.yaml, line 12, column 23:
> > path: "//Batchmaster"
> >   ^
> >
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.handleUnknownProperty(YamlDeserializerBase.java:132)
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.setProperties(YamlDeserializerBase.java:126)
> > at
> > org.apache.camel.dsl.yaml.common.YamlDeserializerBase.construct(YamlDeserializerBase.java:65)
> >
> > a) what would be the right way to provide xpath for splitting to xtokenize.
> > b) how to provide that using Karavan (Screenshot attached).
> >
> > Info:
> > Karavan running within Visual Studio Code on Windows. Route running
> > under Jbang 3.20.2 on Windows.
> >
> > Regards,
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Karavan + JBang + YAML DSL ; trying to use xtokenize

2023-03-02 Thread Chirag
seService.java:83)
at 
org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679)
at 
org.apache.camel.support.service.BaseService.start(BaseService.java:111)
at 
org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698)
at 
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262)
at org.apache.camel.main.KameletMain.doStart(KameletMain.java:274)
at 
org.apache.camel.support.service.BaseService.start(BaseService.java:119)
at 
org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at 
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at 
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
at main.CamelJBang.main(CamelJBang.java:36)
Caused by: java.lang.IllegalArgumentException: Namespaces is not
instance of java.util.Map or
org.apache.camel.support.builder.Namespaces
at 
org.apache.camel.language.xtokenizer.XMLTokenizeLanguage.createExpression(XMLTokenizeLanguage.java:119)
at 
org.apache.camel.reifier.language.XMLTokenizerExpressionReifier.createExpression(XMLTokenizerExpressionReifier.java:42)
at 
org.apache.camel.reifier.language.ExpressionReifier.createExpression(ExpressionReifier.java:177)
at 
org.apache.camel.reifier.AbstractReifier.createExpression(AbstractReifier.java:119)
at 
org.apache.camel.reifier.SplitReifier.createProcessor(SplitReifier.java:63)
at 
org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:857)
at 
org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:598)
at 
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:211)

Let me get a JIRA started.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Mar 1, 2023 at 4:14 PM Claus Ibsen  wrote:
>
> Hi
>
> Oh can you try using expression instead of path, so its
>
> expression:
>   xtokenize:
> id: xtokenize-460a
> expression: //Batchmaster
> mode: w
>
> On Wed, Mar 1, 2023 at 10:13 PM Claus Ibsen  wrote:
>
> > Hi
> >
> > Ah there is a point that xtokenize is using @XmlValue to set that "path".
> > And the yaml-dsl is potentially not handing this correctly.
> > Can you create a JIRA ticket and I will try to find some time to look
> > at it?
> >
> > On Wed, Mar 1, 2023 at 7:35 PM Chirag  wrote:
> >
> >> I am using 3.20.0
> >>
> >>
> >> Here is my route in XML DSL:
> >> 
> >> 
> >>
> >> http://www.w3.org/2001/XMLSchema-instance";
> >> xmlns="http://camel.apache.org/schema/spring";
> >> xsi:schemaLocation="
> >> http://camel.apache.org/schema/spring
> >> https://camel.apache.org/schema/spring/camel-spring.xsd";>
> >>
> >> 
> >>
> >> 
> >> 
> >> 
> >> //BatchMaster
> >> 
> >> 
> >> 
> >>
> >> 
> >>
> >>
> >> Trying to redefine this to be Yaml so that this could be
> >> edited/maintained thru Karavan.
> >>
> >> ચિરાગ/चिराग/Chirag
> >> --
> >> Sent from My Gmail Account
> >> On Wed, Mar 1, 2023 at 1:14 AM Claus Ibsen  wrote:
> >> >
> >> > Hi
> >> >
> >> > What karavan version do you use?
> >> >
> >> > xtokenize only have
> >> > - mode
> >> > - group
> >> >
> >> > as options so it may seem you use an outdated karavan version, or
> >> something?
> >> >
> >> > You can try karavan online via
> >> > https://karavan.space/
> >> >
> >> > And I copied your code and there is no "pa

Re: Karavan + JBang + YAML DSL ; trying to use xtokenize

2023-03-02 Thread Chirag
JIRA Logged.

https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-19111

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Mar 2, 2023 at 9:33 AM Chirag  wrote:
>
> Thanks Claus.
>
> with expression containing //Batchmaster, It does not seem to like xtokenize
>
> 2023-03-02 09:29:03.391  INFO 18204 --- [   main]
> org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
> starting
> 2023-03-02 09:29:03.572  INFO 18204 --- [   main]
> org.apache.camel.main.MainSupport   : Using Java 19.0.1 with PID
> 18204. Started by csanghavi in C:\work\batchsplit
> 2023-03-02 09:29:03.591  INFO 18204 --- [   main]
> mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> org.apache.camel.RuntimeCamelException: Error pre-parsing resource:
> file:batchsplitversion1.camel.yaml
> at 
> org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader.preParseRoute(YamlRoutesBuilderLoader.java:766)
> at 
> org.apache.camel.impl.engine.DefaultRoutesLoader.preParseRoute(DefaultRoutesLoader.java:138)
> at 
> org.apache.camel.main.RoutesConfigurer.configureModeline(RoutesConfigurer.java:283)
> at 
> org.apache.camel.main.BaseMainSupport.modelineRoutes(BaseMainSupport.java:629)
> at 
> org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:485)
> at 
> org.apache.camel.main.MainSupport.autoconfigure(MainSupport.java:74)
> at 
> org.apache.camel.main.KameletMain.autoconfigure(KameletMain.java:466)
> at 
> org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:693)
> at 
> org.apache.camel.main.MainSupport.initCamelContext(MainSupport.java:404)
> at org.apache.camel.main.KameletMain.doInit(KameletMain.java:265)
> at 
> org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:111)
> at 
> org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:732)
> at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:564)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:218)
> at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:77)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at 
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at 
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at 
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:134)
> at main.CamelJBang.main(CamelJBang.java:36)
> Caused by: mapping values are not allowed here
>  in file:batchsplitversion1.camel.yaml, line 10, column 24:
>   xtokenize:
>^
>
> at 
> org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchValue(ScannerImpl.java:822)
> at 
> org.snakeyaml.engine.v2.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:333)
> at 
> org.snakeyaml.engine.v2.scanner.ScannerImpl.checkToken(ScannerImpl.java:192)
> at 
> org.snakeyaml.engine.v2.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:616)
> at 
> org.snakeyaml.engine.v2.parser.ParserImpl.lambda$produce$0(ParserImpl.java:181)
> at java.base/java.util.Optional.ifPresent(Optional.java:178)
>
>
>
> if i don't provide expression value:
>
> 2023-03-02 09:30:28.444  INFO 2468 --- [   main]
> org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
> starting
> 2023-03-02 09:30:28.594  INFO 2468 --- [   main]
> org.apache.camel.main.MainSupport   : Using Java 19.0.1 with PID 2468.
> Started by csanghavi in C:\work\batchsplit
> 2023-03-02 09:30:28.611  INFO 2468 --- [   main]
> mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route-a6b4 at: >>> Split[xtokenize{} ->
> [To[file:/work/batchsplit/out?fileName=${exchangeId}.xml]]] <<< in
> route: Route(route-a6b4)[From[file:/work/batchsplit/in] -> [Split[x...
> because of Namespaces is not instance of java.util.Map or
> org.apache.camel.support.builder.Namespaces
&g

Re: Blocking message transfer to MQ

2023-03-13 Thread Chirag
You would be looking at implementing Request/Reply EIP.

https://camel.apache.org/components/3.20.x/eips/requestReply-eip.html

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Mar 13, 2023 at 10:46 AM Yash Ganthe  wrote:
>
> Hi,
>
> I would like to send messages to MQ such that when a message is PUT on the
> queue, Camel will wait for a response from the application that is
> consuming from the queue. The response will come on a second queue. Once
> the response arrives, Camel will check that the response has the same
> Correlation ID as the ID of the sent message. If the ID and correlation ID
> match, the message will be considered as complete and Camel will send the
> next message.
>
> This sounds like a common pattern. Is there an out of box support for
> implementing it?
>
> Regards,
> Yash


camel run * --camel-version=3.20.2

2023-03-14 Thread Chirag
This is for linux:

$ jbang --version
0.104.0
$ camel -V
3.20.2
$ ls
first.yaml
$ camel run *
2023-03-14 13:24:53.909  INFO 1766376 --- [   main]
org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
starting
2023-03-14 13:24:54.173  INFO 1766376 --- [   main]
org.apache.camel.main.MainSupport   : Using Java 11.0.8 with PID
1766376. Started by mifadmin in /home/mifadmin
2023-03-14 13:24:54.194  INFO 1766376 --- [   main]
mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
2023-03-14 13:24:55.399  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
starting
2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Routes startup (started:1)
2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Started route1
(timer://yaml)
2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
started in 636ms (build:245ms init:192ms start:199ms JVM-uptime:2s)
2023-03-14 13:24:56.579  INFO 1766376 --- [ - timer://yaml]
first.yaml:11   : Hello Camel from yaml
2023-03-14 13:24:57.567  INFO 1766376 --- [ - timer://yaml]
first.yaml:11   : Hello Camel from yaml
2023-03-14 13:24:58.567  INFO 1766376 --- [ - timer://yaml]
first.yaml:11   : Hello Camel from yaml
2023-03-14 13:24:59.568  INFO 1766376 --- [ - timer://yaml]
first.yaml:11   : Hello Camel from yaml
^C2023-03-14 13:24:59.661  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
shutting down (timeout:10s)
2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Routes stopped (stopped:1)
2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Stopped route1
(timer://yaml)
2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
shutdown in 12ms (uptime:4s JVM-uptime:7s)
2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2
shutdown

$ camel run *  --camel-version=3.20.1
No Camel integration files to run


Should this be a JIRA? attached is highlighted documentation page.



ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: camel run * --camel-version=3.20.2

2023-03-15 Thread Chirag
Here is my output.
https://gist.github.com/chiragsanghavi/5926f71c7296bb2bf33434d5e33c95fb

i also do not have success with --background

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Mar 15, 2023 at 4:22 AM Federico Mariani
 wrote:
>
> Hello,
>
> Probably this https://issues.apache.org/jira/browse/CAMEL-19103 will solve
> your issue, the fix is already merged on 3.20.x, 3.x and main branch.
>
> Greetings,
> Federico
>
> Il giorno mar 14 mar 2023 alle ore 18:29 Chirag 
> ha scritto:
>
> > This is for linux:
> >
> > $ jbang --version
> > 0.104.0
> > $ camel -V
> > 3.20.2
> > $ ls
> > first.yaml
> > $ camel run *
> > 2023-03-14 13:24:53.909  INFO 1766376 --- [   main]
> > org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
> > starting
> > 2023-03-14 13:24:54.173  INFO 1766376 --- [   main]
> > org.apache.camel.main.MainSupport   : Using Java 11.0.8 with PID
> > 1766376. Started by mifadmin in /home/mifadmin
> > 2023-03-14 13:24:54.194  INFO 1766376 --- [   main]
> > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > 2023-03-14 13:24:55.399  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
> > starting
> > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Routes startup (started:1)
> > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Started route1
> > (timer://yaml)
> > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
> > started in 636ms (build:245ms init:192ms start:199ms JVM-uptime:2s)
> > 2023-03-14 13:24:56.579  INFO 1766376 --- [ - timer://yaml]
> > first.yaml:11   : Hello Camel from yaml
> > 2023-03-14 13:24:57.567  INFO 1766376 --- [ - timer://yaml]
> > first.yaml:11   : Hello Camel from yaml
> > 2023-03-14 13:24:58.567  INFO 1766376 --- [ - timer://yaml]
> > first.yaml:11   : Hello Camel from yaml
> > 2023-03-14 13:24:59.568  INFO 1766376 --- [ - timer://yaml]
> > first.yaml:11   : Hello Camel from yaml
> > ^C2023-03-14 13:24:59.661  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
> > shutting down (timeout:10s)
> > 2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Routes stopped (stopped:1)
> > 2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Stopped route1
> > (timer://yaml)
> > 2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
> > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
> > shutdown in 12ms (uptime:4s JVM-uptime:7s)
> > 2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
> > org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2
> > shutdown
> >
> > $ camel run *  --camel-version=3.20.1
> > No Camel integration files to run
> >
> >
> > Should this be a JIRA? attached is highlighted documentation page.
> >
> >
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >


Re: camel run * --camel-version=3.20.2

2023-03-20 Thread Chirag
I am going to try building it (I tried over the weekend, but my dev
server ran out of disk space).


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Mar 16, 2023 at 5:11 AM Federico Mariani
 wrote:
>
> The fix in https://issues.apache.org/jira/browse/CAMEL-19103 will be
> present in the next release 3.20.3, if you want to try it, you can checkout
> camel-3.x, build it and use jbang.camel.version=3.20.3-SNAPSHOT
>
> Il giorno gio 16 mar 2023 alle ore 04:36 Chirag 
> ha scritto:
>
> > Here is my output.
> > https://gist.github.com/chiragsanghavi/5926f71c7296bb2bf33434d5e33c95fb
> >
> > i also do not have success with --background
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Wed, Mar 15, 2023 at 4:22 AM Federico Mariani
> >  wrote:
> > >
> > > Hello,
> > >
> > > Probably this https://issues.apache.org/jira/browse/CAMEL-19103 will
> > solve
> > > your issue, the fix is already merged on 3.20.x, 3.x and main branch.
> > >
> > > Greetings,
> > > Federico
> > >
> > > Il giorno mar 14 mar 2023 alle ore 18:29 Chirag <
> > chirag.sangh...@gmail.com>
> > > ha scritto:
> > >
> > > > This is for linux:
> > > >
> > > > $ jbang --version
> > > > 0.104.0
> > > > $ camel -V
> > > > 3.20.2
> > > > $ ls
> > > > first.yaml
> > > > $ camel run *
> > > > 2023-03-14 13:24:53.909  INFO 1766376 --- [   main]
> > > > org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2 is
> > > > starting
> > > > 2023-03-14 13:24:54.173  INFO 1766376 --- [   main]
> > > > org.apache.camel.main.MainSupport   : Using Java 11.0.8 with PID
> > > > 1766376. Started by mifadmin in /home/mifadmin
> > > > 2023-03-14 13:24:54.194  INFO 1766376 --- [   main]
> > > > mel.cli.connector.LocalCliConnector : Camel CLI enabled (local)
> > > > 2023-03-14 13:24:55.399  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
> > > > starting
> > > > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Routes startup (started:1)
> > > > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Started route1
> > > > (timer://yaml)
> > > > 2023-03-14 13:24:55.599  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
> > > > started in 636ms (build:245ms init:192ms start:199ms JVM-uptime:2s)
> > > > 2023-03-14 13:24:56.579  INFO 1766376 --- [ - timer://yaml]
> > > > first.yaml:11   : Hello Camel from yaml
> > > > 2023-03-14 13:24:57.567  INFO 1766376 --- [ - timer://yaml]
> > > > first.yaml:11   : Hello Camel from yaml
> > > > 2023-03-14 13:24:58.567  INFO 1766376 --- [ - timer://yaml]
> > > > first.yaml:11   : Hello Camel from yaml
> > > > 2023-03-14 13:24:59.568  INFO 1766376 --- [ - timer://yaml]
> > > > first.yaml:11   : Hello Camel from yaml
> > > > ^C2023-03-14 13:24:59.661  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first) is
> > > > shutting down (timeout:10s)
> > > > 2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Routes stopped (stopped:1)
> > > > 2023-03-14 13:24:59.669  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Stopped route1
> > > > (timer://yaml)
> > > > 2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
> > > > el.impl.engine.AbstractCamelContext : Apache Camel 3.20.2 (first)
> > > > shutdown in 12ms (uptime:4s JVM-uptime:7s)
> > > > 2023-03-14 13:24:59.673  INFO 1766376 --- [   main]
> > > > org.apache.camel.main.MainSupport   : Apache Camel (JBang) 3.20.2
> > > > shutdown
> > > >
> > > > $ camel run *  --camel-version=3.20.1
> > > > No Camel integration files to run
> > > >
> > > >
> > > > Should this be a JIRA? attached is highlighted documentation page.
> > > >
> > > >
> > > >
> > > > ચિરાગ/चिराग/Chirag
> > > > --
> > > > Sent from My Gmail Account
> > > >
> >


Building camel

2023-03-22 Thread Chirag
Team

I am trying to build camel snapshot.

I see two guides:
https://camel.apache.org/manual/building.html  and
https://camel.apache.org/docs/building/
(both are slightly different). there may be a need to merge into one document ?


I do see a lot of warnings.
[INFO]
[INFO] --- flatten:1.2.5:flatten (default-cli) @ camel-file ---
[WARNING] Parameter 'localRepository' is deprecated core expression;
Avoid use of ArtifactRepository type. If you need access to local
repository, switch to '${repositorySystemSession}' expression and get
LRM from it instead.
[INFO] Generating flattened POM of project
org.apache.camel:camel-file:jar:3.20.3-SNAPSHOT...

This appears to be from Mojo annotations.


lastly build seem to take a while even with 'mvn clean install
-Pfastinstall'  ? any suggestions for speeding up the build ? I have
used -T to allocate more threads; but I see it only getting upto 5
(using 10-15% CPU).

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Building camel

2023-03-22 Thread Chirag
Thanks. Will try mavend.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Mar 22, 2023 at 1:01 PM Nicolas Filotto  wrote:
>
> Hi Chirag,
>
> I personally use Maven Daemon https://github.com/apache/maven-mvnd and use 
> the command "mvnd clean install -Pfastinstall -q" to build as fast as 
> possible but since it is a big project with a lot of dependencies to 
> download, it will still take tens of minutes.
>
> I hope it helps,
> Regards,
> Nicolas
> [https://opengraph.githubassets.com/db6d85bf829078f49582ac1f0611f74fbc94c5ab0e69c11a442e9e403e507e6e/apache/maven-mvnd]<https://github.com/apache/maven-mvnd>
> GitHub - apache/maven-mvnd: Apache Maven 
> Daemon<https://github.com/apache/maven-mvnd>
> Apache Maven Daemon. Contribute to apache/maven-mvnd development by creating 
> an account on GitHub.
> github.com
> 
>
> 
> From: Chirag 
> Sent: Wednesday, March 22, 2023 17:26
> To: users@camel.apache.org 
> Subject: Building camel
>
> Team
>
> I am trying to build camel snapshot.
>
> I see two guides:
> https://urldefense.com/v3/__https://camel.apache.org/manual/building.html__;!!CiXD_PY!U3PNuJ19nPaOLvqcoSOo7GBYWeVYoG-ZQxOFkLSbBGOp1o_R-nsfy39VCOSOsq-BclSxPgrWDrm-R1WnRJO_KmeE3A$
>and
> https://urldefense.com/v3/__https://camel.apache.org/docs/building/__;!!CiXD_PY!U3PNuJ19nPaOLvqcoSOo7GBYWeVYoG-ZQxOFkLSbBGOp1o_R-nsfy39VCOSOsq-BclSxPgrWDrm-R1WnRJPwnKbf0A$
> (both are slightly different). there may be a need to merge into one document 
> ?
>
>
> I do see a lot of warnings.
> [INFO]
> [INFO] --- flatten:1.2.5:flatten (default-cli) @ camel-file ---
> [WARNING] Parameter 'localRepository' is deprecated core expression;
> Avoid use of ArtifactRepository type. If you need access to local
> repository, switch to '${repositorySystemSession}' expression and get
> LRM from it instead.
> [INFO] Generating flattened POM of project
> org.apache.camel:camel-file:jar:3.20.3-SNAPSHOT...
>
> This appears to be from Mojo annotations.
>
>
> lastly build seem to take a while even with 'mvn clean install
> -Pfastinstall'  ? any suggestions for speeding up the build ? I have
> used -T to allocate more threads; but I see it only getting upto 5
> (using 10-15% CPU).
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
> As a recipient of an email from the Talend Group, your personal data will be 
> processed by our systems. Please see our Privacy Notice 
> <https://www.talend.com/privacy-policy/> for more information about our 
> collection and use of your personal information, our security practices, and 
> your data protection rights, including any rights you may have to object to 
> automated-decision making or profiling we use to analyze support or marketing 
> related communications. To manage or discontinue promotional communications, 
> use the communication preferences 
> portal<https://info.talend.com/emailpreferencesen.html>. To exercise your 
> data protection rights, use the privacy request 
> form<https://talend.my.onetrust.com/webform/ef906c5a-de41-4ea0-ba73-96c079cdd15a/b191c71d-f3cb-4a42-9815-0c3ca021704cl>.
>  Contact us here <https://www.talend.com/contact/> or by mail to either of 
> our co-headquarters: Talend, Inc.: 400 South El Camino Real, Ste 1400, San 
> Mateo, CA 94402; Talend SAS: 5/7 rue Salomon De Rothschild, 92150 Suresnes, 
> France


Re: How can I add Routes use Spring DSL when use SpringBoot?

2023-04-07 Thread Chirag
.nio
: XNIO NIO Implementation Version
3.8.7.Final
2023-04-07 15:53:33.982  INFO 25496 --- [   main]
org.jboss.threads: JBoss Threads version
3.1.0.Final
2023-04-07 15:53:34.027  INFO 25496 --- [   main]
o.s.b.w.e.undertow.UndertowWebServer : Undertow started on port(s)
8080 (http)
2023-04-07 15:53:34.191  INFO 25496 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Routes startup (total:1
started:1)
2023-04-07 15:53:34.192  INFO 25496 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Started hello
(timer://hello)
2023-04-07 15:53:34.195  INFO 25496 --- [   main]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.14.7
(SampleCamel) started in 162ms (build:16ms init:133ms start:13ms)
2023-04-07 15:53:34.214  INFO 25496 --- [   main]
sample.camel.SampleCamelApplication  : Started
SampleCamelApplication in 2.791 seconds (JVM running for 3.121)
Hello World
Hello World
2023-04-07 15:53:37.824  INFO 25496 --- [ionShutdownHook]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.14.7
(SampleCamel) shutting down (timeout:45s)
2023-04-07 15:53:37.838  INFO 25496 --- [ionShutdownHook]
o.a.c.impl.engine.AbstractCamelContext   : Routes stopped (total:1
stopped:1)
2023-04-07 15:53:37.839  INFO 25496 --- [ionShutdownHook]
o.a.c.impl.engine.AbstractCamelContext   : Stopped hello
(timer://hello)
2023-04-07 15:53:37.844  INFO 25496 --- [ionShutdownHook]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.14.7
(SampleCamel) shutdown in 20ms (uptime:3s662ms)
2023-04-07 15:53:37.848  INFO 25496 --- [ionShutdownHook] io.undertow
: stopping server: Undertow - 2.2.20.Final
[INFO] 
[INFO] BUILD SUCCESS
[INFO] ----
[INFO] Total time:  9.072 s
[INFO] Finished at: 2023-04-07T15:53:37-04:00
[INFO] 
Terminate batch job (Y/N)?



ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Fri, Apr 7, 2023 at 3:38 AM mongoosej  wrote:
>
> Dear Claudio Miranda:
>
>
>   I see the examples using spring boot 
> at https://github.com/apache/camel-spring-boot-examples/tree/main/xml-import,
>  and I run this example under JDK1.8 and Camel 3.14.7,
> but the SpringBoot still report 'circular reference':
>
>
> org.springframework.beans.factory.BeanCurrentlyInCreationException: Error 
> creating bean with name 'SampleCamel': Requested bean is currently in 
> creation: Is there an unresolvable circular reference?
> at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:355)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:227)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1160)
>  ~[spring-context-5.3.15.jar:5.3.15]
> at 
> org.apache.camel.spring.xml.CamelBeanPostProcessor$1.getOrLookupCamelContext(CamelBeanPostProcessor.java:79)
>  ~[camel-spring-xml-3.14.7.jar:3.14.7]
> at 
> org.apache.camel.impl.engine.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:113)
>  ~[camel-base-engine-3.14.7.jar:3.14.7]
> at 
> org.apache.camel.spring.xml.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:172)
>  ~[camel-spring-xml-3.14.7.jar:3.14.7]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
>  ~[spring-beans-5.3.15.jar:5.3.15]
> at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean

Re: IntelliJ IDEA settings (format, copyright, etc)

2023-04-08 Thread Chirag
This may help?

https://www.jetbrains.com/help/idea/copyright.html



ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Sat, Apr 8, 2023 at 8:32 AM Steve973  wrote:
>
> Hello.  I'm setting up my development environment again, and I cannot
> remember how I set up formatting and the copyright notices before.  I
> currently have something close, but it doesn't match the rest of the
> source.  Where are the instructions to set up IDEs, please?
>
> Thanks,
> Steve


Re: How can I add Routes use Spring DSL when use SpringBoot?

2023-04-08 Thread Chirag
can you create a project and share via github to reproduce?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Sat, Apr 8, 2023 at 4:23 AM mongoosej  wrote:
>
> Run with Camel 3.20.0, SpringBoot 2.7.6, JDK 11 still report 'circular 
> reference'.
>
>
> This is my import camel 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"; 
> id="mq-test">
>   uri="activemqq:topic:WCS.BroadcastQueue"> class="org.apache.camel.component.activemq.ActiveMQComponent">
>   class="org.apache.activemq.ActiveMQConnectionFactory">
>  value="tcp://123.123.123.123:61616" />
>
>
>
> This is my main class:
> @ImportResource(locations = {"classpath:camel.xml"})
> @SpringBootApplication
> public class InterfaceApplication {
>
> public static void main(String[] args) {
> SpringApplication app = new 
> SpringApplication(InterfaceApplication.class);
> app.setBannerMode(Mode.OFF);
> app.setWebApplicationType(WebApplicationType.NONE);
> app.run(args);
> }
>
> }
>
>
>
> -- 原始邮件 --
> 发件人:  
>   "users" 
>
>  发送时间: 2023年4月8日(星期六) 凌晨3:54
> 收件人: "users"
> 主题: Re: How can I add Routes use Spring DSL when use SpringBoot?
>
>
>
> Ran with 3.20.x
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO] --< 
> org.apache.camel.springboot.example:camel-example-spring-boot-xml-import
> >--
> [INFO] Building Camel SB Examples :: XML Import 3.20.0
> [INFO] [ jar 
> ]-
> [INFO]
> [INFO] >>> spring-boot-maven-plugin:2.7.6:run (default-cli) >
> test-compile @ camel-example-spring-boot-xml-import >>>
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-version)
> @ camel-example-spring-boot-xml-import ---
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-java-version)
> @ camel-example-spring-boot-xml-import ---
> [INFO]
> [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources)
> @ camel-example-spring-boot-xml-import ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Using 'UTF-8' encoding to copy filtered properties files.
> [INFO] Copying 2 resources
> [INFO]
> [INFO] --- camel-package-maven-plugin:3.20.0:prepare-example (default)
> @ camel-example-spring-boot-xml-import ---
> [INFO]
> [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @
> camel-example-spring-boot-xml-import ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] --- maven-resources-plugin:3.2.0:testResources
> (default-testResources) @ camel-example-spring-boot-xml-import
> ---[INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Using 'UTF-8' encoding to copy filtered properties files.
> [INFO] skip non existing resourceDirectory
> C:\projects\camel-spring-boot-examples\xml-import\src\test\resources
> [INFO]
> [INFO] --- maven-compiler-plugin:3.10.1:testCompile
> (default-testCompile) @ camel-example-spring-boot-xml-import ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] <<< spring-boot-maven-plugin:2.7.6:run (default-cli) <
> test-compile @ camel-example-spring-boot-xml-import <<<
> [INFO]
> [INFO]
> [INFO] --- spring-boot-maven-plugin:2.7.6:run (default-cli) @
> camel-example-spring-boot-xml-import ---
> [INFO] Attaching agents: []
>
>   .   
>   
> _    __ _ _
>  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
> ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
>  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
>   '  || .__|_| |_|_| |_\__, | / / / /
>  =|_|==

Camel-Jbang export errors for camel version older then 3.14

2023-04-11 Thread Chirag
C:\work\jb3>camel export --runtime=spring-boot
--directory=c:\work\jb3\myapp --gav=com.foo:acme:1.0-SNAPSHOT
--camel-spring-boot-version=3.14.0 --fresh
Generating fresh run data
Exporting as Spring Boot project to: c:\work\jb3\myapp
java.lang.NullPointerException: Cannot invoke
"org.apache.camel.tooling.model.ArtifactModel.getGroupId()" because
"am" is null
at 
org.apache.camel.catalog.DefaultCamelCatalog.matchArtifact(DefaultCamelCatalog.java:536)
at 
org.apache.camel.catalog.DefaultCamelCatalog.modelFromMavenGAV(DefaultCamelCatalog.java:495)
at 
org.apache.camel.dsl.jbang.core.commands.ExportSpringBoot.createMavenPom(ExportSpringBoot.java:231)
at 
org.apache.camel.dsl.jbang.core.commands.ExportSpringBoot.export(ExportSpringBoot.java:113)
at 
org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:114)
at 
org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:77)
at 
org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:172)
at 
org.apache.camel.dsl.jbang.core.commands.Export.doCall(Export.java:28)
at 
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:70)
at 
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:35)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at 
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at 
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:154)
at main.CamelJBang.main(CamelJBang.java:36)

Regards,

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: Camel-Jbang export errors for camel version older then 3.14

2023-04-11 Thread Chirag
C:\work\jb3>camel version
Camel JBang version: 3.20.3

C:\work\jb3>jbang version
0.103.1


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Tue, Apr 11, 2023 at 1:39 PM Claus Ibsen  wrote:
>
> Hi
>
> What Camel JBang version do you have?
>
> Old releases such as 3.14.x is not expected to work. The export and
> camel-jbang is starting to work better in 3.18 and 3.20 is where it works
> the best currently.
>
>
>
> On Tue, Apr 11, 2023 at 5:28 PM Chirag  wrote:
>
> > C:\work\jb3>camel export --runtime=spring-boot
> > --directory=c:\work\jb3\myapp --gav=com.foo:acme:1.0-SNAPSHOT
> > --camel-spring-boot-version=3.14.0 --fresh
> > Generating fresh run data
> > Exporting as Spring Boot project to: c:\work\jb3\myapp
> > java.lang.NullPointerException: Cannot invoke
> > "org.apache.camel.tooling.model.ArtifactModel.getGroupId()" because
> > "am" is null
> > at
> > org.apache.camel.catalog.DefaultCamelCatalog.matchArtifact(DefaultCamelCatalog.java:536)
> > at
> > org.apache.camel.catalog.DefaultCamelCatalog.modelFromMavenGAV(DefaultCamelCatalog.java:495)
> > at
> > org.apache.camel.dsl.jbang.core.commands.ExportSpringBoot.createMavenPom(ExportSpringBoot.java:231)
> > at
> > org.apache.camel.dsl.jbang.core.commands.ExportSpringBoot.export(ExportSpringBoot.java:113)
> > at
> > org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:114)
> > at
> > org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:77)
> > at
> > org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:172)
> > at
> > org.apache.camel.dsl.jbang.core.commands.Export.doCall(Export.java:28)
> > at
> > org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:70)
> > at
> > org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:35)
> > at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> > at picocli.CommandLine.access$1500(CommandLine.java:148)
> > at
> > picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> > at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> > at
> > picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> > at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> > at picocli.CommandLine.execute(CommandLine.java:2170)
> > at
> > org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:154)
> > at main.CamelJBang.main(CamelJBang.java:36)
> >
> > Regards,
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: How can I add Routes use Spring DSL when use SpringBoot?

2023-04-11 Thread Chirag
while i am not an expert, it seems to not like route.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Apr 10, 2023 at 3:31 AM mongoosej  wrote:
>
> Dear Chirag:
> Can you help me point out the problem about the "circular reference" issue?
> This is the github address: https://github.com/mongoosejar/camel-xml-test
>
>
> Look forward your reply
> MongooseJ
>
>
>
>
> -- 原始邮件 --
> 发件人:  
>   "users" 
>
>  发送时间: 2023年4月9日(星期天) 凌晨0:43
> 收件人: "users"
> 主题: Re: How can I add Routes use Spring DSL when use SpringBoot?
>
>
>
> can you create a project and share via github to reproduce?
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
> On Sat, Apr 8, 2023 at 4:23 AM mongoosej  >
> > Run with Camel 3.20.0, SpringBoot 2.7.6, JDK 11 still report 'circular 
> reference'.
> >
> >
> > This is my import camel xml:
> > http://www.springframework.org/schema/beans"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >     xsi:schemaLocation="
> > &nbsp; &nbsp; http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans.xsd
> > &nbsp; &nbsp; http://camel.apache.org/schema/spring 
> http://camel.apache.org/schema/spring/camel-spring.xsd
> > &nbsp; &nbsp; "&gt;
> >      xmlns="http://camel.apache.org/schema/spring"; id="mq-test"&gt;
> >  
>     >  
>     >  
>     >  
>     >      >      class="org.apache.camel.component.activemq.ActiveMQComponent"&gt;
> >  
>     >  
>     >  
>     /&gt;
> >  
>     >  
>     >      >  >
> >
> >
> > This is my main class:
> > @ImportResource(locations = {"classpath:camel.xml"})
> > @SpringBootApplication
> > public class InterfaceApplication {
> >
> >     public static void 
> main(String[] args) {
> >  
>    SpringApplication app = new 
> SpringApplication(InterfaceApplication.class);
> >  
>    app.setBannerMode(Mode.OFF);
> >  
>    app.setWebApplicationType(WebApplicationType.NONE);
> >  
>    app.run(args);
> >     }
> >
> > }
> >
> >
> >
> > --&nbsp;原始邮件&nbsp;--
> > 
> 发件人: 
>    
> "users" 
>     > 发送时间:&nbsp;2023年4月8日(星期六) 凌晨3:54
> > 收件人:&nbsp;"users" >
> > 主题:&nbsp;Re: How can I add Routes use Spring DSL when use SpringBoot?
> >
> >
> >
> > Ran with 3.20.x
> >
> > [INFO] Scanning for projects...
> > [INFO]
> > [INFO] --< 
> org.apache.camel.springboot.example:camel-example-spring-boot-xml-import
> > &gt;--
> > [INFO] Building Camel SB Examples :: XML Import 3.20.0
> > [INFO] [ jar 
> ]-
> > [INFO]
> > [INFO] &gt;&gt;&gt; spring-boot-maven-plugin:2.7.6:run 
> (default-cli) &gt;
> > test-compile @ camel-example-spring-boot-xml-import 
> &gt;&gt;&gt;
> > [INFO]
> > [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven-version)
> > @ camel-example-spring-boot-xml-import ---
> > [INFO]
> > [INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-java-version)
> > @ camel-example-spring-boot-xml-import ---
> > [INFO]
> > [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources)
> > @ camel-example-spring-boot-xml-import ---
> > [INFO] Using 'UTF-8' encoding to copy filtered resources.
> > [INFO] Using 'UTF-8' encoding to copy filtered properties files.
> > [INFO] Copying 2 resources
> > [INFO]
> > [INFO] --- camel-package-maven-plugin:3.20.0:prepare-example (default)
> > @ camel-example-spring-boot-xml-import ---
> > [INFO]
> > [INFO] --- maven-com

Re: How can I add Routes use Spring DSL when use SpringBoot?

2023-04-14 Thread Chirag
@mongoosej

I tried to reproduce and i can confirm that it works in 3.20.3 but
doesn't not work in 3.14.7; the issue seem to be with ActiveMQ Camel
Spring boot component.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Tue, Apr 11, 2023 at 6:37 PM Chirag  wrote:
>
> while i am not an expert, it seems to not like route.
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
> On Mon, Apr 10, 2023 at 3:31 AM mongoosej  wrote:
> >
> > Dear Chirag:
> > Can you help me point out the problem about the "circular reference" issue?
> > This is the github address: https://github.com/mongoosejar/camel-xml-test
> >
> >
> > Look forward your reply
> > MongooseJ
> >
> >
> >
> >
> > -- 原始邮件 --
> > 发件人:
> > "users" 
> >
> >  > 发送时间: 2023年4月9日(星期天) 凌晨0:43
> > 收件人: "users" >
> > 主题: Re: How can I add Routes use Spring DSL when use SpringBoot?
> >
> >
> >
> > can you create a project and share via github to reproduce?
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Sat, Apr 8, 2023 at 4:23 AM mongoosej  > >
> > > Run with Camel 3.20.0, SpringBoot 2.7.6, JDK 11 still report 'circular 
> > reference'.
> > >
> > >
> > > This is my import camel xml:
> > > http://www.springframework.org/schema/beans"; 
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >     xsi:schemaLocation="
> > > &nbsp; &nbsp; http://www.springframework.org/schema/beans 
> > http://www.springframework.org/schema/beans/spring-beans.xsd
> > > &nbsp; &nbsp; http://camel.apache.org/schema/spring 
> > http://camel.apache.org/schema/spring/camel-spring.xsd
> > > &nbsp; &nbsp; "&gt;
> > >      > xmlns="http://camel.apache.org/schema/spring"; id="mq-test"&gt;
> > >  
> >     > >  
> >     > >  
> >     > >  
> >     > >      > >      > class="org.apache.camel.component.activemq.ActiveMQComponent"&gt;
> > >  
> >     > >  
> >     > >  
> >     > /&gt;
> > >  
> >     > >  
> >     > >      > >  > >
> > >
> > >
> > > This is my main class:
> > > @ImportResource(locations = {"classpath:camel.xml"})
> > > @SpringBootApplication
> > > public class InterfaceApplication {
> > >
> > >     public static void 
> > main(String[] args) {
> > >  
> >    SpringApplication app = new 
> > SpringApplication(InterfaceApplication.class);
> > >  
> >    app.setBannerMode(Mode.OFF);
> > >  
> >    app.setWebApplicationType(WebApplicationType.NONE);
> > >  
> >    app.run(args);
> > >     }
> > >
> > > }
> > >
> > >
> > >
> > > --&nbsp;原始邮件&nbsp;--
> > > 
> > 发件人: 
> >    
> > "users" 
> >     > > 发送时间:&nbsp;2023年4月8日(星期六) 凌晨3:54
> > > 收件人:&nbsp;"users" > >
> > > 主题:&nbsp;Re: How can I add Routes use Spring DSL when use 
> > SpringBoot?
> > >
> > >
> > >
> > > Ran with 3.20.x
> > >
> > > [INFO] Scanning for projects...
> > > [INFO]
> > > [INFO] --< 
> > org.apache.camel.springboot.example:camel-example-spring-boot-xml-import
> > > &gt;--
> > > [INFO] Building Camel SB Examples :: XML Import 3.20.0
> > > [INFO] [ jar 
> > ]-
> > > [INFO]
> > > [INFO] &gt;&gt;&gt; spring-boot-maven-plugin:2.7.6

Re: Camel in Action: Microsoft Azure Files over public Internet

2023-04-17 Thread Chirag
Shouldn't you be lookin at
https://camel.apache.org/components/3.20.x/azure-storage-blob-component.html?

Or a variation of it? The APIs are similar.


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Apr 17, 2023 at 11:18 AM Petr Kuzel
 wrote:
>
> I have a new RFE which includes integrating
> Microsoft Azure Files over public Internet.
>
> Initial findings and constraints:
>
>   - Azure Files do not implement the FTP standard.
>   - Azure Files could expose SMB protocol but SMB over
> public Internet is blacklisted by the security policy.
>   - Azure Files could expose NFS but its pricing is prohibitive.
>   - Azure Files have REST API <https://github.com/Azure/azure-rest-api-specs>
> and Java SDK <https://github.com/azure/azure-sdk-for-java>.
>   - My team is used to Camel 3.x components.
>
> Given that I see the two options:
>
>   A: use Camel REST component.
>   B: use Azure Files remote file component.
>
> Neither seems easy. For the Camel REST component,
> I'd need to implement a polling consumer via REST and
> match the FTPS component-like capabilities. For Azure Files,
> I have not found a developed Camel remote file component
> so its development would be required, i.e. likely a continuation
> at the Camel dev list...
>
> First, have I overlooked any recommendable option that
> could address the problem, please?
>
> Second, if left only with above two options, which approach
> would look more promising from a Camel veteran perspective
> and why, please?
>
>   Best regards
>   Cc.
>
> --
>   Mr. Petr Kužel, Software Engineer
>   Eurofins International Support Services s.à r.l.
>   Val Fleuri 23
>   L-1526 LUXEMBOURG
>


Re: Book on camel 3.20.x

2023-05-10 Thread Chirag
Hello Rishi,

While I agree with you on documentation,  this being OSS, it would
make sense for users to contribute to documentation. I do see a lot of
users doing blog or medium articles; in addition, updating or adding
to documentation can help other fellow users.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, May 10, 2023 at 3:33 PM rishi sharma  wrote:
>
> Hi Team,
> Is there any book for Apache camel 3.20.x just like camel in action 2.
>
> Reference documentation does not cover details and a lot of time is getting
> invested in figuring out solutions.
>
> Thanks
> Rishi


Re: Camel Main: RoutesIncludePattern doesn't seem to respect asterisks as a directory placeholder

2023-05-17 Thread Chirag
in a camel app, I have used property files to provide some of these
params in place of passing them thru the code. You may want to explore
that.


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, May 17, 2023 at 4:59 PM Fyodor Kravchenko  wrote:
>
> Hi,
>
> I'm integrating Camel into my application, or better say, application
> platform, that may run different arbitrary Camel routes for integration,
> and I'd like to provide an ability for a developer who makes
> applications for this platform to edit the routes during the
> development. I'm already monitoring the filesystem for other artifact
> edits, so If there is an API to reload an individual route taken from a
> file I might use that.
>
> I've considered to use a separate Camel standalone or as a containerized
> service that I've noticed the project is encouraging now, but this would
> require me to develop some protocol to interact with my platform during
> its lifecycle. For Camel 2 I managed to instantiate xml snippets to
> custom Processors but the API has changed and this Main load-reload
> function seemed to do what I want for Camel 3.
>
> On 17.05.2023 22:58, Claus Ibsen wrote:
> > Hi
> >
> > What is your goal with this?
> >
> > The reload stuff is for development and not a production app server to
> > "redeploy apps" or any sort of that.
> > The intention is that you work on a single application.
> >
> > The reload is using Java APIs for "change file events" and this does not
> > support an ANT style way and whatnot.
> >
> >
> > On Wed, May 17, 2023 at 8:45 PM Fyodor Kravchenko 
> > wrote:
> >
> >> I'm sorry please disregard my previous ramblings, moving the "deploy"
> >> directory to the working directory of the java app did the "include"
> >> trick. It worked without the "file:" prefix because it was looking into
> >> the "target" directry which was the classpath.. My fault.
> >>
> >> However, the additional question remains: how do I make it _reload_ what
> >> it loaded previosly, without catching the extra *.yaml files that may be
> >> located in the wrong directories?
> >>
> >> I'm trying this,
> >>
> >>   Main main = new Main();
> >>
> >> main.configure().withRoutesIncludePattern("file:deploy/**/PRIVATE/EXCHANGE/*.yaml");
> >>   main.configure().withRoutesReloadEnabled(true);
> >>   main.configure().withRoutesReloadDirectory("deploy");
> >>   main.configure().withRoutesReloadDirectoryRecursive(true);
> >> // main.configure().withRoutesReloadPattern("**/PRIVATE/EXCHANGE/*.yaml");
> >> // main.configure().withRoutesReloadPattern("PRIVATE/EXCHANGE/*.yaml");
> >>   main.configure().withRoutesReloadPattern("*.yaml");
> >>   main.configure().withRoutesReloadRemoveAllRoutes(true);
> >>   main.run();
> >>
> >> but this will catch and load any .yaml file under the "deploy"
> >> directory, event those that wasn't loaded at startup, when I touch any
> >> of the yamls.
> >>
> >> Any tips on reloading patterns?
> >>
> >> Thank you!
> >>
> >> On 17.05.2023 21:06, Fyodor Kravchenko wrote:
> >>> Hi, thanks but this
> >>>
> >>> .
> >>> Netbeans uses the following command to run the program:
> >>>
> >>> cd /home/fedd/NetBeansProjects/camelmaintry;
> >>> JAVA_HOME=/home/fedd/Programs/graalvm-ce-java19-22.3.0
> >>> /snap/netbeans/76/netbeans/java/maven/bin/mvn -Dexec.vmArgs=
> >>> "-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass}
> >>> ${exec.appArgs}" -Dexec.appArgs=
> >>> -Dexec.mainClass=camelmaintry.CamelMainTry
> >>> -Dexec.executable=/home/fedd/Programs/graalvm-ce-java19-22.3.0/bin/java
> >>> org.codehaus.mojo:exec-maven-plugin:3.1.0:exec
> >>>
> >>> (nothing special in the "exec.mainClass" and other placeholders there)
> >>>
> >>> I can't grasp how to make it look into this pattern:
> >>>
> >>> deploy/**/PRIVATE/EXCHANGE/*.yaml
> >>>
> >>> Thanks!
> >>> --fedd
> >>>
> >>> On 17.05.2023 20:15, Claus Ibsen wrote:
> >>>> Hi
> >>>>
> >>>> Okay for file system, you shoul

anyone using Camel with YAML / XML DSL and IBM MQ ?

2023-05-23 Thread Chirag
My thought is that this would require me to use JMS (to avoid using
any other proprietary connector).

Want to look for a practical example (or build one in the process).

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: HttpMessage.getBody(Map.class) stopped working when migrated from Camel 2 to 3.20.4

2023-06-13 Thread Chirag
Hi Fyodor,
I ran it in IntelliJ thru 3.20.4

after submitting page - i got

json: null, and string:login=usrename&password=password


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Mon, Jun 12, 2023 at 7:35 AM Fyodor Kravchenko  wrote:
>
> Hello people,
>
> any ideas how to fix the issue below?
>
> -- fedd
>
> On 09.06.2023 18:15, Fyodor Kravchenko wrote:
> > Hello,
> >
> > I've used to rely on this function in older Camel, when I was able to
> > deserialize a regular web form POST stream into a generic
> > java.util.Map, I mean, this used to parse the form data (not
> > multipart, just regular) and convert into a Map:
> >
> > Map map = http.getBody(Map.class);
> >
> > This is my test code snippet that I compile and run on Java 19 of
> > GraalVM:
> >
> > ```
> >
> > HttpMessage http =
> > exchange.getIn(HttpMessage.class);
> > HttpServletRequest request = http.getRequest();
> > String method = request.getMethod();
> > if ("POST".equals(method) ||
> > "PUT".equals(method)) {
> > Map map = http.getBody(Map.class);
> > String string = http.getBody(String.class);
> > http.setHeader(Exchange.CONTENT_TYPE,
> > "text/plain");
> > http.setBody("json: " +
> > mapper.writeValueAsString(map) + ", and string:" + string);
> > } else {
> > http.setHeader(Exchange.CONTENT_TYPE,
> > "text/html");
> > http.setBody(this.getClass().getResourceAsStream("form.html"));
> > }
> > ```
> >
> > I've created a test project to make sure it works on Camel 2.24 and
> > doesn't in 3.20.4:
> >
> > https://github.com/fedd/cameljettyformmap/tree/main/cameljettyformmap
> >
> > I had to add `javax.activation` for the 2.24 version to run, but
> > unfortunately that didn't fix the 3.20.4 (See the pom.xml in the
> > github link)
> >
> > What do I have to do to make it work in 3.20.4?
> >
> > $ java --version
> > openjdk 19.0.1 2022-10-18
> > OpenJDK Runtime Environment GraalVM CE 22.3.0 (build
> > 19.0.1+10-jvmci-22.3-b08)
> > OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build
> > 19.0.1+10-jvmci-22.3-b08, mixed mode, sharing)
> >


Re: HttpMessage.getBody(Map.class) stopped working when migrated from Camel 2 to 3.20.4

2023-06-14 Thread Chirag
if you introspect variables, the fields are not populated in
HttpServletRequest object. The variables are added to the Camel
Exchange Header. This may be something done within camel-jetty or one
of the underlying libraries.

the field are populated in the message header - but at that point,
they are intermingled with Camel Headers, HTTP Headers

Accept = 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding = gzip, deflate, br
Accept-Language = en-US,en;q=0.9
Cache-Control = max-age=0
CamelHttpMethod = POST
CamelHttpPath =
CamelHttpQuery = null
CamelHttpServletRequest = Request(POST //localhost:8080/)@37bc1f86
CamelHttpServletResponse = HTTP/1.1 200


CamelHttpUri = /
CamelHttpUrl = http://localhost:8080/
CamelServletContextPath = /
Connection = keep-alive
Content-Length = 20
Content-Type = application/x-www-form-urlencoded
Host = localhost:8080
login = aa
Origin = http://localhost:8080
password = bb
Referer = http://localhost:8080/
sec-ch-ua = "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114"
sec-ch-ua-mobile = ?0
sec-ch-ua-platform = "Windows"
Sec-Fetch-Dest = document
Sec-Fetch-Mode = navigate
Sec-Fetch-Site = same-origin
Sec-Fetch-User = ?1
Upgrade-Insecure-Requests = 1
User-Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Edg/114.0.1823.43
 End  of Message Headers



I couldn't see an easy method to convert
username=something&password=something (that can possibly be a
workaround). I would say go ahead and open a JIRA ; to see if this is
really a bug.
I did see a slightly different behaviour when I added
disableStreamCache=true; but that did not seem to change other parts.
I did try changing it to a multi-part form and then it showed up as
multiple parts attached - but that would mean changing your approach
completely.


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account
On Wed, Jun 14, 2023 at 3:14 AM Fyodor Kravchenko  wrote:
>
> Hi Chirag, yeah that exactly is the question - it shouldn't be that way.
>
> If we change Camel version in the pom.xml to Camel 2.24, it'll work as
> expected: the POST payload will be parsed into java.util.Map and the
> Json will be generated (instead of "null").
>
> So the question is -- how do i fix it for camel 3.20.4?
>
> On 13.06.2023 18:04, Chirag wrote:
> > Hi Fyodor,
> > I ran it in IntelliJ thru 3.20.4
> >
> > after submitting page - i got
> >
> > json: null, and string:login=usrename&password=password
> >
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Mon, Jun 12, 2023 at 7:35 AM Fyodor Kravchenko  
> > wrote:
> >> Hello people,
> >>
> >> any ideas how to fix the issue below?
> >>
> >> -- fedd
> >>
> >> On 09.06.2023 18:15, Fyodor Kravchenko wrote:
> >>> Hello,
> >>>
> >>> I've used to rely on this function in older Camel, when I was able to
> >>> deserialize a regular web form POST stream into a generic
> >>> java.util.Map, I mean, this used to parse the form data (not
> >>> multipart, just regular) and convert into a Map:
> >>>
> >>> Map map = http.getBody(Map.class);
> >>>
> >>> This is my test code snippet that I compile and run on Java 19 of
> >>> GraalVM:
> >>>
> >>> ```
> >>>
> >>>  HttpMessage http =
> >>> exchange.getIn(HttpMessage.class);
> >>>  HttpServletRequest request = http.getRequest();
> >>>  String method = request.getMethod();
> >>>  if ("POST".equals(method) ||
> >>> "PUT".equals(method)) {
> >>>  Map map = http.getBody(Map.class);
> >>>  String string = http.getBody(String.class);
> >>>  http.setHeader(Exchange.CONTENT_TYPE,
> >>> "text/plain");
> >>>  http.setBody("json: " +
> >>> mapper.writeValueAsString(map) + ", and string:" + string);
> >>>  } else {
> >>>  http.setHeader(Exchange.CONTENT_TYPE,
> >>> "text/html");
> >>> http.setBody(this.getClass().getResourceAsStream("form.html"));
> >>>  }
> >>> ```
> >>>
> >>> I've created a test project to make sure it works on Camel 2.24 and
> >>> doesn't in 3.20.4:
> >>>
> >>> https://github.com/fedd/cameljettyformmap/tree/main/cameljettyformmap
> >>>
> >>> I had to add `javax.activation` for the 2.24 version to run, but
> >>> unfortunately that didn't fix the 3.20.4 (See the pom.xml in the
> >>> github link)
> >>>
> >>> What do I have to do to make it work in 3.20.4?
> >>>
> >>> $ java --version
> >>> openjdk 19.0.1 2022-10-18
> >>> OpenJDK Runtime Environment GraalVM CE 22.3.0 (build
> >>> 19.0.1+10-jvmci-22.3-b08)
> >>> OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build
> >>> 19.0.1+10-jvmci-22.3-b08, mixed mode, sharing)
> >>>


Re: HttpMessage.getBody(Map.class) stopped working when migrated from Camel 2 to 3.20.4

2023-06-14 Thread Chirag
Can you try and run it with undertow? I see test similar to your
scenario in undertow.

https://github.com/apache/camel/tree/52443a298935b2842a402cb5fff7e37abb938f8b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Jun 14, 2023 at 4:37 PM Fyodor Kravchenko  wrote:
>
> The old-fashioned standard of the Servlet API required that the request
> parameters were available through the request.getParameter* methods,
> including the getParameterMap(), be that GET query parameters or the
> POST form data load.
>
> Camel collects anything looking like a Map into the Camel
> Message headers, mixing the HTTP request parameters, HTTP headers and
> something else. It apparently continues to do so, however, somehow
> clearing the HttpServletRequest.getParameter* results, but this isn't my
> problem. It works the same way in Camel 2 and Camel 3.20.4 which I'm
> trying to migrate to, and all inconsistencies are already worked around.
>
> My problem is that the Message.getBody(Map.class) behaviour has changed.
> Try change Camel 3 to 2 in the pom.xml of the test project and the same
> code will magically work as expected.
>
>
> On 14.06.2023 19:25, Chirag wrote:
> > if you introspect variables, the fields are not populated in
> > HttpServletRequest object. The variables are added to the Camel
> > Exchange Header. This may be something done within camel-jetty or one
> > of the underlying libraries.
> >
> > the field are populated in the message header - but at that point,
> > they are intermingled with Camel Headers, HTTP Headers
> >
> > Accept = 
> > text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
> > Accept-Encoding = gzip, deflate, br
> > Accept-Language = en-US,en;q=0.9
> > Cache-Control = max-age=0
> > CamelHttpMethod = POST
> > CamelHttpPath =
> > CamelHttpQuery = null
> > CamelHttpServletRequest = Request(POST //localhost:8080/)@37bc1f86
> > CamelHttpServletResponse = HTTP/1.1 200
> >
> >
> > CamelHttpUri = /
> > CamelHttpUrl = http://localhost:8080/
> > CamelServletContextPath = /
> > Connection = keep-alive
> > Content-Length = 20
> > Content-Type = application/x-www-form-urlencoded
> > Host = localhost:8080
> > login = aa
> > Origin = http://localhost:8080
> > password = bb
> > Referer = http://localhost:8080/
> > sec-ch-ua = "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft 
> > Edge";v="114"
> > sec-ch-ua-mobile = ?0
> > sec-ch-ua-platform = "Windows"
> > Sec-Fetch-Dest = document
> > Sec-Fetch-Mode = navigate
> > Sec-Fetch-Site = same-origin
> > Sec-Fetch-User = ?1
> > Upgrade-Insecure-Requests = 1
> > User-Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64)
> > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
> > Edg/114.0.1823.43
> >  End  of Message Headers
> >
> >
> >
> > I couldn't see an easy method to convert
> > username=something&password=something (that can possibly be a
> > workaround). I would say go ahead and open a JIRA ; to see if this is
> > really a bug.
> > I did see a slightly different behaviour when I added
> > disableStreamCache=true; but that did not seem to change other parts.
> > I did try changing it to a multi-part form and then it showed up as
> > multiple parts attached - but that would mean changing your approach
> > completely.
> >
> >
> > ચિરાગ/चिराग/Chirag
> > ------
> > Sent from My Gmail Account
> > On Wed, Jun 14, 2023 at 3:14 AM Fyodor Kravchenko  
> > wrote:
> >> Hi Chirag, yeah that exactly is the question - it shouldn't be that way.
> >>
> >> If we change Camel version in the pom.xml to Camel 2.24, it'll work as
> >> expected: the POST payload will be parsed into java.util.Map and the
> >> Json will be generated (instead of "null").
> >>
> >> So the question is -- how do i fix it for camel 3.20.4?
> >>
> >> On 13.06.2023 18:04, Chirag wrote:
> >>> Hi Fyodor,
> >>> I ran it in IntelliJ thru 3.20.4
> >>>
> >>> after submitting page - i got
> >>>
> >>> json: null, and string:login=usrename&password=password
> >>>
> >>>
> >>> ચિરાગ/चिराग/Chirag
> >>> 

Re: HttpMessage.getBody(Map.class) stopped working when migrated from Camel 2 to 3.20.4

2023-06-14 Thread Chirag
@fyodor,


if you are familiar with camel-jbang

Try this:
Here is updated form
https://gist.github.com/chiragsanghavi/02a00f49ac7ee9a978344af571746c02

Yaml DSL:
https://gist.github.com/chiragsanghavi/8a2aee132fc626ed25f97fc0a360ead4

Try form 1 (to see the issue) and try form 2 to see it work as expected.


undertow created body as Map
jetty created body as
org.apache.camel.converter.stream.InputStreamCache resulting into
error.
No serializer found for class org.apache.camel.converter.stream.InputStreamCache


ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Wed, Jun 14, 2023 at 5:32 PM Chirag  wrote:
>
> Can you try and run it with undertow? I see test similar to your
> scenario in undertow.
>
> https://github.com/apache/camel/tree/52443a298935b2842a402cb5fff7e37abb938f8b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
> On Wed, Jun 14, 2023 at 4:37 PM Fyodor Kravchenko  
> wrote:
> >
> > The old-fashioned standard of the Servlet API required that the request
> > parameters were available through the request.getParameter* methods,
> > including the getParameterMap(), be that GET query parameters or the
> > POST form data load.
> >
> > Camel collects anything looking like a Map into the Camel
> > Message headers, mixing the HTTP request parameters, HTTP headers and
> > something else. It apparently continues to do so, however, somehow
> > clearing the HttpServletRequest.getParameter* results, but this isn't my
> > problem. It works the same way in Camel 2 and Camel 3.20.4 which I'm
> > trying to migrate to, and all inconsistencies are already worked around.
> >
> > My problem is that the Message.getBody(Map.class) behaviour has changed.
> > Try change Camel 3 to 2 in the pom.xml of the test project and the same
> > code will magically work as expected.
> >
> >
> > On 14.06.2023 19:25, Chirag wrote:
> > > if you introspect variables, the fields are not populated in
> > > HttpServletRequest object. The variables are added to the Camel
> > > Exchange Header. This may be something done within camel-jetty or one
> > > of the underlying libraries.
> > >
> > > the field are populated in the message header - but at that point,
> > > they are intermingled with Camel Headers, HTTP Headers
> > >
> > > Accept = 
> > > text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
> > > Accept-Encoding = gzip, deflate, br
> > > Accept-Language = en-US,en;q=0.9
> > > Cache-Control = max-age=0
> > > CamelHttpMethod = POST
> > > CamelHttpPath =
> > > CamelHttpQuery = null
> > > CamelHttpServletRequest = Request(POST //localhost:8080/)@37bc1f86
> > > CamelHttpServletResponse = HTTP/1.1 200
> > >
> > >
> > > CamelHttpUri = /
> > > CamelHttpUrl = http://localhost:8080/
> > > CamelServletContextPath = /
> > > Connection = keep-alive
> > > Content-Length = 20
> > > Content-Type = application/x-www-form-urlencoded
> > > Host = localhost:8080
> > > login = aa
> > > Origin = http://localhost:8080
> > > password = bb
> > > Referer = http://localhost:8080/
> > > sec-ch-ua = "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft 
> > > Edge";v="114"
> > > sec-ch-ua-mobile = ?0
> > > sec-ch-ua-platform = "Windows"
> > > Sec-Fetch-Dest = document
> > > Sec-Fetch-Mode = navigate
> > > Sec-Fetch-Site = same-origin
> > > Sec-Fetch-User = ?1
> > > Upgrade-Insecure-Requests = 1
> > > User-Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64)
> > > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
> > > Edg/114.0.1823.43
> > >  End  of Message Headers
> > >
> > >
> > >
> > > I couldn't see an easy method to convert
> > > username=something&password=something (that can possibly be a
> > > workaround). I would say go ahead and open a JIRA ; to see if this is
> > > really a bug.
> > > I did see a slightly different behaviour when I added
> > > disableStreamCache=true; but that did not seem to change other parts.
> > > I did try changing it to a multi-part form and then it showed up as
> > > multiple parts attached - but that would mean changing your

Re: HttpMessage.getBody(Map.class) stopped working when migrated from Camel 2 to 3.20.4

2023-06-20 Thread Chirag
moved both under one gist
https://gist.github.com/chiragsanghavi/02a00f49ac7ee9a978344af571746c02

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account

On Thu, Jun 15, 2023 at 12:06 AM Chirag  wrote:
>
> @fyodor,
>
>
> if you are familiar with camel-jbang
>
> Try this:
> Here is updated form
> https://gist.github.com/chiragsanghavi/02a00f49ac7ee9a978344af571746c02
>
> Yaml DSL:
> https://gist.github.com/chiragsanghavi/8a2aee132fc626ed25f97fc0a360ead4
>
> Try form 1 (to see the issue) and try form 2 to see it work as expected.
>
>
> undertow created body as Map
> jetty created body as
> org.apache.camel.converter.stream.InputStreamCache resulting into
> error.
> No serializer found for class 
> org.apache.camel.converter.stream.InputStreamCache
>
>
> ચિરાગ/चिराग/Chirag
> ------
> Sent from My Gmail Account
>
> On Wed, Jun 14, 2023 at 5:32 PM Chirag  wrote:
> >
> > Can you try and run it with undertow? I see test similar to your
> > scenario in undertow.
> >
> > https://github.com/apache/camel/tree/52443a298935b2842a402cb5fff7e37abb938f8b/components/camel-undertow/src/test/java/org/apache/camel/component/undertow
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> > On Wed, Jun 14, 2023 at 4:37 PM Fyodor Kravchenko  
> > wrote:
> > >
> > > The old-fashioned standard of the Servlet API required that the request
> > > parameters were available through the request.getParameter* methods,
> > > including the getParameterMap(), be that GET query parameters or the
> > > POST form data load.
> > >
> > > Camel collects anything looking like a Map into the Camel
> > > Message headers, mixing the HTTP request parameters, HTTP headers and
> > > something else. It apparently continues to do so, however, somehow
> > > clearing the HttpServletRequest.getParameter* results, but this isn't my
> > > problem. It works the same way in Camel 2 and Camel 3.20.4 which I'm
> > > trying to migrate to, and all inconsistencies are already worked around.
> > >
> > > My problem is that the Message.getBody(Map.class) behaviour has changed.
> > > Try change Camel 3 to 2 in the pom.xml of the test project and the same
> > > code will magically work as expected.
> > >
> > >
> > > On 14.06.2023 19:25, Chirag wrote:
> > > > if you introspect variables, the fields are not populated in
> > > > HttpServletRequest object. The variables are added to the Camel
> > > > Exchange Header. This may be something done within camel-jetty or one
> > > > of the underlying libraries.
> > > >
> > > > the field are populated in the message header - but at that point,
> > > > they are intermingled with Camel Headers, HTTP Headers
> > > >
> > > > Accept = 
> > > > text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
> > > > Accept-Encoding = gzip, deflate, br
> > > > Accept-Language = en-US,en;q=0.9
> > > > Cache-Control = max-age=0
> > > > CamelHttpMethod = POST
> > > > CamelHttpPath =
> > > > CamelHttpQuery = null
> > > > CamelHttpServletRequest = Request(POST //localhost:8080/)@37bc1f86
> > > > CamelHttpServletResponse = HTTP/1.1 200
> > > >
> > > >
> > > > CamelHttpUri = /
> > > > CamelHttpUrl = http://localhost:8080/
> > > > CamelServletContextPath = /
> > > > Connection = keep-alive
> > > > Content-Length = 20
> > > > Content-Type = application/x-www-form-urlencoded
> > > > Host = localhost:8080
> > > > login = aa
> > > > Origin = http://localhost:8080
> > > > password = bb
> > > > Referer = http://localhost:8080/
> > > > sec-ch-ua = "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft 
> > > > Edge";v="114"
> > > > sec-ch-ua-mobile = ?0
> > > > sec-ch-ua-platform = "Windows"
> > > > Sec-Fetch-Dest = document
> > > > Sec-Fetch-Mode = navigate
> > > > Sec-Fetch-Site = same-origin
> > > > Sec-Fetch-User = ?1
> > > > Upgrade-Insecure-Requests = 1
> > > > User-Agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64)
> > > > AppleWebKit/537.36 (KHTML, like Gecko) Chrom

Re: Camel Kafka consumer dynamic topic

2023-10-06 Thread Chirag
Mark,

Scenario for service restart will cause any dynamic route from being removed.

It would require ReST to be idempotent and return or more complex -
persisting routes and reloading them.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Thu, Oct 5, 2023 at 12:44 AM Mark Nuttall  wrote:
>
> The link that I provided shows you how to dynamically create a new route.
> So all you need to do is after you've called the rest in point using the
> HTTP component you use what's returned to call a service method in some
> Class via the bean EIP. The issue is that if the service restarts you will
> lose anything dynamically created. The pieces are all there it's just a
> matter of you putting them all together
>
> On Wed, Oct 4, 2023, 9:38 PM girish vasmatkar  wrote:
>
> > It's different to what my requirements are. I think dynamic routing in case
> > of a Kafka consumer is different to the examples you have quoted.
> >
> > I can't have Kafka topic declared in property file or a yaml file for that
> > matter because I wouldn't be knowing. In that case it would be pretty easy
> > to just use property place holders and build the route
> >
> > I need to be able to get a random kafka topic at runtime and create a kafka
> > consumer from it.
> >
> > - Girish
> >
> > On Wed, Oct 4, 2023, 2:58 AM Mark Nuttall  wrote:
> >
> > > Pretty sure I've done this kind of thing before. I think the info is here
> > >
> > >
> > https://stackoverflow.com/questions/48380456/dynamic-routing-apache-camel
> > >
> > > On Tue, Oct 3, 2023, 3:22 AM Claus Ibsen  wrote:
> > >
> > > > Hi
> > > >
> > > > If you use Java RouteBuilder, then you can maybe use spring dependency
> > > > injection, to inject the topic name into a String field,
> > > > and then use that field when building the route model.
> > > >
> > > > However I have also thought of adding {{bean:xxx?method=aaa}} as a
> > > function
> > > > to property placeholder.
> > > > Though need to give it a bit more thought as this then have
> > > > dependency ordering implication (bean must be created beforehand etc).
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Mon, Oct 2, 2023 at 12:40 PM girish vasmatkar 
> > > > wrote:
> > > >
> > > > > Dear Members,
> > > > >
> > > > > I have been searching for this for quite some time but haven't been
> > > able
> > > > to
> > > > > figure out a way to do this.
> > > > >
> > > > > I need to subscribe to a kafka topic which I will know only at
> > runtime
> > > -
> > > > by
> > > > > calling a REST endpoint. The REST API I am calling is creating topics
> > > and
> > > > > returning the topic name.
> > > > >
> > > > > I am using spring camel starter and have camel route defined up
> > until I
> > > > am
> > > > > able to fetch the topic name.  How do I then have a route created at
> > > > > runtime that uses the topic name from the rest endpoint?
> > > > >
> > > > > --
> > > > > Best,
> > > > > Girish Vasmatkar
> > > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -
> > > > @davsclaus
> > > > Camel in Action 2: https://www.manning.com/ibsen2
> > > >
> > >
> >


using Camel with CloudKarafka

2024-02-29 Thread Chirag
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


Re: using Camel with CloudKarafka

2024-03-01 Thread Chirag
That is unfortunate.
CloudKarafka free tier allowed to get a kafka instance in about two minutes
on the web simplifying prototyping.



On Fri, Mar 1, 2024, 01:05 Claus Ibsen  wrote:

> 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: using Camel with CloudKarafka

2024-03-01 Thread Chirag
Hello Andrea,

Thanks for the callout.

I had this correctly set up in my route that writes to Kafka but i had
missed it on my read from Kafka flow as well as ended up having two lines
of Yaml merged into one due to manual editing.

Both work now.

Here is my updated 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
saslMechanism: SCRAM-SHA-256
clientId: kafkaconsumer1
autoOffsetReset: latest
consumersCount: '10'
groupId: kafkaconsumergroup1
  steps:
- log:
id: log-1987
message: ${body}
ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Fri, Mar 1, 2024 at 12:43 AM Andrea Cosentino  wrote:

> Hi,
>
> Have a look at how we implement the Kafka SCRAM source Kamelet.
>
>
> https://github.com/apache/camel-kamelets/blob/main/kamelets/kafka-scram-source.kamelet.yaml
>
> As far as I see, you need to set also saslMechanism and securityProtocol
>
> Cheers.
>
> Il giorno ven 1 mar 2024 alle ore 02:20 Chirag 
> ha scritto:
>
> > 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: n

Re: Svar: How to get headers within Variables returning?

2024-03-17 Thread Chirag
Hello Mikael,

In your scenario - are you creating a hashmap of header?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Thu, Mar 14, 2024 at 6:38 AM Mikael Andersson Wigander
 wrote:

>
> Hi
>
> Never mind, I found it out.
>
> simple(“${variable[header:token.Authorization]}”)
>
>
>
> /M
>
>
>
>
> Den 14 mars 2024 kl 11:30, Mikael Andersson Wigander <
> mikael.andersson.wigan...@pm.me.INVALID
> >
> skrev:
>
> 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
>
>


using unary operator

2024-03-17 Thread Chirag
I want to build a counter in a route,

Reading
https://camel.apache.org/components/4.4.x/languages/simple-language.html
[image: image.png]
It says that ++ can be used with a function.

Can someone help with an example?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: using unary operator

2024-03-17 Thread Chirag
Solved it myself:
expression: ${variables.counter1}++

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Sun, Mar 17, 2024 at 10:59 PM Chirag  wrote:

> I want to build a counter in a route,
>
> Reading
> https://camel.apache.org/components/4.4.x/languages/simple-language.html
> [image: image.png]
> It says that ++ can be used with a function.
>
> Can someone help with an example?
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>


Re: Camel Jbang 4.4.1 not available?

2024-03-24 Thread Chirag
A question:

is --camel-version supposed to allow a route to run with the older camel
version?

4.4.1 does work. Trying to identify if I should be able to run a previous
version.

I am on windows10
C:\work\jb>camel --version
4.4.1
C:\work\jb>jbang version
0.103.1


C:\work\jb>camel run  b.java --verbose --camel-version=4.0.1
[jbang] Resolving dependencies...
[jbang]org.apache.camel:camel-bom:4.4.1@pom
[jbang]org.apache.camel:camel-jbang-core:4.4.1
[jbang]org.apache.camel.kamelets:camel-kamelets:4.4.0
[jbang] Dependencies resolved
[jbang] Building jar...
java.io.IOException: Cannot run program "jbang": CreateProcess error=2, The
system cannot find the file specified
at
java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at
java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at
org.apache.camel.dsl.jbang.core.commands.Run.runCamelVersion(Run.java:958)
at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:784)
at org.apache.camel.dsl.jbang.core.commands.Run.doCall(Run.java:298)
at
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
at
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:159)
at
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:58)
at main.CamelJBang.main(CamelJBang.java:36)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot
find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:500)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
at
java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 17 more

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Fri, Mar 22, 2024 at 2:55 AM Mikael Koskinen  wrote:

> Thank you for the quick help! 4.4.1 now installed nicely.
>
> And thank you for the tip regarding how to install a specific app version
> using Jbang.
>
> Best regards,
> Mikael
>
> pe 22. maalisk. 2024 klo 7.30 Tadayoshi Sato (sato.tadayo...@gmail.com)
> kirjoitti:
>
> > Ah Claus already did it. Thanks Claus :-)
> >
> > On Fri, Mar 22, 2024 at 2:29 PM Tadayoshi Sato  >
> > wrote:
> >
> > > Hi,
> > >
> > > The Camel JBang command looks at this file in the default branch.
> > >
> > >
> >
> https://github.com/apache/camel/blob/main/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java#L22-L24
> > >
> > > As you see, it still points to 4.4.0. Someone will soon update it to
> > 4.4.1
> > > and you should be able to use it.
> > >
> > > By the way, the latest JBang version allows us to pass additional
> system
> > > properties at `jbang app install`, so you can as well now do this to
> > > install a specific version of Camel JBang command:
> > >
> > >   $ jbang app install -Dcamel.jbang.version=4.4.1 camel@apache/camel
> > >
> > > Hope it helps,
> > >
> > > On Fri, Mar 22, 2024 at 2:10 PM Mikael Koskinen 
> > > wrote:
> > >
> > >> 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
> >
>


Re: Camel Jbang 4.4.1 not available?

2024-03-24 Thread Chirag
To add:
jbang --fresh -Dcamel.jbang.version=4.4.0 camel@apache/camel run b.java
works.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Sun, Mar 24, 2024 at 9:51 PM Chirag  wrote:

> A question:
>
> is --camel-version supposed to allow a route to run with the older camel
> version?
>
> 4.4.1 does work. Trying to identify if I should be able to run a previous
> version.
>
> I am on windows10
> C:\work\jb>camel --version
> 4.4.1
> C:\work\jb>jbang version
> 0.103.1
>
>
> C:\work\jb>camel run  b.java --verbose --camel-version=4.0.1
> [jbang] Resolving dependencies...
> [jbang]org.apache.camel:camel-bom:4.4.1@pom
> [jbang]org.apache.camel:camel-jbang-core:4.4.1
> [jbang]org.apache.camel.kamelets:camel-kamelets:4.4.0
> [jbang] Dependencies resolved
> [jbang] Building jar...
> java.io.IOException: Cannot run program "jbang": CreateProcess error=2,
> The system cannot find the file specified
> at
> java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
> at
> java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
> at
> org.apache.camel.dsl.jbang.core.commands.Run.runCamelVersion(Run.java:958)
> at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:784)
> at
> org.apache.camel.dsl.jbang.core.commands.Run.doCall(Run.java:298)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
> at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
> at picocli.CommandLine.access$1500(CommandLine.java:148)
> at
> picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
> at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
> at
> picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
> at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
> at picocli.CommandLine.execute(CommandLine.java:2170)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:159)
> at
> org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:58)
> at main.CamelJBang.main(CamelJBang.java:36)
> Caused by: java.io.IOException: CreateProcess error=2, The system cannot
> find the file specified
> at java.base/java.lang.ProcessImpl.create(Native Method)
> at java.base/java.lang.ProcessImpl.(ProcessImpl.java:500)
>     at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
> at
> java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
> ... 17 more
>
> ચિરાગ/चिराग/Chirag
> --
> Sent from My Gmail Account
>
>
> On Fri, Mar 22, 2024 at 2:55 AM Mikael Koskinen 
> wrote:
>
>> Thank you for the quick help! 4.4.1 now installed nicely.
>>
>> And thank you for the tip regarding how to install a specific app version
>> using Jbang.
>>
>> Best regards,
>> Mikael
>>
>> pe 22. maalisk. 2024 klo 7.30 Tadayoshi Sato (sato.tadayo...@gmail.com)
>> kirjoitti:
>>
>> > Ah Claus already did it. Thanks Claus :-)
>> >
>> > On Fri, Mar 22, 2024 at 2:29 PM Tadayoshi Sato <
>> sato.tadayo...@gmail.com>
>> > wrote:
>> >
>> > > Hi,
>> > >
>> > > The Camel JBang command looks at this file in the default branch.
>> > >
>> > >
>> >
>> https://github.com/apache/camel/blob/main/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java#L22-L24
>> > >
>> > > As you see, it still points to 4.4.0. Someone will soon update it to
>> > 4.4.1
>> > > and you should be able to use it.
>> > >
>> > > By the way, the latest JBang version allows us to pass additional
>> system
>> > > properties at `jbang app install`, so you can as well now do this to
>> > > install a specific version of Camel JBang command:
>> > >
>> > >   $ jbang app install -Dcamel.jbang.version=4.4.1 camel@apache/camel
>> > >
>> > > Hope it helps,
>> > >
>> > > On Fri, Mar 22, 2024 at 2:10 PM Mikael Koskinen 
>> > > wrote:
>> > >
>> > >> Hi,
>> > >>
>> > >> I'm trying to install Camel Jbang 4.4.1 but the 4.4.0 always gets
>> > &

Re: include external files in Karavan Project

2024-04-15 Thread Chirag
Rohan,

Have you tried providing URL?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Mon, Apr 8, 2024 at 5:33 AM Rohan Emmanuel 
wrote:

> HI,
> when i create Karavan Project containing integration configuration which
> uses some Transformers like JolT transformer. How should I pass the
> external JoLT specification file so that it would be available during
> runtime to route so that the Requests can be transformed as per the JoLT
> specification file.
> Any pointers would be appreciated.
>
> --
> Regards,
> Rohan Emmanuel
>


Re: FileNotFound exception is not thrown while doing SFTP

2016-02-18 Thread Chirag
Hi,

I am too trying to catch 'FileNotFoundException' at the time of getting file
from FTP server using camel. But in-spite of trying all possible ways, I am
not able to catch this exception. Could you please tell me what have you
done to catch this exception?

Chirag 



--
View this message in context: 
http://camel.465427.n5.nabble.com/FileNotFound-exception-is-not-thrown-while-doing-SFTP-tp5748073p5777847.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-jbang maven performance

2025-02-16 Thread Chirag
--- [   main]
org.apache.camel.main.MainSupport: Apache Camel (JBang) 4.10.0 is
starting
2025-02-16 10:56:05.435  INFO 38976 --- [   main]
org.apache.camel.main.MainSupport: Using Java 21.0.4 with PID
38976. Started by user in C:\work\camel-demos\fileToPubSub
2025-02-16 10:56:05.596  INFO 38976 --- [   main]
org.apache.camel.main.ProfileConfigurer  : The application is starting with
profile: dev
2025-02-16 10:56:05.992  INFO 38976 --- [   main]
he.camel.cli.connector.LocalCliConnector : Camel JBang CLI enabled
2025-02-16 10:56:06.086  INFO 38976 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (two) is
starting
2025-02-16 10:56:06.355  INFO 38976 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Routes startup (total:1)
2025-02-16 10:56:06.355  INFO 38976 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Started route1 (timer://yaml)
2025-02-16 10:56:06.355  INFO 38976 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (two)
started in 264ms (build:0ms init:0ms start:264ms boot:908ms)
2025-02-16 10:56:07.245  INFO 38976 --- [ - timer://yaml] two.yaml:9
: Hello Camel from route1
2025-02-16 10:56:08.230  INFO 38976 --- [ - timer://yaml] two.yaml:9
: Hello Camel from route1
2025-02-16 10:56:08.669  INFO 38976 --- [ngupInterceptor]
e.camel.main.DefaultMainShutdownStrategy : JVM shutdown hook triggered by
SIGTERM (PID 38976). Shutting down Apache Camel (JBang) 4.10.0

issue seem to be only in communication with mvn.

will try older version of camel-jbang as well as compiling a code directly
using mvn to see if similar behavior occurs.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Sun, Feb 16, 2025 at 4:16 AM Claus Ibsen  wrote:

> Hi
>
> Also you can run camel-jbang with --verbose then it logs more information
> about those maven activities that can help to find out why
>
>
> On Sun, Feb 16, 2025 at 7:43 AM Claus Ibsen  wrote:
>
> > Hi
> >
> > Can you try testing with older versions of camel jbang to find out if you
> > can see a specific version where it was much slower.
> >
> >
> > On Sat, Feb 15, 2025 at 8:50 PM Chirag 
> wrote:
> >
> >> Recently I am noticing that my jbang apps take longer to start.
> >>
> >> 2025-02-15 14:42:41.393  INFO 27180 --- [   main]
> >> org.apache.camel.main.MainSupport: Apache Camel (JBang) 4.10.0
> is
> >> starting
> >> 2025-02-15 14:42:41.729  INFO 27180 --- [   main]
> >> org.apache.camel.main.MainSupport: Using Java 21.0.4 with PID
> >> 27180. Started by csanghavi in C:\work\camel-demos\fileToPubSub
> >> 2025-02-15 14:42:41.938  INFO 27180 --- [   main]
> >> org.apache.camel.main.ProfileConfigurer  : The application is starting
> >> with
> >> profile: dev
> >> 2025-02-15 14:42:47.148  INFO 27180 --- [   main]
> >> .main.download.MavenDependencyDownloader : Downloading:
> >> org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 5s)
> >> 2025-02-15 14:42:52.153  INFO 27180 --- [   main]
> >> .main.download.MavenDependencyDownloader : Downloading:
> >> org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 10s)
> >> 2025-02-15 14:42:57.165  INFO 27180 --- [   main]
> >> .main.download.MavenDependencyDownloader : Downloading:
> >> org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 15s)
> >> 2025-02-15 14:43:00.302  INFO 27180 --- [   main]
> >> .main.download.MavenDependencyDownloader : Resolved:
> >> org.apache.camel:camel-xslt-saxon:4.10.0 (took: 18s175ms)
> >> 2025-02-15 14:43:00.519  INFO 27180 --- [   main]
> >> he.camel.cli.connector.LocalCliConnector : Camel JBang CLI enabled
> >> 2025-02-15 14:43:00.846  INFO 27180 --- [   main]
> >> e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (one) is
> >> starting
> >> 2025-02-15 14:43:01.456  INFO 27180 --- [   main]
> >> e.camel.impl.engine.AbstractCamelContext : Routes startup (total:1)
> >> 2025-02-15 14:43:01.457  INFO 27180 --- [   main]
> >> e.camel.impl.engine.AbstractCamelContext : Started route1
> >> (timer://yaml)
> >> 2025-02-15 14:43:01.458  INFO 27180 --- [   main]
> >> e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (one)
> >> started in 610ms (build:0ms init:0ms start:610ms boot:19s444ms)
> >>
> >>
> >> it took about 19s, of that 18s was spent trying to fetch from local
> >> mvn cache.
> >>
> >> any setting to speed this up?
> >>
> >> This is on Windows 11.
> >>
> >> ચિરાગ/चिराग/Chirag
> >> --
> >> Sent from My Gmail Account
> >>
> >
> >
> > --
> > Claus Ibsen
> > -
> > @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>
> --
> Claus Ibsen
> -
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


camel-jbang maven performance

2025-02-15 Thread Chirag
Recently I am noticing that my jbang apps take longer to start.

2025-02-15 14:42:41.393  INFO 27180 --- [   main]
org.apache.camel.main.MainSupport: Apache Camel (JBang) 4.10.0 is
starting
2025-02-15 14:42:41.729  INFO 27180 --- [   main]
org.apache.camel.main.MainSupport: Using Java 21.0.4 with PID
27180. Started by csanghavi in C:\work\camel-demos\fileToPubSub
2025-02-15 14:42:41.938  INFO 27180 --- [   main]
org.apache.camel.main.ProfileConfigurer  : The application is starting with
profile: dev
2025-02-15 14:42:47.148  INFO 27180 --- [   main]
.main.download.MavenDependencyDownloader : Downloading:
org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 5s)
2025-02-15 14:42:52.153  INFO 27180 --- [   main]
.main.download.MavenDependencyDownloader : Downloading:
org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 10s)
2025-02-15 14:42:57.165  INFO 27180 --- [   main]
.main.download.MavenDependencyDownloader : Downloading:
org.apache.camel:camel-xslt-saxon:4.10.0 (elapsed: 15s)
2025-02-15 14:43:00.302  INFO 27180 --- [   main]
.main.download.MavenDependencyDownloader : Resolved:
org.apache.camel:camel-xslt-saxon:4.10.0 (took: 18s175ms)
2025-02-15 14:43:00.519  INFO 27180 --- [   main]
he.camel.cli.connector.LocalCliConnector : Camel JBang CLI enabled
2025-02-15 14:43:00.846  INFO 27180 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (one) is
starting
2025-02-15 14:43:01.456  INFO 27180 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Routes startup (total:1)
2025-02-15 14:43:01.457  INFO 27180 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Started route1 (timer://yaml)
2025-02-15 14:43:01.458  INFO 27180 --- [   main]
e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.10.0 (one)
started in 610ms (build:0ms init:0ms start:610ms boot:19s444ms)


it took about 19s, of that 18s was spent trying to fetch from local
mvn cache.

any setting to speed this up?

This is on Windows 11.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


camel-sap

2025-03-21 Thread Chirag
Fuse had a camel-sap component.


org.fusesource
camel-sap
x.x.x




this hasn't been part of camel standard or even camel -extras. is there a
plan to bring this into apache camel fold?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


Re: camel-sap

2025-03-24 Thread Chirag
I understand that.

Just trying to understand what happens to fusesource sap components. The
source code for some of those is published by fuse/Redhat/IBM - but if they
do bcome part of respective "git" (not part of apache camel), community
members can review/submit PR / validate if these can be "sideloaded" on
apache camel app.

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Mon, Mar 24, 2025 at 5:21 AM Federico Mariani <
federico.mariani.1...@gmail.com> wrote:

> Hello Chirag,
>
> The SAP license is not compatible with Apache rules, so the Apache Camel
> community cannot offer the camel-sap component, but there are commercial
> solutions that offer support for camel-sap.
>
> Regards,
> Federico
>
> Il giorno sab 22 mar 2025 alle ore 03:16 Chirag  >
> ha scritto:
>
> > Fuse had a camel-sap component.
> >
> > 
> > org.fusesource
> > camel-sap
> > x.x.x
> > 
> >
> >
> >
> > this hasn't been part of camel standard or even camel -extras. is there a
> > plan to bring this into apache camel fold?
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
>


Re: camel-sap

2025-03-24 Thread Chirag
Thank you for pointing me to this repository. Will explore how we can use
this.

regards,


On Mon, Mar 24, 2025 at 11:45 AM Aurélien Pupier 
wrote:

> Hi Chirag,
>
> The source code is available here
>
> https://github.com/jboss-fuse/fuse-components/tree/camel-4.10.2-branch/camel-sap
> .
> Take care of the licensing when using it.
> Pull requests can be provided to this repository.
>
> Regards,
>
> On Mon, Mar 24, 2025 at 4:12 PM Chirag  wrote:
>
> > I understand that.
> >
> > Just trying to understand what happens to fusesource sap components. The
> > source code for some of those is published by fuse/Redhat/IBM - but if
> they
> > do bcome part of respective "git" (not part of apache camel), community
> > members can review/submit PR / validate if these can be "sideloaded" on
> > apache camel app.
> >
> > ચિરાગ/चिराग/Chirag
> > --
> > Sent from My Gmail Account
> >
> >
> > On Mon, Mar 24, 2025 at 5:21 AM Federico Mariani <
> > federico.mariani.1...@gmail.com> wrote:
> >
> > > Hello Chirag,
> > >
> > > The SAP license is not compatible with Apache rules, so the Apache
> Camel
> > > community cannot offer the camel-sap component, but there are
> commercial
> > > solutions that offer support for camel-sap.
> > >
> > > Regards,
> > > Federico
> > >
> > > Il giorno sab 22 mar 2025 alle ore 03:16 Chirag <
> > chirag.sangh...@gmail.com
> > > >
> > > ha scritto:
> > >
> > > > Fuse had a camel-sap component.
> > > >
> > > > 
> > > > org.fusesource
> > > > camel-sap
> > > > x.x.x
> > > > 
> > > >
> > > >
> > > >
> > > > this hasn't been part of camel standard or even camel -extras. is
> > there a
> > > > plan to bring this into apache camel fold?
> > > >
> > > > ચિરાગ/चिराग/Chirag
> > > > --
> > > > Sent from My Gmail Account
> > > >
> > >
> >
>


need a feature in aggregate

2025-03-16 Thread Chirag
Currently, aggregate supports completionSize , completionTimeout etc.
Would like to add a compleionBytesize ; say if an endpoint can take a
maximum of 10MB, this could be set to
aggregate..completionByeSize(10*1024*1024L).

Functionally, if aggregation has at least 1 object (message or exchange)
and adding the next one leads to exceeding size, it should create a new
aggregate.

It would not be able to guarantee that the exchange is of exact size or
even Max (a message may not be broken into smaller)  and may require naming
it differently.


Re: camel-jbang maven performance

2025-03-07 Thread Chirag
Thank you Grzegorz and Claus.
Updated to 4.10.1 and is now much faster.
Is improvement just because of caching or also because of not traversing
Google bom?

ચિરાગ/चिराग/Chirag
--
Sent from My Gmail Account


On Wed, Feb 19, 2025 at 11:18 PM Tadayoshi Sato 
wrote:

> Wow, what a simple one-liner can improve performance!
>
> On Wed, Feb 19, 2025 at 8:55 PM Grzegorz Grzybek 
> wrote:
>
> > Hello
> >
> > The ultimate fix is described here:
> > https://issues.apache.org/jira/browse/CAMEL-21761. We've enabled Maven
> > ModelCache for maven downloader.
> >
> > regards
> > Grzegorz Grzybek
> >
> > pon., 17 lut 2025 o 19:46 Claus Ibsen 
> napisał(a):
> >
> > > Hi
> > >
> > > Okay I tested 4.10.1 and 4.11.0 and they run fast again
> > >
> > > Apache Camel 4.11.0-SNAPSHOT (idle) started in 104ms (build:0ms
> init:0ms
> > > start:104ms boot:741ms)
> > >
> > > On Mon, Feb 17, 2025 at 7:08 PM Claus Ibsen 
> > wrote:
> > >
> > > > Hi
> > > >
> > > > Okay we found out the problem is google-cloud-bom that is crazy.
> > > > So we are fixing this to avoid importing this bom, and will be super
> > fast
> > > > again in 4.10.1 and onwards.
> > > >
> > > > On Mon, Feb 17, 2025 at 1:14 PM Claus Ibsen 
> > > wrote:
> > > >
> > > >> Hi
> > > >>
> > > >> I created a ticket
> > > >> https://issues.apache.org/jira/browse/CAMEL-21750
> > > >>
> > > >> On Mon, Feb 17, 2025 at 12:20 PM Grzegorz Grzybek <
> > gr.grzy...@gmail.com
> > > >
> > > >> wrote:
> > > >>
> > > >>> Hello
> > > >>>
> > > >>> I tracked the problem down to HUGE amount of transitive BOM
> > > dependencies
> > > >>> starting from com.google.cloud:libraries-bom:26.54.0 being
> > bom-imported
> > > >>> from camel-parent 4.10.0:
> > > >>>
> > > >>> com.google.cloud:libraries-bom:26.54.0
> > > >>>  - com.google.protobuf:protobuf-bom:4.29.0
> > > >>>  - com.google.cloud:first-party-dependencies:3.42.0
> > > >>> - com.google.api:gapic-generator-java-bom:2.52.0
> > > >>> - com.google.cloud:google-cloud-core-bom:2.50.0
> > > >>> - com.google.oauth-client:google-oauth-client-bom:1.37.0
> > > >>> - com.google.api-client:google-api-client-bom2.7.2
> > > >>>  - com.google.cloud:google-cloud-bom:0.235.0
> > > >>> - com.google.cloud:gapic-libraries-bom:1.51.0
> > > >>>- 181 BOMs imported...
> > > >>> - com.google.cloud:google-cloud-bigquerystorage-bom:3.11.2
> > > >>>- I stopped counting...
> > > >>> - com.google.cloud:google-cloud-bigtable-bom:2.51.2
> > > >>> - com.google.cloud:google-cloud-datastore-bom:2.26.0
> > > >>> - com.google.cloud:google-cloud-firestore-bom:3.30.6
> > > >>> - com.google.cloud:google-cloud-logging-bom:3.21.2
> > > >>> - com.google.cloud:google-cloud-pubsub-bom:1.136.1
> > > >>> - com.google.cloud:google-cloud-pubsublite-bom:1.15.2
> > > >>> - com.google.cloud:google-cloud-spanner-bom:6.86.0
> > > >>> - com.google.cloud:google-cloud-storage-bom:2.48.1
> > > >>>
> > > >>> I'll see if there's something in maven-resolver that could be
> > > optimized -
> > > >>> but this is no longer a Camel/JBang issue...
> > > >>>
> > > >>> regards
> > > >>> Grzegorz Grzybek
> > > >>>
> > > >>> niedz., 16 lut 2025 o 10:16 Claus Ibsen 
> > > >>> napisał(a):
> > > >>>
> > > >>> > Hi
> > > >>> >
> > > >>> > Also you can run camel-jbang with --verbose then it logs more
> > > >>> information
> > > >>> > about those maven activities that can help to find out why
> > > >>> >
> > > >>> >
> > > >>> > On Sun, Feb 16, 2025 at 7:43 AM Claus Ibsen <
> claus.ib...@gmail.com
> > >
> > > >>> wrote:
> > > >>> >
> > > >>> > > Hi
> > >

Re: aggregate and getting results

2025-03-30 Thread Chirag
Answering my own question:
 from("seda:anotherOne")
.log("Received message from anotherOne: ${body}").split(body
()).parallelProcessing()
.process(exchange -> {
Object body = exchange.getIn().getBody();
exchange.getIn().setBody(body instanceof Exchange ?
((Exchange) body).getIn().getBody() : body);
Map originalHeaders = new HashMap<>(
body instanceof Exchange ? ((Exchange) body).getIn().getHeaders(): exchange.
getIn().getHeaders());
exchange.getIn().setHeaders(originalHeaders);
})
.log("2 ${headers} ${body}")



Is there any other way of doing this ?


On Sun, Mar 30, 2025 at 7:38 PM Chirag  wrote:

> Hello Camel riders
>
> Here is my sample route.
>
>   from("timer:java?period=1000")
> .setProperty("uuid").simple("${exchangeId}")
> .setBody()
> .simple("Hello Camel from ${uuid} at
> ${date:now:-MM-dd HH:mm:ss.SSS}")
> 
> .setHeader("CamelGooglePubsubAttributes").mvel("['key1':'value1',
> 'key2':'${uuid}']")
> .to("seda:startAggr");
>
> from("seda:startAggr")
>
> // aggregates all using the same expression and group the
> // exchanges, so we get one single exchange containing all
> // the others
>.aggregate(new GroupedExchangeAggregationStrategy()).
> constant(true).completionSize(5)
> //.aggregate(new
> GroupedBodyAggregationStrategy()).constant(true).completionSize(5)
> .log("aggregated ${body}")
> .log("Properties: ${exchangeProperty.CamelAggregatedSize}"
> )
> .to(
> "google-pubsub:test-project:test-topic?serviceAccountKey=file:///C:/work/camel-demos//testaggr//camel-pubsub-component.json"
> )
> .to("seda:anotherOne").end();
>
>
> This is working from Camel to Endpoint - 5 exchanges are being grouped and
> I can see 5 payloads written into Google PubSub.
>
> normally, when an endpoint is invoked, it would return specific responses.
> How does one go about accessing responses for a grouped exchange?
>


aggregate and getting results

2025-03-30 Thread Chirag
Hello Camel riders

Here is my sample route.

  from("timer:java?period=1000")
.setProperty("uuid").simple("${exchangeId}")
.setBody()
.simple("Hello Camel from ${uuid} at ${date:now:-MM-dd
HH:mm:ss.SSS}")

.setHeader("CamelGooglePubsubAttributes").mvel("['key1':'value1',
'key2':'${uuid}']")
.to("seda:startAggr");

from("seda:startAggr")

// aggregates all using the same expression and group the
// exchanges, so we get one single exchange containing all
// the others
   .aggregate(new GroupedExchangeAggregationStrategy()).constant
(true).completionSize(5)
//.aggregate(new
GroupedBodyAggregationStrategy()).constant(true).completionSize(5)
.log("aggregated ${body}")
.log("Properties: ${exchangeProperty.CamelAggregatedSize}")
.to(
"google-pubsub:test-project:test-topic?serviceAccountKey=file:///C:/work/camel-demos//testaggr//camel-pubsub-component.json"
)
.to("seda:anotherOne").end();


This is working from Camel to Endpoint - 5 exchanges are being grouped and
I can see 5 payloads written into Google PubSub.

normally, when an endpoint is invoked, it would return specific responses.
How does one go about accessing responses for a grouped exchange?


Re: Checking For Duplicate Message IDs Using Cassandra Idempotent Repository

2025-04-02 Thread Chirag
is ActiveMQ known to do message duplications?

Regards,

Chirag

On Wed, Apr 2, 2025 at 9:04 AM William Crowell
 wrote:

> Hi,
>
> I am trying to transfer messages from an ActiveMQ Classic queue to IBM MQ,
> and I want to make sure messages are not processed twice.  I would like to
> use the Cassandra Idempotent Repository:
>
>
> https://camel.apache.org/components/4.10.x/cql-component.html#_idempotent_repository
>
> Are there any good examples on how to accomplish this?  So far, I have
> this, but I am missing how to connect to the Cassandra database.  I am
> guessing this would be for an in-memory only Cassandra database?
>
> …
> 
>
>  id="camel" xmlns="http://camel.apache.org/schema/spring";
> streamCache="true">
>   queue://SOURCE.QUEUE?cacheLevelName=CACHE_CONSUMER&
> concurrentConsumers=2&maxConcurrentConsumers=4&maxMessagesPerTask=100&
> transacted=falsesamp;
> lazyCreateTransactionManager=false&acknowledgementModeName=CLIENT_ACKNOWLEDGE&connectionFactory=#activemq"/>
>
> 
>  header.TransactionID
>   ‹onException>
>   java.io. IOException
>
>  org.springframework.jms.IllegalStateException
>   com.ibm.mg.MQException
>   ‹handled>
>‹constant>true
>   
>   

Assistance required on Mutiple Contexts and Mutiple Routes per Contexts

2013-11-27 Thread Chirag Dewan
Hi All,


I am working on an application where we intend to use camel Endpoints for most 
of the components for eg. FTP,SMPP,HTTP,Servlet,Jetty and many more. The idea 
is to create separate wrapper components for all the endpoints and then use 
them as libraries in our project. 

Now all my components will have separate Camel Contexts which will be 
initialized from various modules in my project. 


Secondly,each module needs to be scaled requiring multiple routes(multiple 
endpoints per component). So I will dynamically add routes to my contexts.

Is this the right way of doing things? 

I am pretty new to Camel,I believe there is something I am missing in the above 
design.

Please excuse my lack of knowledge. 


Thanks!

Chirag 

Assistance required on Multiple Contexts and Multiple Routes per contexts Situation

2013-11-27 Thread Chirag Dewan


Hi All,

I am working on an application where we intend to use camel Endpoints for most 
of the components for eg. FTP,SMPP,HTTP,Servlet,Jetty and many more. The idea 
is to create separate wrapper components for all the endpoints and then use 
them as libraries in our project. 

Now all my components will have separate Camel Contexts which will be 
initialized from various modules in my project. 


Secondly,each module needs to be scaled requiring multiple routes(multiple 
endpoints per component). So I will dynamically add routes to my contexts.

Is this the right way of doing things? 

I am pretty new to Camel,I believe there is something I am missing in the above 
design.

Please excuse my lack of knowledge. 


Thanks!

Chirag 

Re: Assistance required on Mutiple Contexts and Mutiple Routes per Contexts

2013-11-28 Thread Chirag Dewan
Hi All,

Any comments on the query? 

Thanks 

Chirag

Sent from Yahoo Mail on Android



Stream consuming in Camel

2014-01-07 Thread Chirag Dewan
Hi All,

I am using Apache Camel 2.12.1. I have a use case where one of my thread is 
outputting data to a stream. I need a camel consumer which consumes this stream 
from that thread and produces a file using camel-file or camel-ftp.

Looking at the components,I wonder what I can effectively use here? One way I 
can think of is using a producer template,which might be sending the stream of 
data to a queue consumer like SEDA or Disruptor and in turn use a file or ftp 
producer. 

I am not sure I got that right. Any other way I can consume Streams here?

Any help will be appreciated.

Thanks.

CD

Passing a reference of MyObject to a bean

2014-01-09 Thread Chirag Dewan
Hi all,

This may be a very straight forward thing,but I was not able to find it.

I have a route like: 

public class MyRouteBuilder extends RouteBuilder
{

    private MyObject myObject;

    public MyRouteBuilder(MyObject myObject)
    {

        this.myObject = myObject;

    }

    @Override
    public void configure() throws Exception
    {

        from( "file:./src/inbox").bean( MyBean.class, "process(myObject)"  
).to( "file:./src/outbox" );

    }

And my bean:

public class MyBean{

public void process(MyObject myObject){

//some processing on myObject

}

Now I want to pass myObject instance to the bean. But somehow I was not able to 
do that.

Any help is much appreciated.

Thanks.

Chirag

File Names with appended sequence number in camel-ftp 2.12.1

2014-01-14 Thread Chirag Dewan
Hi All,


I was looking in the archives,found this query for appending sequence numbers 
to the file name. Do we have this feature now? 

http://camel.465427.n5.nabble.com/Camel-FTP-component-Append-a-sequence-number-if-the-filename-already-exists-td5718469.html#a5718528

I have a use case where I  want the files with increasing sequence.

Thanks!

Chirag Dewan

File Names with appended sequence number in camel-ftp 2.12.1

2014-01-14 Thread Chirag Dewan
Hi All,

I was looking in the archives,found this query for appending sequence numbers 
to the file name. Do we have this feature now? 

http://camel.465427.n5.nabble.com/Camel-FTP-component-Append-a-sequence-number-if-the-filename-already-exists-td5718469.html#a5718528

I have a use case where I  want the files with increasing sequence.

Thanks!

Chirag Dewan

Re: File Names with appended sequence number in camel-ftp 2.12.1

2014-01-14 Thread Chirag Dewan
Hi Claus,

So is there a language expression like date which I can use here or I have to 
use a processor/bean?

Thanks for your help.

Sent from Yahoo Mail on Android



Issue while using producer template with FTP for Unit Testing

2014-01-20 Thread Chirag Dewan
Hi all,

I have a route which collects file from a FTP server. I have written a Unit 
test case for the same. I have set autoCreate to false and I want to throw an 
exception if the source directory doesn't exist,which I have done by setting :

startingDirectoryMustExist = true

Now in my test case whenever I call 
producerTemplate.sendBodyAndHeader(myFTPURI,body,filename) it gives me an 
excpetion : Error writing file[filename]

After some digging in I figured out that RemoteFileProducer is returning this 
after a failed FTP operation.

This same thing works with autoCreate=true.

Is there something else I need to do to achieve this.

Thanks 


Chirag Dewan

Custom PollingConsumerPollingStrategy Query

2014-01-27 Thread Chirag Dewan
Hi all,

I have a FTP consumer route which polls the FTP directory continously. 

Now I want to implement a Custom Polling Stratergy which checks if the FTP 
server can be connected and thus stops polling if it cannot connect.

In my begin method,how can I connect to the FTP server and capture the 
exception and thus stop polling and ?

Do I have to create Consumer template here? And if I do that how can I just 
poll the FTP server without polling and downloading a file,since my endpoint 
deletes the file.

Thanks

Chirag Dewan

autoCreate and startingDirectoryMustExist on FTP Consumer

2014-02-01 Thread Chirag Dewan
Hi All,

Does FTP Consumer support autoCreate and startingDirectoryMustExist options? 

I was expecting FTP consumer to throw an exception if starting directory does 
not exist(autoCreate=false and startingDirectoryMustExist=true)  just like File 
Consumer.

Thanks

Chirag Dewan

Large Number of threads getting spawned in File Producer

2014-02-04 Thread Chirag Dewan
Hi All,

I am using Camel 2.12.1. I have a route which consumes files from a FTP Server 
and places them on the local disk. 

from("ftp:admin@ip:port/source_dir&throwExceptionOnConnectFailed=true&stepwise=false&readLock=changed&fastExistsCheck=true&localWorkDirectory=destination_dir/.temp").to("file:destination_dir").process(some
 processor);

Now I have 1 files(around 10kbs in size) on the FTP source directory. When 
I start my route,I see a lot of "file:destination_dir" threads created and in 
TIME_WAITING state during profiling. Roughly,there is a thread for each file 
that the FTP Consumer picks from the FTP server(2000 threads for around 2000 
files) after which the JVM crashes due to OOM. 

It seems the file producer creates a new thread for every file that is consumed 
from its default thread pool. 

How can I restrict the number of threads? Or why are all the threads are in a 
TIME_WAIT state?

Any help is highly appreciated.

Thanks!
 
Chirag

Re: Large Number of threads getting spawned in File Producer

2014-02-04 Thread Chirag Dewan
Hi All,

Any views on this?

BR,

Chirag



Re: Large Number of threads getting spawned in File Producer

2014-02-05 Thread Chirag Dewan
Hi Claus,

My route is running in a Storm cluster. And all I do in my processor is call a 
listener to emit the File name and the produced file path to the Spout which 
passes it on to the Bolts.

The thread name which I can see in my Profiler is "file:///destination_dir" 
which gives an impression that its the File Producer threads that are 
continously growing in number. 

I will quickly run a simple test from ftp -> file without any processing and 
post the results here.

Thanks a lot!

Chirag

   





 From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Wednesday, 5 February 2014 1:27 PM
Subject: Re: Large Number of threads getting spawned in File Producer
 

The ftp consumer in Camel is a single threaded scheduled thread pool.

So if threads is spawned it happens somewhere else. Maybe you do
something in that processor that causes threads to be spawned. You can
try to just do from ftp -> to file or from ftp -> to log and see if
there is some changes.

All the threads pool used by Camel are enlisted in JMX which you can
see. Maybe that can also give some pointers.





On Tue, Feb 4, 2014 at 12:33 PM, Chirag Dewan  wrote:
> Hi All,
>
> I am using Camel 2.12.1. I have a route which consumes files from a FTP 
> Server and places them on the local disk.
>
> from("ftp:admin@ip:port/source_dir&throwExceptionOnConnectFailed=true&stepwise=false&readLock=changed&fastExistsCheck=true&localWorkDirectory=destination_dir/.temp").to("file:destination_dir").process(some
>  processor);
>
> Now I have 1 files(around 10kbs in size) on the FTP source directory. 
> When I start my route,I see a lot of "file:destination_dir" threads created 
> and in TIME_WAITING state during profiling. Roughly,there is a thread for 
> each file that the FTP Consumer picks from the FTP server(2000 threads for 
> around 2000 files) after which the JVM crashes due to OOM.
>
> It seems the file producer creates a new thread for every file that is 
> consumed from its default thread pool.
>
> How can I restrict the number of threads? Or why are all the threads are in a 
> TIME_WAIT state?
>
> Any help is highly appreciated.
>
> Thanks!
>
> Chirag



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Large Number of threads getting spawned in File Producer

2014-02-05 Thread Chirag Dewan
Hi Richard,

Its not the FTP Consumer threads. I can see in my Profiler,a single threaded 
FTP Consumer. Its the File Producer which has an increasing number of threads. 
Can I somehow configure a thread pool for the File Producer?

Thanks a lot!

Chirag





 From: Richard Kettelerij 
To: "users@camel.apache.org"  
Sent: Wednesday, 5 February 2014 1:31 PM
Subject: Re: Large Number of threads getting spawned in File Producer
 

Hi,

I'd be surprised if a thread was started for every file. By default the
file consumer is using a thread pool of size 1.

Anyway you can customize this by specifying a ScheduledExecutorService on
the endpoint (e.g. ftp://.&scheduledExecutorService=#myExecutorService)
where myExecutorService is a threadPoolProfile which you specify on the
CamelContext. See http://camel.apache.org/threading-model.html for details.

Regards,
Richard



On Wed, Feb 5, 2014 at 5:23 AM, Chirag Dewan wrote:

> Hi All,
>
> Any views on this?
>
> BR,
>
> Chirag
>
>

OOM issue due to MemoryIdempotentRepository

2014-02-12 Thread Chirag Dewan
Hi All,

I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
application. 


Now I intent to delete the file after consuming it. So I have delete=true in my 
route. After consuming around 6000 files(out of 1,as my test case) JVM goes 
Out of memory. 


In my heap dump I can see the following trace as the major memory consumers:

java.util.ArrayList
 >java.lang.Object

    
>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService

    >org.apache.camel.component.file.FileEndpoint

            >org.apache.camel.processor.idempotent.MemoryIdempotentRepository 
             >org.apache.camel.util.LRUCache
                    
>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap


So if I am not using indempotent,should it still store the files in the memory? 
Is this memory repository used,even if I am deleting the files and not storing 
in memory? Is there a way I can avoid that?

I am testing this scenario under Storm as execution environment and with 2GB 
max heap space.

Thanks in advance

Chirag Dewan

Re: OOM issue due to MemoryIdempotentRepository

2014-02-12 Thread Chirag Dewan
Hi Claus,

Thanks for the quick reply.

It might well be. But there is one thing I would like to get some insight into. 

If idempotent=false(default) is used,will the LRU Cache still store the file 
referrence? Because that is what I can see in my memory dump. 

org.apache.camel.util.LRUCache
  
>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap

I maybe doing something wrong here. Is there anything else I need to do to make 
sure that file is deleted after it has been processed and not stored in the 
cache?

Thanks.

Chirag Dewan






 From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 5:42 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository
 

Hi

Some days ago someone else posted about a OOME issue when using Storm.
It smells like a Storm + Camel issue somewhere.



On Wed, Feb 12, 2014 at 11:50 AM, Chirag Dewan  wrote:
> Hi All,
>
> I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
> application.
>
>
> Now I intent to delete the file after consuming it. So I have delete=true in 
> my route. After consuming around 6000 files(out of 1,as my test case) JVM 
> goes Out of memory.
>
>
> In my heap dump I can see the following trace as the major memory consumers:
>
> java.util.ArrayList
>  >java.lang.Object
>
>     
>>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService
>
>         >org.apache.camel.component.file.FileEndpoint
>
>             >org.apache.camel.processor.idempotent.MemoryIdempotentRepository
>                  >org.apache.camel.util.LRUCache
>                     
>>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap
>
>
> So if I am not using indempotent,should it still store the files in the 
> memory? Is this memory repository used,even if I am deleting the files and 
> not storing in memory? Is there a way I can avoid that?
>
> I am testing this scenario under Storm as execution environment and with 2GB 
> max heap space.
>
> Thanks in advance
>
> Chirag Dewan



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: OOM issue due to MemoryIdempotentRepository

2014-02-12 Thread Chirag Dewan
Hi,

And I am using readLock=changed. So that can be a reason too?

Chirag Dewan





 From: Chirag Dewan 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 6:07 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository
 

Hi Claus,

Thanks for the quick reply.

It might well be. But there is one thing I would like to get some insight into. 

If idempotent=false(default) is used,will the LRU Cache still store the file 
referrence? Because that is what I can see in my memory dump. 

org.apache.camel.util.LRUCache
  
>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap

I maybe doing something wrong here. Is there anything else I need to do to make 
sure that file is deleted after it has been processed and not stored in the 
cache?

Thanks.

Chirag Dewan







From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 5:42 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi

Some days ago someone else posted about a OOME issue when using Storm.
It smells like a Storm + Camel issue somewhere.



On Wed, Feb 12, 2014 at 11:50 AM, Chirag Dewan  wrote:
> Hi All,
>
> I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
> application.
>
>
> Now I intent to delete the file after consuming it. So I have delete=true in 
> my route. After consuming around 6000 files(out of 1,as my test case) JVM 
> goes Out of memory.
>
>
> In my heap dump I can see the following trace as the major memory consumers:
>
> java.util.ArrayList
>  >java.lang.Object
>
>     
>>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService
>
>         >org.apache.camel.component.file.FileEndpoint
>
>             >org.apache.camel.processor.idempotent.MemoryIdempotentRepository
>                  >org.apache.camel.util.LRUCache
>                     
>>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap
>
>
> So if I am not using indempotent,should it still store the files in the 
> memory? Is this memory repository used,even if I am deleting the files and 
> not storing in memory? Is there a way I can avoid that?
>
> I am testing this scenario under Storm as execution environment and with 2GB 
> max heap space.
>
> Thanks in advance
>
> Chirag Dewan



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: OOM issue due to MemoryIdempotentRepository

2014-02-14 Thread Chirag Dewan
Hi All,

I have been looking around why a large number of heap is being consumed by 
MemoryIdempotentRepository. I saw one JIRA as well regarding 
inProgressRepository not getting cleared. Can that be the reason here?

Also,I am not using consumerTemplate to consume 1000o files. Does that also use 
inProgressRepository? And when is it cleared from the memory?

Any help is much appreciated.

Thanks!

Chirag Dewan





 From: Chirag Dewan 
To: "users@camel.apache.org" ; Chirag Dewan 
 
Sent: Wednesday, 12 February 2014 6:31 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository
 

Hi,

And I am using readLock=changed. So that can be a reason too?

Chirag Dewan




____

From: Chirag Dewan 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 6:07 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi Claus,

Thanks for the quick reply.

It might well be. But there is one thing I would like to get some insight into. 

If idempotent=false(default) is used,will the LRU Cache still store the file 
referrence? Because that is what I can see in my memory dump. 

org.apache.camel.util.LRUCache
  
>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap

I maybe doing something wrong here. Is there anything else I need to do to make 
sure that file is deleted after it has been processed and not stored in the 
cache?

Thanks.

Chirag Dewan







From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 5:42 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi

Some days ago someone else posted about a OOME issue when using Storm.
It smells like a Storm + Camel issue somewhere.



On Wed, Feb 12, 2014 at 11:50 AM, Chirag Dewan  wrote:
> Hi All,
>
> I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
> application.
>
>
> Now I intent to delete the file after consuming it. So I have delete=true in 
> my route. After consuming around 6000 files(out of 1,as my test case) JVM 
> goes Out of memory.
>
>
> In my heap dump I can see the following trace as the major memory consumers:
>
> java.util.ArrayList
>  >java.lang.Object
>
>     
>>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService
>
>         >org.apache.camel.component.file.FileEndpoint
>
>             >org.apache.camel.processor.idempotent.MemoryIdempotentRepository
>                  >org.apache.camel.util.LRUCache
>                     
>>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap
>
>
> So if I am not using indempotent,should it still store the files in the 
> memory? Is this memory repository used,even if I am deleting the files and 
> not storing in memory? Is there a way I can avoid that?
>
> I am testing this scenario under Storm as execution environment and with 2GB 
> max heap space.
>
> Thanks in advance
>
> Chirag Dewan



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: OOM issue due to MemoryIdempotentRepository

2014-02-16 Thread Chirag Dewan
Hi All,

Any views on this? 

Actually my previous mail is not understandable. Let me rephrase the issue.

I am using consumer template to consume single file using fileName property. I 
have a single instance of consumerTemplate and I call doneUoW and stop after 
consuming the file.

I am running a test case where 1 files are consumed by consumerTemplate(one 
file at a time) . After a while JVM goes OOM and crashes. In heap dump,I can 
see large number of MemoryIdempotentRepository instances. I am not using 
idempotent=true. I figured out that inProgressRepository also uses this cache. 

Is there something I am missing here?

Thanks in advance.

Chirag Dewan





 From: Chirag Dewan 
To: "users@camel.apache.org" ; Chirag Dewan 
 
Sent: Friday, 14 February 2014 3:22 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository
 

Hi All,

I have been looking around why a large number of heap is being consumed by 
MemoryIdempotentRepository. I saw one JIRA as well regarding 
inProgressRepository not getting cleared. Can that be the reason here?

Also,I am not using consumerTemplate to consume 1000o files. Does that also use 
inProgressRepository? And when is it cleared from the memory?

Any help is much appreciated.

Thanks!

Chirag Dewan




____

From: Chirag Dewan 
To: "users@camel.apache.org" ; Chirag Dewan 
 
Sent: Wednesday, 12 February 2014 6:31 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi,

And I am using readLock=changed. So that can be a reason too?

Chirag Dewan




____

From: Chirag Dewan 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 6:07 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi Claus,

Thanks for the quick reply.

It might well be. But there is one thing I would like to get some insight into. 

If idempotent=false(default) is used,will the LRU Cache still store the file 
referrence? Because that is what I can see in my memory dump. 

org.apache.camel.util.LRUCache
  
>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap

I maybe doing something wrong here. Is there anything else I need to do to make 
sure that file is deleted after it has been processed and not stored in the 
cache?

Thanks.

Chirag Dewan







From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Wednesday, 12 February 2014 5:42 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository


Hi

Some days ago someone else posted about a OOME issue when using Storm.
It smells like a Storm + Camel issue somewhere.



On Wed, Feb 12, 2014 at 11:50 AM, Chirag Dewan  wrote:
> Hi All,
>
> I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
> application.
>
>
> Now I intent to delete the file after consuming it. So I have delete=true in 
> my route. After consuming around 6000 files(out of 1,as my test case) JVM 
> goes Out of memory.
>
>
> In my heap dump I can see the following trace as the major memory consumers:
>
> java.util.ArrayList
>  >java.lang.Object
>
>     
>>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService
>
>         >org.apache.camel.component.file.FileEndpoint
>
>             >org.apache.camel.processor.idempotent.MemoryIdempotentRepository
>                  >org.apache.camel.util.LRUCache
>                     
>>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap
>
>
> So if I am not using indempotent,should it still store the files in the 
> memory? Is this memory repository used,even if I am deleting the files and 
> not storing in memory? Is there a way I can avoid that?
>
> I am testing this scenario under Storm as execution environment and with 2GB 
> max heap space.
>
> Thanks in advance
>
> Chirag Dewan



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: OOM issue due to MemoryIdempotentRepository

2014-02-16 Thread Chirag Dewan
Hi Claus,

So I dont need to start/stop the template for every file?

Right now I create a consumerTemplate at satrtup and then on every method 
call(responsible for consuming file) I start the template,consume the 
file(template.receive) and stop the template.

Is this the right approach?

Thanks.

Chirag





 From: Claus Ibsen 
To: "users@camel.apache.org"  
Sent: Monday, 17 February 2014 12:33 PM
Subject: Re: OOM issue due to MemoryIdempotentRepository
 

Hi

You should likely reuse the consumer template instead. As this FAQ
applies to it too
http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html

On Mon, Feb 17, 2014 at 8:00 AM, Chirag Dewan  wrote:
> Hi All,
>
> Any views on this?
>
> Actually my previous mail is not understandable. Let me rephrase the issue.
>
> I am using consumer template to consume single file using fileName property. 
> I have a single instance of consumerTemplate and I call doneUoW and stop 
> after consuming the file.
>
> I am running a test case where 1 files are consumed by 
> consumerTemplate(one file at a time) . After a while JVM goes OOM and 
> crashes. In heap dump,I can see large number of MemoryIdempotentRepository 
> instances. I am not using idempotent=true. I figured out that 
> inProgressRepository also uses this cache.
>
> Is there something I am missing here?
>
> Thanks in advance.
>
> Chirag Dewan
>
>
>
>
> ____
>  From: Chirag Dewan 
> To: "users@camel.apache.org" ; Chirag Dewan 
> 
> Sent: Friday, 14 February 2014 3:22 PM
> Subject: Re: OOM issue due to MemoryIdempotentRepository
>
>
> Hi All,
>
> I have been looking around why a large number of heap is being consumed by 
> MemoryIdempotentRepository. I saw one JIRA as well regarding 
> inProgressRepository not getting cleared. Can that be the reason here?
>
> Also,I am not using consumerTemplate to consume 1000o files. Does that also 
> use inProgressRepository? And when is it cleared from the memory?
>
> Any help is much appreciated.
>
> Thanks!
>
> Chirag Dewan
>
>
>
>
> 
>
> From: Chirag Dewan 
> To: "users@camel.apache.org" ; Chirag Dewan 
> 
> Sent: Wednesday, 12 February 2014 6:31 PM
> Subject: Re: OOM issue due to MemoryIdempotentRepository
>
>
> Hi,
>
> And I am using readLock=changed. So that can be a reason too?
>
> Chirag Dewan
>
>
>
>
> 
>
> From: Chirag Dewan 
> To: "users@camel.apache.org" 
> Sent: Wednesday, 12 February 2014 6:07 PM
> Subject: Re: OOM issue due to MemoryIdempotentRepository
>
>
> Hi Claus,
>
> Thanks for the quick reply.
>
> It might well be. But there is one thing I would like to get some insight 
> into.
>
> If idempotent=false(default) is used,will the LRU Cache still store the file 
> referrence? Because that is what I can see in my memory dump.
>
> org.apache.camel.util.LRUCache
>   
>>org.apache.camel.com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap
>
> I maybe doing something wrong here. Is there anything else I need to do to 
> make sure that file is deleted after it has been processed and not stored in 
> the cache?
>
> Thanks.
>
> Chirag Dewan
>
>
>
>
>
> ____
>
> From: Claus Ibsen 
> To: "users@camel.apache.org" 
> Sent: Wednesday, 12 February 2014 5:42 PM
> Subject: Re: OOM issue due to MemoryIdempotentRepository
>
>
> Hi
>
> Some days ago someone else posted about a OOME issue when using Storm.
> It smells like a Storm + Camel issue somewhere.
>
>
>
> On Wed, Feb 12, 2014 at 11:50 AM, Chirag Dewan  
> wrote:
>> Hi All,
>>
>> I am using Camel 2.12.1 with JDK 1.7.0_45. I have a FTP consumer route in my 
>> application.
>>
>>
>> Now I intent to delete the file after consuming it. So I have delete=true in 
>> my route. After consuming around 6000 files(out of 1,as my test case) 
>> JVM goes Out of memory.
>>
>>
>> In my heap dump I can see the following trace as the major memory consumers:
>>
>> java.util.ArrayList
>>  >java.lang.Object
>>
>>     
>>>org.apache.camel.management.DefaultManagementLifecycleStrategy$PreRegisterService
>>
>>         >org.apache.camel.component.file.FileEndpoint
>>
>>             >org.apache.camel.processor.idempotent.MemoryIdempotentRepository
>>                  >org.apache.camel.util.LRUCache
>>                     
>>>org.apache.camel.com.googlecode.conc

  1   2   >