Re: [Camel-kafka] KafkaProducer causes camel route to loop infinitely

2015-07-01 Thread Claus Ibsen
Hi

Yeah log a new ticket, then we change the header name to something
else that are not the same header as used in the from - we do the same
in JMS, if people want to send to a destination based on a header.

On Wed, Jun 24, 2015 at 7:51 PM, Rahul Jain rahul...@gmail.com wrote:
 The KafkaProducer class reads the topic name from exchange headers. This
 causes a problem when the route ends with a to endpoint since in this
 case, the exchange still has its header set to the from endpoint's topic.

 See my comments in https://issues.apache.org/jira/browse/CAMEL-7331

 Thanks,
 Rahul



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


Re: [Camel-kafka] KafkaProducer causes camel route to loop infinitely

2015-07-01 Thread Rahul Jain
Thanks. Created a ticket - https://issues.apache.org/jira/browse/CAMEL-8923



On Wed, Jul 1, 2015 at 1:43 PM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Yeah log a new ticket, then we change the header name to something
 else that are not the same header as used in the from - we do the same
 in JMS, if people want to send to a destination based on a header.

 On Wed, Jun 24, 2015 at 7:51 PM, Rahul Jain rahul...@gmail.com wrote:
  The KafkaProducer class reads the topic name from exchange headers. This
  causes a problem when the route ends with a to endpoint since in this
  case, the exchange still has its header set to the from endpoint's
 topic.
 
  See my comments in https://issues.apache.org/jira/browse/CAMEL-7331
 
  Thanks,
  Rahul



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



Re: overriding properties in Camel Enhanced Spring test

2015-07-01 Thread Claus Ibsen
Hi

Not all features are implement or possible to implement. Its likely
that useOverridePropertiesWithPropertiesComponent is added later.

You are welcome to dive into the code and see what is missing and
provide a patch.



On Thu, Jun 25, 2015 at 7:00 AM, Minh Tran darth.minhs...@gmail.com wrote:
 Hi

 I'm struggling to work out how to override any properties in a Camel Enhanced 
 Spring test. The documentation says that it has feature parity with 
 CamelTestSupport but I can't see any ability to do it.

 To be clear, I'd like to do something like overriding the 
 useOverridePropertiesWithPropertiesComponent method in the CamelTestSupport.

 Any ideas? Thanks.






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


Re: Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread Claus Ibsen
I logged a ticket to improve this
https://issues.apache.org/jira/browse/CAMEL-8926

On Wed, Jul 1, 2015 at 8:43 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 Ah its because Camel uses this to find the beans

 MapString, RoutesBuilder beans =
 applicationContext.getBeansOfType(RoutesBuilder.class, true, true);

 And I suspect it causes spring to try to auto wire and create the
 bean. Then thereafter the filtering is done, eg frankly we would need
 to know the class name before we can exclude it.

 On Wed, Jul 1, 2015 at 5:04 PM, furchess123 con...@hotmail.com wrote:
 Hi,
 I am using Camel 2.14.2.  All my RouteBuilder implementations are @Component
 annotated Spring beans, auto-wired with processors, error handlers,
 AggregationStrategy implementation beans, etc. I have been using
 *contextScan* to load these Spring beans into Camel context. However, I have
 one route builder implementation that is a prototype-scoped Spring bean,
 distinct instances of which may have to be created on-demand at runtime. It
 must NOT be component-scanned at startup.

 Per Camel's  reference guide
 http://people.apache.org/~dkulp/camel/spring.html  , I have tried to
 exclude that particular class from being component-scanned by Camel using
 the following:

 camelContext xmlns=http://camel.apache.org/schema/spring;
 contextScan
 *excludes
 com.myco.something.route.MyExcludedRouteBuilder
 /excludes*
 /contextScan
 /camelContext

 *This doesn't work.* Camel doesn't seem to ignore this route builder class
 and tries to instantiate it at startup. I don't provide a no-arg constructor
 for that class (instances are requested from the Spring context on demand
 with a specific from endpoint value) so CamelContextFactoryBean throws the
 following exception:

 ...
 Caused by: org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'MyExcludedRouteBuilder' defined in file
 [.../route/MyExcludedRouteBuilder.class]: Instantiation of bean failed;
 nested exception is org.springframework.beans.BeanInstantiationException:
 Could not instantiate bean class
 [com.myco.something.route.MyExcludedRouteBuilder]: No default constructor
 found; nested exception is java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1095)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
 at
 org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:489)
 at
 org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1060)
 at
 org.apache.camel.spring.ContextScanRouteBuilderFinder.appendBuilders(ContextScanRouteBuilderFinder.java:49)
 at
 org.apache.camel.spring.CamelContextFactoryBean.findRouteBuildersByContextScan(CamelContextFactoryBean.java:233)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.findRouteBuilders(AbstractCamelContextFactoryBean.java:881)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:344)
 at
 org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(*CamelContextFactoryBean.java:326*)
 ... 56 more
 Caused by: org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class [com.myco.something.route.MyExcludedRouteBuilder]: No
 default constructor found; nested exception is
 java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1088)
 ... 68 more
 Caused by: java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at java.lang.Class.getConstructor0(Class.java:2892)
 at java.lang.Class.getDeclaredConstructor(Class.java:2058)
 at
 

