[jira] [Commented] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Jan Bednar (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17200446#comment-17200446
 ] 

Jan Bednar commented on CAMEL-15568:


This is not about core engine, but about all components, EIPs and services 
which would need custom logic to support that. Eg how to reload Jetty consumer? 
You cannot have app listening on the same port twice. Every component would 
need to be super smart in order to decide which change can be done on runtime 
on underlying library, what needs restart, it would need to compare old and new 
value to decide what kind of change this is. And every single component will 
have its own requirements to support runtime changes.

All this effort will make implementation of components unmaintanable for 
something, what container like OSGI already  does by design. And for something, 
what can be solved by your architectural decision (Eg NGINX reverse proxy, 
which will handle failover during that few millis of downtime). There are no 
plans to support that in near future ( eg comment in CAMEL-10138 ) . This is 
job for containers like OSGI which can do this natively.

This is my point of view. If you want broader discussion, or you think you have 
some idea how to do that without rewriting all components, please join 
camel.zulipchat.com

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is camel 3 code for addRouteDefinitions method where routes are being 
> removed and added:}}
> {code:java}
> public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception {
> if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
> List list = new ArrayList();
> routeDefinitions.forEach((r) -> {
> if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) {
> list.add(r);
> }
> });
> this.removeRouteDefinitions(list);
> this.routeDefinitions.addAll(list);
> if (this.shouldStartRoutes()) {
> 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
> }
> }
> }
> {code}
>  
>  
> We are not able to updates routes in camelcontext frequently because of this 
> issue. Everytime we update routes in camelcontext that causes us some FCI 
> since we have high traffic in our application. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17200440#comment-17200440
 ] 

Minal Bhalodi commented on CAMEL-15568:
---

[~bedla] any reason that hot reload is not supported in camel-core-engine? can 
I expect this feature to come out in future?

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is camel 3 code for addRouteDefinitions method where routes are being 
> removed and added:}}
> {code:java}
> public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception {
> if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
> List list = new ArrayList();
> routeDefinitions.forEach((r) -> {
> if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) {
> list.add(r);
> }
> });
> this.removeRouteDefinitions(list);
> this.routeDefinitions.addAll(list);
> if (this.shouldStartRoutes()) {
> 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
> }
> }
> }
> {code}
>  
>  
> We are not able to updates routes in camelcontext frequently because of this 
> issue. Everytime we update routes in camelcontext that causes us some FCI 
> since we have high traffic in our application. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15569) Executable fat jar built with Gradle fails with exception

