Re: migration to Camel 3.7

2021-01-26 Thread Иванов Григорий Олегович
Seems like a bug

Here is a full dependencyManagement and dependencies parts of pom.xml made 
according to https://camel.apache.org/camel-spring-boot/latest/index.html




   
  
  
 org.apache.camel.springboot
 camel-spring-boot-bom
 ${camel-version}
 pom
 import
  
  
   




   
   
  org.apache.camel.springboot
  camel-spring-boot-starter
   
   

   
  org.apache.camel.springboot
  camel-activemq-starter
   




The main method looks like


@SpringBootApplication
@ImportResource("classpath:camel.xml")
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}



Logs, where I have camel got started twice with 2 routes and 0 routes 
respectively


2021-01-26 20:23:00.242  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.7.1 (camel) is 
starting
2021-01-26 20:23:00.244  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : StreamCaching is not in use. If 
using streams then it's recommended to enable stream caching. See more details 
at http://camel.apache.org/stream-caching.html
2021-01-26 20:23:00.272  INFO 27189 --- [   main] 
c.s.b.CamelSpringBootApplicationListener : Starting CamelMainRunController to 
ensure the main thread keeps running
2021-01-26 20:23:00.275  INFO 27189 --- [   main] 
o.a.c.i.e.InternalRouteStartupManager: Route: my.route started and 
consuming from: file:///home/camel/in
2021-01-26 20:23:00.276  INFO 27189 --- [   main] 
o.a.c.i.e.InternalRouteStartupManager: Route: another.route started and 
consuming from: direct://routing
2021-01-26 20:23:00.279  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Total 2 routes, of which 2 are 
started
2021-01-26 20:23:00.280  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.7.1 (camel) started 
in 38ms
2021-01-26 20:23:00.292  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.7.1 (camel) is 
starting
2021-01-26 20:23:00.293  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : StreamCaching is not in use. If 
using streams then it's recommended to enable stream caching. See more details 
at http://camel.apache.org/stream-caching.html
2021-01-26 20:23:00.293  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Total 0 routes, of which 0 are 
started
2021-01-26 20:23:00.293  INFO 27189 --- [   main] 
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.7.1 (camel) started 
in 1ms
2021-01-26 20:23:00.300  INFO 27189 --- [   main] as2.MyApplication 
   : Started MyApplication in 4.558 seconds (JVM running for 
5.694)


The problem disappears if I remove ImportResource annotation, but how one could 
set onException or InterceptFrom blocks in this case?
____
От: Иванов Григорий Олегович 
Отправлено: 26 января 2021 г. 17:28:58
Кому: users@camel.apache.org
Тема: Re: migration to Camel 3.7


I figured out it is related to having camelContext described in camel.xml along 
with another beans and for example camel-activemq-starter dependency in pom.xml

The one way to eliminate camelContext reloading is to drop camelContext 
description at all, xml routes then could be placed in classpath directory to 
be load. But I have interceptFrom, onException and others described in my 
camelContext bean, where should I move it now?

Or, I noticed using the camel-activemq from org.apache.camel instead of 
camel-activemq-starter from org.apache.camel.springboot also helps, would it be 
correct?

Please, help

____
От: Иванов Григорий Олегович 
Отправлено: 23 декабря 2020 г. 15:03:34
Кому: users@camel.apache.org
Тема: migration to Camel 3.7


Hi,

I have an issue when migrated from 3.5 to 3.7 Camel

According to logs there are 4 additional empty (0 routes) camel contexts being 
started (camel-1  to camel-4)

Please tell if it is a feature and if so what is its purpose? Should I care 
about these contexts or somehow treat them?

Camel 3.7.0, Spring Boot 2.4.1

Here is the logs, thanks in advance!