Re: Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread Claus Ibsen
Hi

Ah its because Camel uses this to find the beans

MapString, RoutesBuilder beans =
applicationContext.getBeansOfType(RoutesBuilder.class, true, true);

And I suspect it causes spring to try to auto wire and create the
bean. Then thereafter the filtering is done, eg frankly we would need
to know the class name before we can exclude it.

On Wed, Jul 1, 2015 at 5:04 PM, furchess123 con...@hotmail.com wrote:
 Hi,
 I am using Camel 2.14.2.  All my RouteBuilder implementations are @Component
 annotated Spring beans, auto-wired with processors, error handlers,
 AggregationStrategy implementation beans, etc. I have been using
 *contextScan* to load these Spring beans into Camel context. However, I have
 one route builder implementation that is a prototype-scoped Spring bean,
 distinct instances of which may have to be created on-demand at runtime. It
 must NOT be component-scanned at startup.

 Per Camel's  reference guide
 http://people.apache.org/~dkulp/camel/spring.html  , I have tried to
 exclude that particular class from being component-scanned by Camel using
 the following:

 camelContext xmlns=http://camel.apache.org/schema/spring;
 contextScan
 *excludes
 com.myco.something.route.MyExcludedRouteBuilder
 /excludes*
 /contextScan
 /camelContext

 *This doesn't work.* Camel doesn't seem to ignore this route builder class
 and tries to instantiate it at startup. I don't provide a no-arg constructor
 for that class (instances are requested from the Spring context on demand
 with a specific from endpoint value) so CamelContextFactoryBean throws the
 following exception:

 ...
 Caused by: org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'MyExcludedRouteBuilder' defined in file
 [.../route/MyExcludedRouteBuilder.class]: Instantiation of bean failed;
 nested exception is org.springframework.beans.BeanInstantiationException:
 Could not instantiate bean class
 [com.myco.something.route.MyExcludedRouteBuilder]: No default constructor
 found; nested exception is java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1095)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
 at
 org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:489)
 at
 org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1060)
 at
 org.apache.camel.spring.ContextScanRouteBuilderFinder.appendBuilders(ContextScanRouteBuilderFinder.java:49)
 at
 org.apache.camel.spring.CamelContextFactoryBean.findRouteBuildersByContextScan(CamelContextFactoryBean.java:233)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.findRouteBuilders(AbstractCamelContextFactoryBean.java:881)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:344)
 at
 org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(*CamelContextFactoryBean.java:326*)
 ... 56 more
 Caused by: org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class [com.myco.something.route.MyExcludedRouteBuilder]: No
 default constructor found; nested exception is
 java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1088)
 ... 68 more
 Caused by: java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at java.lang.Class.getConstructor0(Class.java:2892)
 at java.lang.Class.getDeclaredConstructor(Class.java:2058)
 at
 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
 ... 69 more


 I cannot find an example of using /excludes/ with /contextScan/, other than
 what I see here:
 

Re: Camel 2.14/Netty: How to add ByteArrayDecoder to ServerChannelPipeline?

2015-07-01 Thread SteveR
Hi Willem:

Actually, I'm currently using Camel 2.14 and Netty 3.x (org.jboss.netty). 
I'm wondering if there is a sensible way to migrate from netty3 to netty4
(i.e. other than just brute-force trying it) and what it would do with
respect to my existing pipeline factory code, etc?

Here's what I currently have in my pom.xml file:

dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
version2.14.0/version
/dependency

dependency
groupIdio.netty/groupId
artifactIdnetty-all/artifactId
version4.0.2.Final/version
scopecompile/scope
/dependency


 Thanks, Steve



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-14-Netty-How-to-add-ByteArrayDecoder-to-ServerChannelPipeline-tp5768638p5768749.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Logging Camel Exchanges in Hexadecimal?

2015-07-01 Thread SteveR
Is there any way to configure Camel to do Exchange logging in hexadecimal,
rather than being rendered in the associated character set?  I have a route
that I configure to use *iso-8859-1* (i.e. Latin-1) via
.*setProperty(Exchange.CHARSET_NAME, iso-8859-1)* and the Exchange logging
displays the message body as iso-8859-1 characters.