2020-09-22 Thread Jan Bednar (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Bednar updated CAMEL-15569:
---
External issue URL: 
https://stackoverflow.com/questions/64015236/apache-camel-timer-nullpointer-exception-at-fat-jar
   Summary: Executable fat jar built with Gradle fails with 
exception  (was: Nullpointer exception at Timer component)

> Executable fat jar built with Gradle fails with exception
> -
>
> Key: CAMEL-15569
> URL: https://issues.apache.org/jira/browse/CAMEL-15569
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.5.0
> Environment: *Java*
> openjdk version "1.8.0_265"
> OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
> OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
>  
> *Gradle 6.5*
>Reporter: Gonzalo Mendoza
>Assignee: Jan Bednar
>Priority: Major
> Attachments: Screenshot from 2020-09-22 16-42-44.png
>
>
> I'm trying to implement a timer using Camel 3.5 at Gradle project with 
> OpenJDK8 as next
> {code:java}
> from("timer://watchexpiration?fixedRate=true=60=0")...
> {code}
> But, after build the fat jar using 
> 1. Build with:  {code}./gradlew build{code} 
> 2. Run with:  {code}java -jar build/libs/app.jar{code}
> After that  I receive the next error at console
> {code:java}
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
> endpoint: timer://watchexpiration?delay=0=true=60 due 
> to: Error binding property (delay=0) with name: delay on bean: 
> timer://watchexpiration?delay=0=true=60 with value: 0
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:888)
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:777)
> at 
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
> at 
> org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177)
> at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:250)
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:112)
> {code}
> But If I run using {code}./gradlew run{code} then works fine as I expected. I 
> don't want to use any frameworks for this project. I feel this is just a 
> config issue or something is wrong with my configuration I guess.
> How can I fix it?
> *build.gradle*
> {code:java}
>  plugins {
> id 'java'
> id 'application'
> id 'com.github.sherter.google-java-format' version '0.8'
> }
> repositories {
> jcenter()
> }
> dependencies {
> implementation 'com.google.guava:guava:29.0-jre'
> testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
> testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
> // Camel
> compile group: 'org.apache.camel', name: 'camel-core', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-file', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-file-watch', version: 
> '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-xstream', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-gson', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-rest', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-servlet', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-http', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-jackson', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-quartz', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-timer', version: '3.5.0'
> compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
> compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
> // Dev Libs
> compileOnly("org.projectlombok:lombok:1.18.12")
> annotationProcessor("org.projectlombok:lombok:1.18.12")
> compile group: 'org.apache.commons', name: 'commons-csv', version: '1.4'
> }
> application {
> mainClassName = 'com.eip.App'
> }
> configurations {
> // configuration that holds jars to include in the jar
> extraLibs
> }
> jar {
> manifest {
> attributes(
> 'Main-Class': 'com.beam.agent.App'
> )
> }
> from {
> configurations.runtimeClasspath.collect { it.isDirectory() ? it : 
> zipTree(it) }
> }
> }
> test {
> useJUnitPlatform()
> }
> googleJavaFormat {
> exclude '**/App.java'
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (CAMEL-15569) Nullpointer exception at Timer component

2020-09-22 Thread Jan Bednar (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Bednar resolved CAMEL-15569.

Fix Version/s: (was: Future)
 Assignee: Jan Bednar
   Resolution: Information Provided

Please dont create Jira issue for something, what is clearly your error and not 
a bug in Apache Camel. We are active on mailing list, zulip and StackOverflow 
and ready to help you. Jira is here for reporting bugs.

First read this - [https://camel.apache.org/manual/latest/support.html]
{quote}Please refrain from immediately opening a ticket in the issue tracker 
unless you are certain it’s a problem in the Camel software. If you are in 
doubt, we appreciate asking the [mailing 
list|https://camel.apache.org/manual/latest/mailing-lists.html], or [Chat 
room|https://camel.zulipchat.com/] first.
{quote}
And then look at my answer to your question on SO - 
[https://stackoverflow.com/a/64018354/8576169]
{quote}Shadowing jars is quite magic, because you need to handle duplicate 
entries somehow. In Apache Camel there are many {{META-INF}} service files, 
which are getting overwritten with your simple {{jar}} approach. Use 
{{com.github.johnrengelman.shadow}} which is allowing you to customize merging 
process.
{code:java}
shadowJar {
mergeServiceFiles() // Tell plugin to merge duplicate service files
manifest {
attributes 'Main-Class': 'com.eip.App'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
{code}
{quote}

> Nullpointer exception at Timer component
> 
>
> Key: CAMEL-15569
> URL: https://issues.apache.org/jira/browse/CAMEL-15569
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.5.0
> Environment: *Java*
> openjdk version "1.8.0_265"
> OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
> OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
>  
> *Gradle 6.5*
>Reporter: Gonzalo Mendoza
>Assignee: Jan Bednar
>Priority: Major
> Attachments: Screenshot from 2020-09-22 16-42-44.png
>
>
> I'm trying to implement a timer using Camel 3.5 at Gradle project with 
> OpenJDK8 as next
> {code:java}
> from("timer://watchexpiration?fixedRate=true=60=0")...
> {code}
> But, after build the fat jar using 
> 1. Build with:  {code}./gradlew build{code} 
> 2. Run with:  {code}java -jar build/libs/app.jar{code}
> After that  I receive the next error at console
> {code:java}
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
> endpoint: timer://watchexpiration?delay=0=true=60 due 
> to: Error binding property (delay=0) with name: delay on bean: 
> timer://watchexpiration?delay=0=true=60 with value: 0
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:888)
> at 
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:777)
> at 
> org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
> at 
> org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177)
> at 
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:250)
> at 
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:112)
> {code}
> But If I run using {code}./gradlew run{code} then works fine as I expected. I 
> don't want to use any frameworks for this project. I feel this is just a 
> config issue or something is wrong with my configuration I guess.
> How can I fix it?
> *build.gradle*
> {code:java}
>  plugins {
> id 'java'
> id 'application'
> id 'com.github.sherter.google-java-format' version '0.8'
> }
> repositories {
> jcenter()
> }
> dependencies {
> implementation 'com.google.guava:guava:29.0-jre'
> testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
> testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
> // Camel
> compile group: 'org.apache.camel', name: 'camel-core', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-file', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-file-watch', version: 
> '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-xstream', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-gson', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-rest', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-servlet', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-http', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-jackson', version: '3.5.0'
> compile group: 'org.apache.camel', name: 'camel-quartz', version: '3.5.0'
> compile group: 'org.apache.camel', 

[jira] [Commented] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17200404#comment-17200404
 ] 

Minal Bhalodi commented on CAMEL-15568:
---

[~bedla] Thanks for the quick response.

 

I already posted on stack-overflow 5 days ago and also sent email in mailing 
list mentioned in the above link but didn't get any response so had to create 
this bug.

[https://stackoverflow.com/questions/63931881/dynamic-routes-updates-issue-in-apache-camel]

 

 

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is camel 3 code for addRouteDefinitions method where routes are being 
> removed and added:}}
> {code:java}
> public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception {
> if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
> List list = new ArrayList();
> routeDefinitions.forEach((r) -> {
> if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) {
> list.add(r);
> }
> });
> this.removeRouteDefinitions(list);
> this.routeDefinitions.addAll(list);
> if (this.shouldStartRoutes()) {
> 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
> }
> }
> }
> {code}
>  
>  
> We are not able to updates routes in camelcontext frequently because of this 
> issue. Everytime we update routes in camelcontext that causes us some FCI 
> since we have high traffic in our application. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-15569) Nullpointer exception at Timer component

2020-09-22 Thread Gonzalo Mendoza (Jira)
Gonzalo Mendoza created CAMEL-15569:
---

 Summary: Nullpointer exception at Timer component
 Key: CAMEL-15569
 URL: https://issues.apache.org/jira/browse/CAMEL-15569
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 3.5.0
 Environment: *Java*

openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)

 

*Gradle 6.5*
Reporter: Gonzalo Mendoza
 Fix For: Future
 Attachments: Screenshot from 2020-09-22 16-42-44.png

I'm trying to implement a timer using Camel 3.5 at Gradle project with OpenJDK8 
as next
{code:java}
from("timer://watchexpiration?fixedRate=true=60=0")...
{code}
But, after build the fat jar using 
1. Build with:  {code}./gradlew build{code} 
2. Run with:  {code}java -jar build/libs/app.jar{code}

After that  I receive the next error at console
{code:java}
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve 
endpoint: timer://watchexpiration?delay=0=true=60 due to: 
Error binding property (delay=0) with name: delay on bean: 
timer://watchexpiration?delay=0=true=60 with value: 0
at 
org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:888)
at 
org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:777)
at 
org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
at 
org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177)
at 
org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:250)
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:112)
{code}
But If I run using {code}./gradlew run{code} then works fine as I expected. I 
don't want to use any frameworks for this project. I feel this is just a config 
issue or something is wrong with my configuration I guess.

How can I fix it?