14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Total 51 
routes, of which 51 are started
14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 3s362ms
14:46:01.193 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.194 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.195 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-1 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.215 [main   

Re: migration to Camel 3.7

2021-01-26 Thread Иванов Григорий Олегович

I figured out it is related to having camelContext described in camel.xml along 
with another beans and for example camel-activemq-starter dependency in pom.xml

The one way to eliminate camelContext reloading is to drop camelContext 
description at all, xml routes then could be placed in classpath directory to 
be load. But I have interceptFrom, onException and others described in my 
camelContext bean, where should I move it now?

Or, I noticed using the camel-activemq from org.apache.camel instead of 
camel-activemq-starter from org.apache.camel.springboot also helps, would it be 
correct?

Please, help


От: Иванов Григорий Олегович 
Отправлено: 23 декабря 2020 г. 15:03:34
Кому: users@camel.apache.org
Тема: migration to Camel 3.7


Hi,

I have an issue when migrated from 3.5 to 3.7 Camel

According to logs there are 4 additional empty (0 routes) camel contexts being 
started (camel-1  to camel-4)

Please tell if it is a feature and if so what is its purpose? Should I care 
about these contexts or somehow treat them?

Camel 3.7.0, Spring Boot 2.4.1

Here is the logs, thanks in advance!


14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Total 51 
routes, of which 51 are started
14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 3s362ms
14:46:01.193 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.194 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.195 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-1 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.215 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.221 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.223 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 29ms
14:46:01.236 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.236 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.236 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-2 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.262 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.280 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.283 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 47ms
14:46:01.294 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.295 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.298 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-3 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.347 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.356 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.356 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 61ms
14:46:01.396 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.398 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.399 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-4 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.451 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.463 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.463 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 64ms
14:46:01.474 [main   ] INFO  phere.sample.CamelApplication - Started 
CamelApplication in 13.587 seconds (JVM running for 16.829)



migration to Camel 3.7

2020-12-23 Thread Иванов Григорий Олегович

Hi,

I have an issue when migrated from 3.5 to 3.7 Camel

According to logs there are 4 additional empty (0 routes) camel contexts being 
started (camel-1  to camel-4)

Please tell if it is a feature and if so what is its purpose? Should I care 
about these contexts or somehow treat them?

Camel 3.7.0, Spring Boot 2.4.1

Here is the logs, thanks in advance!


14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Total 51 
routes, of which 51 are started
14:46:01.152 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 3s362ms
14:46:01.193 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.194 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.195 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-1 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.215 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.221 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.223 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 29ms
14:46:01.236 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.236 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.236 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-2 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.262 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.280 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.283 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 47ms
14:46:01.294 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.295 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.298 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-3 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.347 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.356 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.356 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 61ms
14:46:01.396 [main   ] INFO  nagement.JmxManagementStrategy - JMX is 
enabled
14:46:01.398 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) is starting
14:46:01.399 [main   ] WARN  JmxManagementLifecycleStrategy - This 
CamelContext(camel) will be registered using the name: camel-4 due to clash 
with an existing name already registered in MBeanServer.
14:46:01.451 [main   ] INFO  pl.engine.AbstractCamelContext - 
StreamCaching is not in use. If using streams then it's recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
14:46:01.463 [main   ] INFO  pl.engine.AbstractCamelContext - Total 0 
routes, of which 0 are started
14:46:01.463 [main   ] INFO  pl.engine.AbstractCamelContext - Apache 
Camel 3.7.0 (camel) started in 64ms
14:46:01.474 [main   ] INFO  phere.sample.CamelApplication - Started 
CamelApplication in 13.587 seconds (JVM running for 16.829)



Re: groovy scripts in IntelliJ IDEA

2020-12-02 Thread Иванов Григорий Олегович
If someone are interested, it could be done via using Idea's Dynamic Properties 
- https://confluence.jetbrains.com/display/GRVY/Dynamic+Methods+and+Properties


От: Иванов Григорий Олегович 
Отправлено: 11 ноября 2020 г. 19:11:12
Кому: users@camel.apache.org
Тема: groovy scripts in IntelliJ IDEA


Hi,

I have a question about using an external groovy script in camel route -  
https://camel.apache.org/components/latest/languages/groovy-language.html#_loading_script_from_external_resource

Say I want do something like


request.getHeader("foo").collectEntries { k, v ->
[k, v ?: "default"]
}


Now I have my IDE complains about the request object, it says "Cannot resolve 
symbol request"

Is there a way to fix it except to suppress the warning?

Thanks


groovy scripts in IntelliJ IDEA

2020-11-11 Thread Иванов Григорий Олегович

Hi,

I have a question about using an external groovy script in camel route -  
https://camel.apache.org/components/latest/languages/groovy-language.html#_loading_script_from_external_resource

Say I want do something like


request.getHeader("foo").collectEntries { k, v ->
[k, v ?: "default"]
}


Now I have my IDE complains about the request object, it says "Cannot resolve 
symbol request"

Is there a way to fix it except to suppress the warning?

Thanks