So, for example,  I'd like to see something like this:

*[2015-06-30 19:45:58,483] DEBUG [New I/O worker #33] 
Endpoint[udp://devserver-09.dev.s.mission.net:62268] Exchange[Message:
7200a1b2c3d45552659907edc201002a4f512e5063337153373239504b3232454876454d6c356a656151
snip 00]*


... instead of this:

*[2015-06-30 19:45:58,483] DEBUG [New I/O worker #33] 
Endpoint[udp://devserver-09.dev.s.mission.net:62268] Exchange[Message:
^@^@^@^@^@^@r^@¡²��URe99^@^@^YP�^A^@*OQ.Pc3qS729PK22EHvEMl5jeaQxxSIY.1431463279�^B^@c+17926775404
snip ^@^@^@^@^@^@^@^@^@^@^@]*


   Thanks, SteveR








--
View this message in context: 
http://camel.465427.n5.nabble.com/Logging-Camel-Exchanges-in-Hexadecimal-tp5768750.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Sending abort() to a httpclient

2015-07-01 Thread Henrik Brautaset Aronsen
I can control the httpclient connection and socket timeouts by adding query
parameters to the URL delivered in ProcessorDefinition.to(), e.g. 
http://example.com/stuff?httpClient.connectTimeout=1000httpClient.socketTimeout=5000


I'd like to have an hard overall time limit on the request, though.
HttpClient doesn't support that as an argument, but it has an abort() call
that can be used like this:

DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet getMethod = new HttpGet(http://example.com/stuff;);
TimerTask task = new TimerTask() {
@Override
public void run() {
if (getMethod != null) {
getMethod.abort();
}
}
};
new Timer(true).schedule(task, 5000);
HttpResponse response = httpClient.execute(getMethod);

How can I achieve the same in a Camel route?

Cheers,
Henrik


Re: newbie implementation question

2015-07-01 Thread Walzer, Thomas
Hi,

scheduled polling is possible. However I would poll all the time.
For aggregating  sorting I would use a database.

Cheers, Thomas. 

 Am 30.06.2015 um 23:57 schrieb Mills, Gary (GE Energy Management, consultant) 
 gary.mi...@ge.com:
 
 Hello,
 
 Thanks in advance, forgive me as I a learning. I do try to look these things 
 up also, but with user feedback this greatly helps point me in the right 
 direction.
 
 I have 4 files to pick up from FTP.  I need to join these files together to 
 achieve 1 single file.  Each file has a unique header. These Headers need to 
 be aligned. So the aggregation would need to join the files at the end and 
 beginning of each header. The content of the 1 single file I need to sort by 
 2 elements, each row is terminated by new line \n. sort content by a numeric 
 Id value and its timestamp value( field in record ).  I am looking and it 
 appears that camel can accomplish this without much coding. Am I correct or 
 do I need to code this?
 
 I am thinking:
 Import and save the files on the file system. Make sure I have all 4 files. 
 If I don't have all 4 then wait until next poll and hopefully get the 
 remaining files. The files are said to be pretty much guaranteed to come in 
 at specific times. I just want to code for the unexpected event that they are 
 not all present.
 So, add FTP endpoint, add FTP route, poll at 4 pm est, and at 4 am est ( I 
 don't know how to do this or if it can be done in camel ). Then through the 
 route save the files on the file system. Do another route with aggregation 
 strategy that will complete on 4 files and the append of the files will need 
 to start with each header ( I do not know how to do this or if it is possible 
 with camel ).
 Msg 1 header A B C
 1 2 3 ( data )
 1 2 3
 Msg 2 header D E F
 4 5 6
4 5 6
 Msg 3 header G H I
 7 8 9
 7 8 9
 Msg 4 header J K L
10 11 12
10 11 12
 RESULT === A B C D E F G H I J K L
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12
 Then with another route perform a sort on 2 fields, 1 == asset Id and the 2nd 
 a timestamp.
 
 Please offer suggestions or let me know if this is possible with Camel with 
 little coding. Thanks again!!!
 Gary



Re: Sending abort() to a httpclient

2015-07-01 Thread Pontus Ullgren
I guess you could create you own clientConnectionManager (see the option on
the HTTP/HTTP4 component documentation) that returns a decorated HTTP
client that, when execute is called, creates the timer and starts it.
Or do some other more fancy handling to avoid having to start another
thread for each request.

Best regards
Pontus

On Wed, 1 Jul 2015 13:07 Henrik Brautaset Aronsen hen...@synth.no wrote:

 I can control the httpclient connection and socket timeouts by adding query
 parameters to the URL delivered in ProcessorDefinition.to(), e.g. 

 http://example.com/stuff?httpClient.connectTimeout=1000httpClient.socketTimeout=5000
 

 I'd like to have an hard overall time limit on the request, though.
 HttpClient doesn't support that as an argument, but it has an abort() call
 that can be used like this:

 DefaultHttpClient httpClient = new DefaultHttpClient();
 HttpGet getMethod = new HttpGet(http://example.com/stuff;);
 TimerTask task = new TimerTask() {
 @Override
 public void run() {
 if (getMethod != null) {
 getMethod.abort();
 }
 }
 };
 new Timer(true).schedule(task, 5000);
 HttpResponse response = httpClient.execute(getMethod);

 How can I achieve the same in a Camel route?

 Cheers,
 Henrik



Re: Logging Camel Exchanges in Hexadecimal?

2015-07-01 Thread Claus Ibsen
Hi

No its doing a toString.

On Wed, Jul 1, 2015 at 3:58 PM, SteveR srichard...@vonage.com wrote:
 Is there any way to configure Camel to do Exchange logging in hexadecimal,
 rather than being rendered in the associated character set?  I have a route
 that I configure to use *iso-8859-1* (i.e. Latin-1) via
 .*setProperty(Exchange.CHARSET_NAME, iso-8859-1)* and the Exchange logging
 displays the message body as iso-8859-1 characters.

 So, for example,  I'd like to see something like this:

 *[2015-06-30 19:45:58,483] DEBUG [New I/O worker #33] 
 Endpoint[udp://devserver-09.dev.s.mission.net:62268] Exchange[Message:
 7200a1b2c3d45552659907edc201002a4f512e5063337153373239504b3232454876454d6c356a656151
 snip 00]*


 ... instead of this:

 *[2015-06-30 19:45:58,483] DEBUG [New I/O worker #33] 
 Endpoint[udp://devserver-09.dev.s.mission.net:62268] Exchange[Message:
 ^@^@^@^@^@^@r^@¡²��URe99^@^@^YP�^A^@*OQ.Pc3qS729PK22EHvEMl5jeaQxxSIY.1431463279�^B^@c+17926775404
 snip ^@^@^@^@^@^@^@^@^@^@^@]*


Thanks, SteveR








 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Logging-Camel-Exchanges-in-Hexadecimal-tp5768750.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Apache Camel RouteBuilder in Spring doesn't launch configure()

2015-07-01 Thread alexis.jacquemart
I'm working with Apache Camel to create route between dynamic endpoints. I
was working with a Main which works but now I need to deploy the application
on an Apache Tomcat server. The problem his that my camel-context doesn't
found my route builder. Here is my applicationContext : 

/bean id=myRoute class=com.ittb.boa.jis.extractor.MyRouteBuilder
constructor-arg name=src ref=logsFileConnector /
constructor-arg name=dest ref=elasticSearchConnector /
/bean

camelContext id=myCamel
xmlns=http://camel.apache.org/schema/spring;
routeBuilder ref=myRoute /
/camelContext/

And I'm getting the following error : 

/[ localhost-startStop-1] ContextLoader 
ERROR Context initialization failed
org.apache.camel.RuntimeCamelException: org.apache.camel.CamelException:
Cannot find any routes with this RouteBuilder reference:
RouteBuilderRef[myRoute]
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)[camel-core-2.15.2.jar:2.15.2]
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:328)[camel-spring-2.15.2.jar:2.15.2]
at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)[catalina.jar:8.0.21]
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)[catalina.jar:8.0.21]
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)[catalina.jar:8.0.21]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)[catalina.jar:8.0.21]
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)[catalina.jar:8.0.21]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_45]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_45]
juil. 01, 2015 2:55:15 PM org.apache.catalina.core.StandardContext
listenerStart
GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé
(context initialized) à l'instance de classe d'écoute (listener)
org.springframework.web.context.ContextLoaderListener
org.apache.camel.RuntimeCamelException: org.apache.camel.CamelException:
Cannot find any routes with this RouteBuilder reference:
RouteBuilderRef[myRoute]
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:328)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