*build.gradle*
{code:java}
 plugins {
id 'java'
id 'application'
id 'com.github.sherter.google-java-format' version '0.8'
}

repositories {
jcenter()
}

dependencies {
implementation 'com.google.guava:guava:29.0-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
// Camel
compile group: 'org.apache.camel', name: 'camel-core', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-file', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-file-watch', version: 
'3.5.0'
compile group: 'org.apache.camel', name: 'camel-xstream', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-gson', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-rest', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-servlet', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-http', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-jackson', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-quartz', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-timer', version: '3.5.0'

compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'

// Dev Libs
compileOnly("org.projectlombok:lombok:1.18.12")
annotationProcessor("org.projectlombok:lombok:1.18.12")

compile group: 'org.apache.commons', name: 'commons-csv', version: '1.4'
}

application {
mainClassName = 'com.eip.App'
}

configurations {
// configuration that holds jars to include in the jar
extraLibs
}

jar {
manifest {
attributes(
'Main-Class': 'com.beam.agent.App'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : 
zipTree(it) }
}
}

test {
useJUnitPlatform()
}

googleJavaFormat {
exclude '**/App.java'
}

{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Resolved] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Jan Bednar (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Bednar resolved CAMEL-15568.

Resolution: Not A Problem

Hot reload of routes is not supported usage of this API. There are projects in 
Camel ecosystem much more suitable for this, like camel-quarkus or camel-k. 
You can also deploy your app in some application server, which support hot 
deploy (like Karaf, Fuse).

If you need more help with this, please ask on mailing list, gitter, or 
StackOverflow. This is not a bug.
https://camel.apache.org/manual/latest/support.html

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is camel 3 code for addRouteDefinitions method where routes are being 
> removed and added:}}
> {code:java}
> public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception {
> if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
> List list = new ArrayList();
> routeDefinitions.forEach((r) -> {
> if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) {
> list.add(r);
> }
> });
> this.removeRouteDefinitions(list);
> this.routeDefinitions.addAll(list);
> if (this.shouldStartRoutes()) {
> 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
> }
> }
> }
> {code}
>  
>  
> We are not able to updates routes in camelcontext frequently because of this 
> issue. Everytime we update routes in camelcontext that causes us some FCI 
> since we have high traffic in our application. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Description: 
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is camel 3 code for addRouteDefinitions method where routes are being 
removed and added:}}
{code:java}
public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception {
if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
List list = new ArrayList();
routeDefinitions.forEach((r) -> {
if (this.routeFilter == null || (Boolean)this.routeFilter.apply(r)) 
{
list.add(r);
}

});
this.removeRouteDefinitions(list);
this.routeDefinitions.addAll(list);
if (this.shouldStartRoutes()) {

((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
}

}
}

{code}
 

 

We are not able to updates routes in camelcontext frequently because of this 
issue. Everytime we update routes in camelcontext that causes us some FCI since 
we have high traffic in our application. 

 

  was:
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is camel 3 code for addRouteDefinitions method where routes are being 
removed and added:}}
{code:java}
public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception {
if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
List list = new ArrayList();
routeDefinitions.forEach((r) -> {
if (this.routeFilter == null || (Boolean)this.routeFilter.apply(r)) 
{
list.add(r);
}

});
this.removeRouteDefinitions(list);
this.routeDefinitions.addAll(list);
if (this.shouldStartRoutes()) {

((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
}

}
}

{code}
 

 

 

 


> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these 

[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Component/s: (was: camel-core)
 camel-core-engine

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core-engine
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is camel 3 code for addRouteDefinitions method where routes are being 
> removed and added:}}
> {code:java}
> public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception {
> if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
> List list = new ArrayList();
> routeDefinitions.forEach((r) -> {
> if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) {
> list.add(r);
> }
> });
> this.removeRouteDefinitions(list);
> this.routeDefinitions.addAll(list);
> if (this.shouldStartRoutes()) {
> 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
> }
> }
> }
> {code}
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Description: 
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is camel 3 code for addRouteDefinitions method where routes are being 
removed and added:}}
{code:java}
public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception {
if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
List list = new ArrayList();
routeDefinitions.forEach((r) -> {
if (this.routeFilter == null || (Boolean)this.routeFilter.apply(r)) 
{
list.add(r);
}

});
this.removeRouteDefinitions(list);
this.routeDefinitions.addAll(list);
if (this.shouldStartRoutes()) {

((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
}

}
}

{code}
 

 

 

 

  was:
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is camel 3 code for addRouteDefinitions method:}}
{code:java}
public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception {
if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
List list = new ArrayList();
routeDefinitions.forEach((r) -> {
if (this.routeFilter == null || (Boolean)this.routeFilter.apply(r)) 
{
list.add(r);
}

});
this.removeRouteDefinitions(list);
this.routeDefinitions.addAll(list);
if (this.shouldStartRoutes()) {

((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
}

}
}

{code}
 

 

 

 


> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes 

[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Description: 
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is camel 3 code for addRouteDefinitions method:}}
{code:java}
public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception {
if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
List list = new ArrayList();
routeDefinitions.forEach((r) -> {
if (this.routeFilter == null || (Boolean)this.routeFilter.apply(r)) 
{
list.add(r);
}

});
this.removeRouteDefinitions(list);
this.routeDefinitions.addAll(list);
if (this.shouldStartRoutes()) {

((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
}

}
}

{code}
 

 

 

 

  was:
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is  camel 3 code for addRouteDefinitions method:}}

{{}}

{{}}
{code:java}

{code}
{{// public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception \{ if (routeDefinitions != null && 
!routeDefinitions.isEmpty()) { List list = new ArrayList(); 
routeDefinitions.forEach((r) -> { if (this.routeFilter == null || 
(Boolean)this.routeFilter.apply(r)) { list.add(r); } }); 
this.removeRouteDefinitions(list); this.routeDefinitions.addAll(list); if 
(this.shouldStartRoutes()) \{ 
((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
 } } }}}{{}}

 

 

 

 


> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = 

[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Description: 
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

// update routes in camel contexts. Definitions are in XML files

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
 mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also call getRoute to serve 
live traffic.

Since addRouteDefinitions first delete routes given in 
{{workflowDefinitionsList}} from camel context and then add those routes back 
to camelcontext, These routes won't be available for few mili second and that 
causes request to fails.

Route route = exchange.getContext().getRoute(workflowRouteId);  // get route

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue. Is there any other method available where we can PATCH 
routes changes at runtime. Dynamic route updates shouldn't cause few requests 
to fails.

 

 

{{Here is  camel 3 code for addRouteDefinitions method:}}

{{}}

{{}}
{code:java}

{code}
{{// public synchronized void addRouteDefinitions(Collection 
routeDefinitions) throws Exception \{ if (routeDefinitions != null && 
!routeDefinitions.isEmpty()) { List list = new ArrayList(); 
routeDefinitions.forEach((r) -> { if (this.routeFilter == null || 
(Boolean)this.routeFilter.apply(r)) { list.add(r); } }); 
this.removeRouteDefinitions(list); this.routeDefinitions.addAll(list); if 
(this.shouldStartRoutes()) \{ 
((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
 } } }}}{{}}

 

 

 

 

  was:
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also serve requests using 
those routes from same CamelContext and few Requests fails.

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue.

My application’s code to update routes at runtime: Here we can see that to 
add/update routes, these code first delete all routes and then add them back. 
These affects the live traffic and requests fails.:

 

 


> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> // update routes in camel contexts. Definitions are in XML files
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
>  mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also call getRoute to serve 
> live traffic.
> Since addRouteDefinitions first delete routes given in 
> {{workflowDefinitionsList}} from camel context and then add those routes back 
> to camelcontext, These routes won't be available for few mili second and that 
> causes request to fails.
> Route route = exchange.getContext().getRoute(workflowRouteId);  // get route
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue. Is there any other method available where we can 
> PATCH routes changes at runtime. Dynamic route updates shouldn't cause few 
> requests to fails.
>  
>  
> {{Here is  camel 3 code for addRouteDefinitions method:}}
> {{}}
> {{}}
> {code:java}
> {code}
> {{// public synchronized void addRouteDefinitions(Collection 
> routeDefinitions) throws Exception \{ if (routeDefinitions != null && 
> !routeDefinitions.isEmpty()) { List list = new ArrayList(); 
> routeDefinitions.forEach((r) -> { if (this.routeFilter == null || 
> (Boolean)this.routeFilter.apply(r)) { list.add(r); } }); 
> this.removeRouteDefinitions(list); this.routeDefinitions.addAll(list); if 
> (this.shouldStartRoutes()) \{ 
> ((ModelCamelContext)this.getCamelContext().adapt(ModelCamelContext.class)).startRouteDefinitions(list);
>  } } }}}{{}}
>  
>  
>  
>  



--
This message was sent by Atlassian Jira

[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Description: 
We are using Apache Camel 3.2.0. We update camel routes at runtime using below 
code. 

ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
workflowDefinitionsList is the list of XML routes}}

 

*Problem Statement*: Dynamic routes updates causes few requests to fail at 
runtime. When these routes are being updated, we also serve requests using 
those routes from same CamelContext and few Requests fails.

Since there can be only one CamelContext per Application, I am not sure how can 
I resolve this issue.

My application’s code to update routes at runtime: Here we can see that to 
add/update routes, these code first delete all routes and then add them back. 
These affects the live traffic and requests fails.:

 

 

  was:
we use Persistent Custom MDC Logging in Apache Camel as mentioned in this link.
h1. 
[https://developers.redhat.com/blog/2016/05/12/persistent-custom-mdc-logging-in-apache-camel/]

 

After we upgrade Apache Camel version from 2.25.0 to 3.2.0 , we started seeing 
issue of thread is being hold for 30-40 ms when calling CustomUnitOFWork which 
internally call MDCUnitOfWork. 

 

What we noticed is thread hold time is keep on increasing every hour and not 
able to understand this issue. 


> Dynamic route updates causes few requests to fails
> --
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
> mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also serve requests using 
> those routes from same CamelContext and few Requests fails.
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue.
> My application’s code to update routes at runtime: Here we can see that to 
> add/update routes, these code first delete all routes and then add them back. 
> These affects the live traffic and requests fails.:
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Minal Bhalodi updated CAMEL-15568:
--
Summary: Dynamic route updates causes few requests to fails   (was: Dynamic 
route updates causes few requests to fails)

> Dynamic route updates causes few requests to fails 
> ---
>
> Key: CAMEL-15568
> URL: https://issues.apache.org/jira/browse/CAMEL-15568
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.2.0
>Reporter: Minal Bhalodi
>Priority: Minor
>
> We are using Apache Camel 3.2.0. We update camel routes at runtime using 
> below code. 
> ModelCamelContext mcc = camelContext.adapt(ModelCamelContext.class);
> mcc.addRouteDefinitions({{workflowDefinitionsList}}); {{// 
> workflowDefinitionsList is the list of XML routes}}
>  
> *Problem Statement*: Dynamic routes updates causes few requests to fail at 
> runtime. When these routes are being updated, we also serve requests using 
> those routes from same CamelContext and few Requests fails.
> Since there can be only one CamelContext per Application, I am not sure how 
> can I resolve this issue.
> My application’s code to update routes at runtime: Here we can see that to 
> add/update routes, these code first delete all routes and then add them back. 
> These affects the live traffic and requests fails.:
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-15568) Dynamic route updates causes few requests to fails