Re: Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread Claus Ibsen
Hi

Try without line breaks in that excludes so there is no line breaks
/ spaces etc.

On Wed, Jul 1, 2015 at 5:04 PM, furchess123 con...@hotmail.com wrote:
 Hi,
 I am using Camel 2.14.2.  All my RouteBuilder implementations are @Component
 annotated Spring beans, auto-wired with processors, error handlers,
 AggregationStrategy implementation beans, etc. I have been using
 *contextScan* to load these Spring beans into Camel context. However, I have
 one route builder implementation that is a prototype-scoped Spring bean,
 distinct instances of which may have to be created on-demand at runtime. It
 must NOT be component-scanned at startup.

 Per Camel's  reference guide
 http://people.apache.org/~dkulp/camel/spring.html  , I have tried to
 exclude that particular class from being component-scanned by Camel using
 the following:

 camelContext xmlns=http://camel.apache.org/schema/spring;
 contextScan
 *excludes
 com.myco.something.route.MyExcludedRouteBuilder
 /excludes*
 /contextScan
 /camelContext

 *This doesn't work.* Camel doesn't seem to ignore this route builder class
 and tries to instantiate it at startup. I don't provide a no-arg constructor
 for that class (instances are requested from the Spring context on demand
 with a specific from endpoint value) so CamelContextFactoryBean throws the
 following exception:

 ...
 Caused by: org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name 'MyExcludedRouteBuilder' defined in file
 [.../route/MyExcludedRouteBuilder.class]: Instantiation of bean failed;
 nested exception is org.springframework.beans.BeanInstantiationException:
 Could not instantiate bean class
 [com.myco.something.route.MyExcludedRouteBuilder]: No default constructor
 found; nested exception is java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1095)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
 at
 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
 at
 org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:489)
 at
 org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1060)
 at
 org.apache.camel.spring.ContextScanRouteBuilderFinder.appendBuilders(ContextScanRouteBuilderFinder.java:49)
 at
 org.apache.camel.spring.CamelContextFactoryBean.findRouteBuildersByContextScan(CamelContextFactoryBean.java:233)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.findRouteBuilders(AbstractCamelContextFactoryBean.java:881)
 at
 org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:344)
 at
 org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(*CamelContextFactoryBean.java:326*)
 ... 56 more
 Caused by: org.springframework.beans.BeanInstantiationException: Could not
 instantiate bean class [com.myco.something.route.MyExcludedRouteBuilder]: No
 default constructor found; nested exception is
 java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at
 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
 at
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1088)
 ... 68 more
 Caused by: java.lang.NoSuchMethodException:
 com.myco.something.route.MyExcludedRouteBuilder.init()
 at java.lang.Class.getConstructor0(Class.java:2892)
 at java.lang.Class.getDeclaredConstructor(Class.java:2058)
 at
 org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
 ... 69 more


 I cannot find an example of using /excludes/ with /contextScan/, other than
 what I see here:
 http://camel.apache.org/spring.html

 It states that I can use the same ANT-style patterns to exclude/include
 classes as with /packageScan/. I have tried wild cards as well as
 specifying the full class name explicitly (as shown in the example above.)
 Nothing 

RE: newbie implementation question

2015-07-01 Thread Mills, Gary (GE Energy Management, consultant)
Thank you Claus, greatly appreciated. 
Have a great day!

-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Wednesday, July 01, 2015 10:39 AM
To: users@camel.apache.org
Subject: Re: newbie implementation question

Hi

Yeah split into 2 or more parts. The ftp that downloads those needed files into 
some directory.

And then another route that only pickup the files when you have all 4.
As the aggregation is a bit complicated you may just write some java code that 
puts the data correct in the right order.


On Wed, Jul 1, 2015 at 12:12 PM, Walzer, Thomas thomas.wal...@integratix.net 
wrote:
 Hi,

 scheduled polling is possible. However I would poll all the time.
 For aggregating  sorting I would use a database.

 Cheers, Thomas.

 Am 30.06.2015 um 23:57 schrieb Mills, Gary (GE Energy Management, 
 consultant) gary.mi...@ge.com:

 Hello,

 Thanks in advance, forgive me as I a learning. I do try to look these things 
 up also, but with user feedback this greatly helps point me in the right 
 direction.

 I have 4 files to pick up from FTP.  I need to join these files together to 
 achieve 1 single file.  Each file has a unique header. These Headers need to 
 be aligned. So the aggregation would need to join the files at the end and 
 beginning of each header. The content of the 1 single file I need to sort by 
 2 elements, each row is terminated by new line \n. sort content by a numeric 
 Id value and its timestamp value( field in record ).  I am looking and it 
 appears that camel can accomplish this without much coding. Am I correct or 
 do I need to code this?

 I am thinking:
 Import and save the files on the file system. Make sure I have all 4 files. 
 If I don't have all 4 then wait until next poll and hopefully get the 
 remaining files. The files are said to be pretty much guaranteed to come in 
 at specific times. I just want to code for the unexpected event that they 
 are not all present.
 So, add FTP endpoint, add FTP route, poll at 4 pm est, and at 4 am est ( I 
 don't know how to do this or if it can be done in camel ). Then through the 
 route save the files on the file system. Do another route with aggregation 
 strategy that will complete on 4 files and the append of the files will need 
 to start with each header ( I do not know how to do this or if it is 
 possible with camel ).
 Msg 1 header A B C
 1 2 3 ( data )
 1 2 3
 Msg 2 header D E F
 4 5 6
4 5 6
 Msg 3 header G H I
 7 8 9
 7 8 9
 Msg 4 header J K L
10 11 12
10 11 12
 RESULT === A B C D E F G H I J K L
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 
 11 12 Then with another route perform a sort on 2 fields, 1 == asset Id and 
 the 2nd a timestamp.

 Please offer suggestions or let me know if this is possible with Camel with 
 little coding. Thanks again!!!
 Gary




--
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__davsclaus.comd=AwIFaQc=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSIr=Hb1nXb7biSqY9NYScX39HfYaeuqILlgaLYiYNWt8oJom=68DXTF-6uUXEf-PFubobEy472ONuuSKOKEqmOyy_d-Qs=2iWsGi_a3CmTJIKKDRTqup6gI8WA133Fz65kKFwzK6Ie=
Author of Camel in Action: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.manning.com_ibsend=AwIFaQc=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSIr=Hb1nXb7biSqY9NYScX39HfYaeuqILlgaLYiYNWt8oJom=68DXTF-6uUXEf-PFubobEy472ONuuSKOKEqmOyy_d-Qs=aEI9b0cgifVIZ2hB3dpiCxMiZcz6l6l7UzdPPaCLC-oe=
hawtio: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__hawt.io_d=AwIFaQc=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSIr=Hb1nXb7biSqY9NYScX39HfYaeuqILlgaLYiYNWt8oJom=68DXTF-6uUXEf-PFubobEy472ONuuSKOKEqmOyy_d-Qs=I1Q-xc5pY_xx-3IB8JrWcYepKSvN0Tbz_RLPae64GEQe=
fabric8: 
https://urldefense.proofpoint.com/v2/url?u=http-3A__fabric8.io_d=AwIFaQc=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSIr=Hb1nXb7biSqY9NYScX39HfYaeuqILlgaLYiYNWt8oJom=68DXTF-6uUXEf-PFubobEy472ONuuSKOKEqmOyy_d-Qs=fOhkAFIEV_u5H9SfLWQlpkCfkSWp1WwaymqanqI5vdYe=
 


Re: Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread furchess123
Claus, thank you for your response. Removing spaces didn't help (and,
frankly, I'd be surprised if it did.) I did the following:

camelContext xmlns=http://camel.apache.org/schema/spring; 
 contextScan 

excludescom.myco.something.route.MyExcludedRouteBuilder/excludes 
 /contextScan 
 /camelContext 

Same error.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Excluding-prototype-scoped-Component-route-builder-from-contextScan-tp5768755p5768770.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: newbie implementation question

2015-07-01 Thread Claus Ibsen
Hi

Yeah split into 2 or more parts. The ftp that downloads those needed
files into some directory.

And then another route that only pickup the files when you have all 4.
As the aggregation is a bit complicated you may just write some java
code that puts the data correct in the right order.


On Wed, Jul 1, 2015 at 12:12 PM, Walzer, Thomas
thomas.wal...@integratix.net wrote:
 Hi,

 scheduled polling is possible. However I would poll all the time.
 For aggregating  sorting I would use a database.

 Cheers, Thomas.

 Am 30.06.2015 um 23:57 schrieb Mills, Gary (GE Energy Management, 
 consultant) gary.mi...@ge.com:

 Hello,

 Thanks in advance, forgive me as I a learning. I do try to look these things 
 up also, but with user feedback this greatly helps point me in the right 
 direction.

 I have 4 files to pick up from FTP.  I need to join these files together to 
 achieve 1 single file.  Each file has a unique header. These Headers need to 
 be aligned. So the aggregation would need to join the files at the end and 
 beginning of each header. The content of the 1 single file I need to sort by 
 2 elements, each row is terminated by new line \n. sort content by a numeric 
 Id value and its timestamp value( field in record ).  I am looking and it 
 appears that camel can accomplish this without much coding. Am I correct or 
 do I need to code this?

 I am thinking:
 Import and save the files on the file system. Make sure I have all 4 files. 
 If I don't have all 4 then wait until next poll and hopefully get the 
 remaining files. The files are said to be pretty much guaranteed to come in 
 at specific times. I just want to code for the unexpected event that they 
 are not all present.
 So, add FTP endpoint, add FTP route, poll at 4 pm est, and at 4 am est ( I 
 don't know how to do this or if it can be done in camel ). Then through the 
 route save the files on the file system. Do another route with aggregation 
 strategy that will complete on 4 files and the append of the files will need 
 to start with each header ( I do not know how to do this or if it is 
 possible with camel ).
 Msg 1 header A B C
 1 2 3 ( data )
 1 2 3
 Msg 2 header D E F
 4 5 6
4 5 6
 Msg 3 header G H I
 7 8 9
 7 8 9
 Msg 4 header J K L
10 11 12
10 11 12
 RESULT === A B C D E F G H I J K L
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11 12
 Then with another route perform a sort on 2 fields, 1 == asset Id and the 
 2nd a timestamp.

 Please offer suggestions or let me know if this is possible with Camel with 
 little coding. Thanks again!!!
 Gary




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


Re: How add custom Read Lock Strategy

2015-07-01 Thread Claus Ibsen
Hi

In short impl your own strategy and configure the file endpoint to use it.
Maybe check the source code, or unit tests how it can be done / or
javadoc api etc.

On Wed, Jul 1, 2015 at 4:16 PM, Максим Козлов dreamx@gmail.com wrote:
 Hi,

 We need to make our strategy Changed, but nowhere can not find a suitable
 algorithm create your own strategies Camel.
 What is the procedure when creating your GenericFileProcessStrategy?

 Thank you!

 --
 Best regards Max Kozlov aka dream-x
 jabber: drea...@jabber.org
 e-mail: dreamx@gmail.com
 skype: dreamx.max



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


Re: Apache Camel RouteBuilder in Spring doesn't launch configure()

2015-07-01 Thread Claus Ibsen
Hi

Try with a default no-arg constructor in your route class so it has no
other dependency and see if it can be found then. If so then its maybe
a problem with those 2 args you specify as dependency.



On Wed, Jul 1, 2015 at 4:53 PM, alexis.jacquemart aceso...@hotmail.fr wrote:
 I'm working with Apache Camel to create route between dynamic endpoints. I
 was working with a Main which works but now I need to deploy the application
 on an Apache Tomcat server. The problem his that my camel-context doesn't
 found my route builder. Here is my applicationContext :

 /bean id=myRoute class=com.ittb.boa.jis.extractor.MyRouteBuilder
 constructor-arg name=src ref=logsFileConnector /
 constructor-arg name=dest ref=elasticSearchConnector /
 /bean

 camelContext id=myCamel
 xmlns=http://camel.apache.org/schema/spring;
 routeBuilder ref=myRoute /
 /camelContext/

 And I'm getting the following error :

 /[ localhost-startStop-1] ContextLoader
 ERROR Context initialization failed
 org.apache.camel.RuntimeCamelException: org.apache.camel.CamelException:
 Cannot find any routes with this RouteBuilder reference:
 RouteBuilderRef[myRoute]
 at
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)[camel-core-2.15.2.jar:2.15.2]
 at
 org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:328)[camel-spring-2.15.2.jar:2.15.2]
 at
 org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)[spring-web-4.1.6.RELEASE.jar:4.1.6.RELEASE]
 at
 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)[catalina.jar:8.0.21]
 at
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5166)[catalina.jar:8.0.21]
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)[catalina.jar:8.0.21]
 at
 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)[catalina.jar:8.0.21]
 at
 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)[catalina.jar:8.0.21]
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45]
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_45]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_45]
 at java.lang.Thread.run(Thread.java:745)[:1.8.0_45]
 juil. 01, 2015 2:55:15 PM org.apache.catalina.core.StandardContext
 listenerStart
 GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé
 (context initialized) à l'instance de classe d'écoute (listener)
 org.springframework.web.context.ContextLoaderListener
 org.apache.camel.RuntimeCamelException: org.apache.camel.CamelException:
 Cannot find any routes with this RouteBuilder reference:
 RouteBuilderRef[myRoute]
 at
 org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1619)
 at
 org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:328)
 at
 org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
 at
 org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
 at
 org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
 at
 org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
 at
 