2020-09-22 Thread Minal Bhalodi (Jira)
Minal Bhalodi created CAMEL-15568:
-

 Summary: Dynamic route updates causes few requests to fails
 Key: CAMEL-15568
 URL: https://issues.apache.org/jira/browse/CAMEL-15568
 Project: Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 3.2.0
Reporter: Minal Bhalodi


we use Persistent Custom MDC Logging in Apache Camel as mentioned in this link.
h1. 
[https://developers.redhat.com/blog/2016/05/12/persistent-custom-mdc-logging-in-apache-camel/]

 

After we upgrade Apache Camel version from 2.25.0 to 3.2.0 , we started seeing 
issue of thread is being hold for 30-40 ms when calling CustomUnitOFWork which 
internally call MDCUnitOfWork. 

 

What we noticed is thread hold time is keep on increasing every hour and not 
able to understand this issue. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15503) Apache Camel camel-openapi-java Schema Definitions not generating correctly

2020-09-22 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-15503:

Fix Version/s: (was: 3.4.4)
   3.4.5

> Apache Camel camel-openapi-java Schema Definitions not generating correctly
> ---
>
> Key: CAMEL-15503
> URL: https://issues.apache.org/jira/browse/CAMEL-15503
> Project: Camel
>  Issue Type: Bug
>  Components: camel-openapi-java
>Affects Versions: 3.4.3
>Reporter: Kate Hennessy
>Assignee: Viral Gohel
>Priority: Major
> Fix For: 3.6.0, 3.4.5
>
> Attachments: camelOpenAPITest.zip
>
>
> Classes defined in RestDefinition _type_ and _outType_ are not generating 
> correctly in openapi schema. This worked in the older older 
> camel-swagger-java component, the schema was generating with all object 
> definitions correctly. 
>  
> Please see this question on stack overflow for more details. 
> [https://stackoverflow.com/questions/63691670/apache-camel-camel-openapi-java-schema-definitions-not-generating-correctly]
>  
> Sample project with the issue happening is attached. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Updated] (CAMEL-15522) AWS Xray Component issue

2020-09-22 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-15522:

Fix Version/s: (was: 3.4.4)
   3.4.5

> AWS Xray Component issue
> 
>
> Key: CAMEL-15522
> URL: https://issues.apache.org/jira/browse/CAMEL-15522
> Project: Camel
>  Issue Type: Bug
>  Components: camel-aws
>Affects Versions: 3.4.3
> Environment: Ubuntu 20.04.01
>Reporter: Andrii Melashchenko
>Priority: Major
> Fix For: 3.6.0, 3.4.5
>
>
> I'm trying to configure Camel AWS Xray tracing via this code 
> Route:
>  
> {code:java}
>  class="org.apache.camel.component.aws.xray.TraceAnnotatedTracingStrategy" />
>  class="org.apache.camel.component.aws.xray.XRayTracer" >
> 
> 
>xmlns="http://camel.apache.org/schema/spring;>
> 
>deadLetterUri="file://{{zedoc.dead.letter.folder}}/"
>   useOriginalMessage="true"
>   onPrepareFailureRef="failureProcessor">
>retryAttemptedLogLevel="WARN"
>   backOffMultiplier="2"
>   useExponentialBackOff="true"/>
> 
> 
> 
> 
> 
>  uri="netty:tcp://{{zedoc.tcp.host}}:{{zedoc.tcp.port}}?sync=falsedecoders=#hl7decoderencoders=#hl7encoderssl=truesslContextParameters=#sslContextParameters"/>
> 
> 
>  uri="netty:tcp://{{zedoc.tcp.host}}:{{zedoc.tcp.port}}?sync=falsedecoders=#hl7decoderencoders=#hl7encoderneedClientAuth=truessl=truesslContextParameters=#sslContextParameters"/>
> 
> 
> 
> 
> 
> 
> 
> {code}
> POM:
> {code:java}
> 
>  
> org.apache.camel
> camel-aws-xray
> 3.4.3
> 
> 
> com.amazonaws
> aws-xray-recorder-sdk-core
> 2.7.1
> 
> 
> com.amazonaws
> aws-xray-recorder-sdk-aws-sdk
> 2.7.1
> 
> {code}
> {color:#e8bf6a} {color}
> Processor:
> {code:java}
> public class ADT01Processor {
> final Logger logger = LoggerFactory.getLogger(ADT01Processor.class);
> @Handler
> public String processADT(Exchange exchange) throws Exception {
> ADT_A01 inMsg = exchange.getIn().getBody(ADT_A01.class);
> Terser t = new Terser(inMsg);
> // create JSON
> Patient p = new Patient();
> String recipientId = t.get("/.PID-3-1");
> if(recipientId == null || recipientId.isEmpty()){
> throw new Exception("HL7 don't have PID-3-1 that used for 
> mandatory recipientId field");
> }
> Identifier id = new Identifier(recipientId, recipientId);
> p.addIdetifier(id);
> String name = t.get("/.PID-5-2");
> Name n = new Name(name);
> p.addName(n);
> EnrollPatientA01 a01 = new EnrollPatientA01(p);
> MQMessage outMsg = new MQMessage("fakeGroup");
> outMsg.setRawMessage(a01);
> // stringify
> Gson gson = new Gson();
> String stringifyied = gson.toJson(outMsg);
> logger.info(stringifyied);
> return stringifyied;
> }
> }
> {code}
> {color:#bbb529} {color}
> And got an error
> java.lang.IllegalStateException: Failed to load ApplicationContext
>  at 
> org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:98)
>  ~[spring-test-5.2.8.RELEASE.jar:5.2.8.RELEASE]
>  at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$5(ClassBasedTestDescriptor.java:341)
>  ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
>  at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:346)
>  ~[junit-jupiter-engine-5.6.2.jar:5.6.2]
>  at 
> org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:341)
>  

[jira] [Updated] (CAMEL-15558) pollEnrich timeout issue