How add custom Read Lock Strategy

2015-07-01 Thread Максим Козлов
Hi,

We need to make our strategy Changed, but nowhere can not find a suitable
algorithm create your own strategies Camel.
What is the procedure when creating your GenericFileProcessStrategy?

Thank you!

-- 
Best regards Max Kozlov aka dream-x
jabber: drea...@jabber.org
e-mail: dreamx@gmail.com
skype: dreamx.max


Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread furchess123
Hi,
I am using Camel 2.14.2.  All my RouteBuilder implementations are @Component
annotated Spring beans, auto-wired with processors, error handlers,
AggregationStrategy implementation beans, etc. I have been using
*contextScan* to load these Spring beans into Camel context. However, I have
one route builder implementation that is a prototype-scoped Spring bean,
distinct instances of which may have to be created on-demand at runtime. It
must NOT be component-scanned at startup.

Per Camel's  reference guide
http://people.apache.org/~dkulp/camel/spring.html  , I have tried to
exclude that particular class from being component-scanned by Camel using
the following:

camelContext xmlns=http://camel.apache.org/schema/spring;
contextScan
*excludes
com.myco.something.route.MyExcludedRouteBuilder
/excludes*
/contextScan
/camelContext

*This doesn't work.* Camel doesn't seem to ignore this route builder class
and tries to instantiate it at startup. I don't provide a no-arg constructor
for that class (instances are requested from the Spring context on demand
with a specific from endpoint value) so CamelContextFactoryBean throws the
following exception:

...
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'MyExcludedRouteBuilder' defined in file
[.../route/MyExcludedRouteBuilder.class]: Instantiation of bean failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class
[com.myco.something.route.MyExcludedRouteBuilder]: No default constructor
found; nested exception is java.lang.NoSuchMethodException:
com.myco.something.route.MyExcludedRouteBuilder.init()
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1095)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:489)
at
org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1060)
at
org.apache.camel.spring.ContextScanRouteBuilderFinder.appendBuilders(ContextScanRouteBuilderFinder.java:49)
at
org.apache.camel.spring.CamelContextFactoryBean.findRouteBuildersByContextScan(CamelContextFactoryBean.java:233)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.findRouteBuilders(AbstractCamelContextFactoryBean.java:881)
at
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:344)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(*CamelContextFactoryBean.java:326*)
... 56 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [com.myco.something.route.MyExcludedRouteBuilder]: No
default constructor found; nested exception is
java.lang.NoSuchMethodException:
com.myco.something.route.MyExcludedRouteBuilder.init()
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1088)
... 68 more
Caused by: java.lang.NoSuchMethodException:
com.myco.something.route.MyExcludedRouteBuilder.init()
at java.lang.Class.getConstructor0(Class.java:2892)
at java.lang.Class.getDeclaredConstructor(Class.java:2058)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 69 more