2020-09-22 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-15558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-15558:

Fix Version/s: (was: 3.4.4)
   3.4.5

> pollEnrich timeout issue
> 
>
> Key: CAMEL-15558
> URL: https://issues.apache.org/jira/browse/CAMEL-15558
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 3.4.3, 3.5.0
>Reporter: ncasaux
>Priority: Major
> Fix For: 3.6.0, 3.4.5
>
>
> Hello !
>  I’m trying to use this simple route with Camel 3.4.3 and springboot :
> {code:java}
>  from("timer:hello?repeatCount=1=1000").routeId("hello")
>      .to("log:1")
>      .pollEnrich("file:d:\\temp?noop=true=dummy.csv",5000)
>      .to("log:2");{code}
>  I run it without the file dummy.csv, to test the timeout option.
>  The timeout functionality does not seem to work, as you can see in the log, 
> there’s no delay between log1 and log2:
>  
> {code:java}
>  2020-09-19 11:39:30.099  INFO 186564 --- [- timer://hello] 1 
>    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2020-09-19 11:39:30.107  INFO 186564 --- [- timer://hello] 
> o.a.camel.component.file.FileEndpoint    : Endpoint is configured with 
> noop=true so forcing endpoint to be idempotent as well
> 2020-09-19 11:39:30.107  INFO 186564 --- [- timer://hello] 
> o.a.camel.component.file.FileEndpoint    : Using default memory based 
> idempotent repository with cache max size: 1000
> 2020-09-19 11:39:30.208  INFO 186564 --- [- timer://hello] 2  
>   : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> {code}
>  
>  However, with Camel 2.24.3  It seems to work as expected as we can see the 5 
> sec delay between log1 and log2:
>  
> {code:java}
>  2020-09-19 11:38:50.242  INFO 151696 --- [- timer://hello] 1 
>    : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> 2020-09-19 11:38:50.244  INFO 151696 --- [- timer://hello] 
> o.a.camel.processor.interceptor.Tracer   : ID-ITEM-S74991-1600508328077-0-1 
> >>> (hello) log://1 --> 
> pollEnrich[constant{file:d:\temp?noop=true=dummy.csv}] <<< 
> Pattern:InOnly, Headers:{breadcrumbId=ID-ITEM-S74991-1600508328077-0-1, 
> firedTime=Sat Sep 19 11:38:50 CEST 2020}, BodyType:null, Body:[Body is null]
> 2020-09-19 11:38:50.259  INFO 151696 --- [- timer://hello] 
> o.a.camel.component.file.FileEndpoint    : Endpoint is configured with 
> noop=true so forcing endpoint to be idempotent as well
> 2020-09-19 11:38:50.259  INFO 151696 --- [- timer://hello] 
> o.a.camel.component.file.FileEndpoint    : Using default memory based 
> idempotent repository with cache max size: 1000
> 2020-09-19 11:38:55.355  INFO 151696 --- [- timer://hello] 
> o.a.camel.processor.interceptor.Tracer   : ID-ITEM-S74991-1600508328077-0-1 
> >>> (hello) pollEnrich[constant{file:d:\temp?noop=true=dummy.csv}] 
> --> log://2 <<< Pattern:InOnly, 
> Headers:{breadcrumbId=ID-ITEM-S74991-1600508328077-0-1, 
> CamelToEndpoint=file://d:%5Ctemp?fileName=dummy.csv=true, firedTime=Sat 
> Sep 19 11:38:50 CEST 2020}, BodyType:null, Body:[Body is null]
> 2020-09-19 11:38:55.355  INFO 151696 --- [- timer://hello] 2  
>   : Exchange[ExchangePattern: InOnly, BodyType: null, 
> Body: [Body is null]]
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CAMEL-15564) JDBC BASED Persistence Aggregator Deserialization Issue

2020-09-22 Thread Andrea Cosentino (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199968#comment-17199968
 ] 

Andrea Cosentino commented on CAMEL-15564:
--

Please don't be too eager. If you need immediate support you can use commercial 
offerings.

https://camel.apache.org/manual/latest/commercial-camel-offerings.html

> JDBC BASED Persistence Aggregator Deserialization Issue
> ---
>
> Key: CAMEL-15564
> URL: https://issues.apache.org/jira/browse/CAMEL-15564
> Project: Camel
>  Issue Type: Bug
>  Components: camel-sql
>Affects Versions: 2.25.1, 3.4.3
>Reporter: Leo Guo
>Priority: Minor
>
> USING THE JDBC BASED AGGREGATION REPOSITORY in cluster architecture, set 
> different correlation Id in each instance, so the aggregated message will be 
> picked up by instance which saved data in table.
> But randomly get below issue once read data from table then deserialize 
> exchange, once issue occur message won't be deleted from table when new 
> message come in will read data then constantly throw exception.
> java.lang.RuntimeException: Error getting key wgc_1_ACE_NOT_VALID from 
> repository CRD_INT.FI_QAS_PRICE_AGG
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:293)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:282)
>  at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:282)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:274)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1186)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1152)
>  at 
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:229)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:1166)
>  at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:179)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.io.StreamCorruptedException: BigInteger: signum-magnitude 
> mismatch
>  at java.math.BigInteger.readObject(BigInteger.java:4525)
>  at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:613)
>  at java.math.BigDecimal.readObject(BigDecimal.java:3779)
>  at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2290)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at 

[jira] [Comment Edited] (CAMEL-15564) JDBC BASED Persistence Aggregator Deserialization Issue

2020-09-22 Thread Leo Guo (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199937#comment-17199937
 ] 

Leo Guo edited comment on CAMEL-15564 at 9/22/20, 10:06 AM:


Hi [~davsclaus],

Any suggestion? Currently we are pending on this issue, many thanks if any idea.

 