I cannot find an example of using /excludes/ with /contextScan/, other than
what I see here: 
http://camel.apache.org/spring.html

It states that I can use the same ANT-style patterns to exclude/include
classes as with /packageScan/. I have tried wild cards as well as
specifying the full class name explicitly (as shown in the example above.)
Nothing excludes the class during Camel's context scanning. Why? Am I doing
it incorrectly?  Or is it a bug?

Thanks for any help!



--
View this message in context: 

Re: Camel 2.14/Netty: How to add ByteArrayDecoder to ServerChannelPipeline?

2015-07-01 Thread Willem.Jiang
There are quit different change between the Netty3.x and Netty4.x.
That is why we create a new camel component camel-netty4[1] for it.

So I think you can just need to change the camel-netty to camel-netty4 and
use the scheme netty4 in your camel route.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-14-Netty-How-to-add-ByteArrayDecoder-to-ServerChannelPipeline-tp5768638p5768761.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Excluding prototype-scoped @Component route builder from contextScan?

2015-07-01 Thread furchess123
OK, thanks for looking into this. In the meantime, I suppose I'd have to
remove @Component annotation from my route builders, define them in the
Spring XML file and then define the routeBuilders with the references to
them. That's inconsistent with the rest of my Spring components, but that
certainly solves the problem. 

If I am not mistaken, today Camel's /packageScan/ always instantiates any
RouteBuilder instances it finds in the specified packages, including those
annotated as Spring components. This results in such route builders
instantiated twice, which is wrong and should not be happening. Wouldn't it
be reasonable for Camel to recognize Spring-managed RouteBuilder
implementations and simply load those already instantiated by Spring
instances into Camel context - without trying to create an instance? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Excluding-prototype-scoped-Component-route-builder-from-contextScan-tp5768755p5768788.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel activemq consumer

2015-07-01 Thread Stephan Burkard
Hi

Check out Polling Consumer: http://camel.apache.org/polling-consumer.html

Regards
Stephan



On Mon, Jun 29, 2015 at 5:40 AM, rbkumar88 rbkuma...@gmail.com wrote:

 Hi,

 Is there anyway to have a camel activemq consumer to consume only one
 message at a time.
 PFB the scenario.

 I have a quartz scheduler which runs every 10 minutes and checks for a
 condition, if the condition is satisfied, pull only one message from queue
 else do nothing.

 Regards
 Bharath.



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-activemq-consumer-tp5768640.html
 Sent from the Camel - Users mailing list archive at Nabble.com.