I can't see implement Serializable/serialVersionUID defined in DefaultExchange 
class, is that cause this issue?


was (Author: leoguo):
Hi [~davsclaus],

Any suggestion? Currently we are pending on this issue, many thanks if any idea.

 

I can't see serialVersionUID in DefaultExchange class, is that cause this issue?

> JDBC BASED Persistence Aggregator Deserialization Issue
> ---
>
> Key: CAMEL-15564
> URL: https://issues.apache.org/jira/browse/CAMEL-15564
> Project: Camel
>  Issue Type: Bug
>  Components: camel-sql
>Affects Versions: 2.25.1, 3.4.3
>Reporter: Leo Guo
>Priority: Minor
>
> USING THE JDBC BASED AGGREGATION REPOSITORY in cluster architecture, set 
> different correlation Id in each instance, so the aggregated message will be 
> picked up by instance which saved data in table.
> But randomly get below issue once read data from table then deserialize 
> exchange, once issue occur message won't be deleted from table when new 
> message come in will read data then constantly throw exception.
> java.lang.RuntimeException: Error getting key wgc_1_ACE_NOT_VALID from 
> repository CRD_INT.FI_QAS_PRICE_AGG
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:293)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:282)
>  at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:282)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:274)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1186)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1152)
>  at 
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:229)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:1166)
>  at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:179)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.io.StreamCorruptedException: BigInteger: signum-magnitude 
> mismatch
>  at java.math.BigInteger.readObject(BigInteger.java:4525)
>  at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:613)
>  at java.math.BigDecimal.readObject(BigDecimal.java:3779)
>  at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2290)
>  at 

[jira] [Comment Edited] (CAMEL-15564) JDBC BASED Persistence Aggregator Deserialization Issue

2020-09-22 Thread Leo Guo (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199937#comment-17199937
 ] 

Leo Guo edited comment on CAMEL-15564 at 9/22/20, 10:05 AM:


Hi [~davsclaus],

Any suggestion? Currently we are pending on this issue, many thanks if any idea.

 

I can't see serialVersionUID in DefaultExchange class, is that cause this issue?


was (Author: leoguo):
Hi [~davsclaus],

Any suggestion? Currently we are pending on this issue, many thanks if any idea.

> JDBC BASED Persistence Aggregator Deserialization Issue
> ---
>
> Key: CAMEL-15564
> URL: https://issues.apache.org/jira/browse/CAMEL-15564
> Project: Camel
>  Issue Type: Bug
>  Components: camel-sql
>Affects Versions: 2.25.1, 3.4.3
>Reporter: Leo Guo
>Priority: Minor
>
> USING THE JDBC BASED AGGREGATION REPOSITORY in cluster architecture, set 
> different correlation Id in each instance, so the aggregated message will be 
> picked up by instance which saved data in table.
> But randomly get below issue once read data from table then deserialize 
> exchange, once issue occur message won't be deleted from table when new 
> message come in will read data then constantly throw exception.
> java.lang.RuntimeException: Error getting key wgc_1_ACE_NOT_VALID from 
> repository CRD_INT.FI_QAS_PRICE_AGG
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:293)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:282)
>  at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:282)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:274)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1186)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1152)
>  at 
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:229)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:1166)
>  at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:179)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.io.StreamCorruptedException: BigInteger: signum-magnitude 
> mismatch
>  at java.math.BigInteger.readObject(BigInteger.java:4525)
>  at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:613)
>  at java.math.BigDecimal.readObject(BigDecimal.java:3779)
>  at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2290)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at 

[jira] [Commented] (CAMEL-15564) JDBC BASED Persistence Aggregator Deserialization Issue

2020-09-22 Thread Leo Guo (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199937#comment-17199937
 ] 

Leo Guo commented on CAMEL-15564:
-

Hi [~davsclaus],

Any suggestion? Currently we are pending on this issue, many thanks if any idea.

> JDBC BASED Persistence Aggregator Deserialization Issue
> ---
>
> Key: CAMEL-15564
> URL: https://issues.apache.org/jira/browse/CAMEL-15564
> Project: Camel
>  Issue Type: Bug
>  Components: camel-sql
>Affects Versions: 2.25.1, 3.4.3
>Reporter: Leo Guo
>Priority: Minor
>
> USING THE JDBC BASED AGGREGATION REPOSITORY in cluster architecture, set 
> different correlation Id in each instance, so the aggregated message will be 
> picked up by instance which saved data in table.
> But randomly get below issue once read data from table then deserialize 
> exchange, once issue occur message won't be deleted from table when new 
> message come in will read data then constantly throw exception.
> java.lang.RuntimeException: Error getting key wgc_1_ACE_NOT_VALID from 
> repository CRD_INT.FI_QAS_PRICE_AGG
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:293)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository$3.doInTransaction(JdbcAggregationRepository.java:282)
>  at 
> org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:282)
>  at 
> org.apache.camel.processor.aggregate.jdbc.JdbcAggregationRepository.get(JdbcAggregationRepository.java:274)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1186)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.onEviction(AggregateProcessor.java:1152)
>  at 
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:229)
>  at 
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:1166)
>  at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:179)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>  at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
> Caused by: java.io.StreamCorruptedException: BigInteger: signum-magnitude 
> mismatch
>  at java.math.BigInteger.readObject(BigInteger.java:4525)
>  at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:613)
>  at java.math.BigDecimal.readObject(BigDecimal.java:3779)
>  at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
>  at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2257)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2290)
>  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2148)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1647)
>  at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2366)
>  at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2290)
>  at 

[jira] [Commented] (CAMEL-14929) camel-aws2-s3 - Doesn't support stream download of large files.

2020-09-22 Thread Anderson Vaz (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-14929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199902#comment-17199902
 ] 

Anderson Vaz commented on CAMEL-14929:
--

Hi [~acosentino], sorry for the huge delay. I just opened the PR 
[4274|https://github.com/apache/camel/pull/4274] with the changes to address 
this issue.

> camel-aws2-s3 - Doesn't support stream download of large files. 
> 
>
> Key: CAMEL-14929
> URL: https://issues.apache.org/jira/browse/CAMEL-14929
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-aws2
>Affects Versions: 3.2.0
>Reporter: Anderson Vaz
>Assignee: Andrea Cosentino
>Priority: Minor
>
> Hi,
> The component `*camel-aws2-s3*` should be able to support streaming 
> consume/download  to allow the copy/download of large files from S3. The 
> current implementation or 'saves' the contents of input stream into the 
> memory or completely disregard it not giving a change for the next components 
> to manipulate the stream. This seems to be a no ideal implementation.
> The issue essentially is on class 
> `*org.apache.camel.component.aws2.s3.AWS2S3Endpoint*` in between lines *169* 
> to *178* and lines *201* to *212*.
> The logic on lines 169 to 178 there is: 
>  * if the parameter `*includeBody*` is *true* it will consume the S3 stream 
> into the memory which is no ideal for large files.
>  * if the parameter `*includeBody*` is *false* it won't consume the S3 stream 
> however the S3 stream will be lost, I couldn't find any other way to access 
> it therefore the S3 is open for nothing on this case. This doesn't seem 
> reasonable as well. I think the S3 stream should be put in the `*body*` raw 
> so the next component in the pipeline can consume it.
> The logic on lines 201 to 212 is:
>  * if the parameter `*includeBody*` is *false* it surprisingly close the S3 
> input stream confirming that there will be no way to consume it afterwards.
>  * if the parameter `*includeBody*` is *true* the S3 input stream will be 
> left open however there is way to access it as it is created on line 77 of 
> `*org.apache.camel.component.aws2.s3.AWS2S3Consumer*` and afterwards if not 
> included in the body it get lost.
> The ideal behaviour I think would be:
>  * if `*includedBody*` is *true* then consume S3 input stream into the 
> memory, save it in the body and close it.
>  * if `*includeBody*` is *false* then put the raw S3 input stream in the body 
> and don't close it.
>  * if `*autoCloseBody*` is *true* then schedule the S3 input stream closing 
> for when exchange is finished.
>  * if `*autoCloseBody*` is *false* then leave to caller to close it which I'm 
> not sure how this can be done in the current implementation.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CAMEL-15567) components - Generate source code for creating endpoint uri via a map of properties

2020-09-22 Thread Claus Ibsen (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-15567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199893#comment-17199893
 ] 

Claus Ibsen commented on CAMEL-15567:
-

See comments on
https://github.com/apache/camel-k-runtime/pull/486

> components - Generate source code for creating endpoint uri via a map of 
> properties
> ---
>
> Key: CAMEL-15567
> URL: https://issues.apache.org/jira/browse/CAMEL-15567
> Project: Camel
>  Issue Type: Improvement
>  Components: tooling
>Reporter: Claus Ibsen
>Priority: Major
> Fix For: 3.6.0
>
>
> Today we have to use camel-catalog to build endpoint uris via a set of 
> properties/map. As the catalog has all the components and its a json file 
> then it requires to load the json and parse it and use the catalog api to 
> generate the endpoint.
> Maybe we could source code generate java code that can generate this for the 
> component that we can embed inside each component JAR like we do for 
> configurers.
> This would also be faster.
> We can then fallback to the catalog json based if no source code was 
> generated (such as 3rd party components).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-15567) components - Generate source code for creating endpoint uri via a map of properties

2020-09-22 Thread Claus Ibsen (Jira)
Claus Ibsen created CAMEL-15567:
---

 Summary: components - Generate source code for creating endpoint 
uri via a map of properties
 Key: CAMEL-15567
 URL: https://issues.apache.org/jira/browse/CAMEL-15567
 Project: Camel
  Issue Type: Improvement
  Components: tooling
Reporter: Claus Ibsen
 Fix For: 3.6.0


Today we have to use camel-catalog to build endpoint uris via a set of 
properties/map. As the catalog has all the components and its a json file then 
it requires to load the json and parse it and use the catalog api to generate 
the endpoint.

Maybe we could source code generate java code that can generate this for the 
component that we can embed inside each component JAR like we do for 
configurers.

This would also be faster.

We can then fallback to the catalog json based if no source code was generated 
(such as 3rd party components).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CAMEL-15566) Create a AWS Cloudtrail component

2020-09-22 Thread Andrea Cosentino (Jira)
Andrea Cosentino created CAMEL-15566:


 Summary: Create a AWS Cloudtrail component
 Key: CAMEL-15566
 URL: https://issues.apache.org/jira/browse/CAMEL-15566
 Project: Camel
  Issue Type: Task
  Components: camel-aws2
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
 Fix For: 3.x






--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CAMEL-14811) Remove JMX Connector configuration

2020-09-22 Thread Colm O hEigeartaigh (Jira)


[ 
https://issues.apache.org/jira/browse/CAMEL-14811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17199845#comment-17199845
 ] 

Colm O hEigeartaigh commented on CAMEL-14811:
-

I agree with [~bedla] . Also, it is not a "fix" but the removal of a feature. 
To be secure just don't use the JMX Connector in earlier releases.

> Remove JMX Connector configuration
> --
>
> Key: CAMEL-14811
> URL: https://issues.apache.org/jira/browse/CAMEL-14811
> Project: Camel
>  Issue Type: Improvement
>Reporter: Colm O hEigeartaigh
>Assignee: Colm O hEigeartaigh
>Priority: Major
> Fix For: 3.2.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> For 3.2.0, we should remove the JMX Connector configuration in 
> camel-management. Creating our own registry is not properly secure and 
> doesn't buy us anything extra over just using the default JVM JMX Settings.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)