Camel-CXF issue with Log4J

2017-03-24 Thread Goyal, Arpit
Hi Colleagues,

We are facing the same issue as reported in 
https://issues.apache.org/jira/browse/LOG4J2-1298 when using Camel-CXF (2.16 
version) / CXF (cxf-core 3.0.10).

Has anyone faced similar issue? Do we need to upgrade Apache CXF version?

Regards,
Arpit.


Re: why need the jars but i don't use the component?

2017-03-24 Thread Willem Jiang
It looks like you don't put some third party jars in your class path which
are used by the camel components.
If you don't need those camel components, you don't need to include the
components jars when you start up the camel context.


Willem Jiang

Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com  (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem

On Fri, Mar 24, 2017 at 9:21 AM, vonezzz <34618...@qq.com> wrote:

> 2017-03-24 08:57:10.011 WARN
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
> loadConverterMethods - Ignoring converter type:
> org.apache.camel.component.xmlrpc.converter.XmlRpcConverter as a dependent
> class could not be found: java.lang.NoClassDefFoundError:
> org/apache/xmlrpc/XmlRpcRequest java.lang.NoClassDefFoundError:
> org/apache/xmlrpc/XmlRpcRequest
> at java.lang.Class.getDeclaredMethods0(Native Method)
> ~[?:1.8.0_121]
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
> ~[?:1.8.0_121]
> at java.lang.Class.getDeclaredMethods(Class.java:1975)
> ~[?:1.8.0_121]
> at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.
> loadConverterMethods(AnnotationTypeConverterLoader.java:262)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(
> AnnotationTypeConverterLoader.java:130)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.
> loadTypeConverters(BaseTypeConverterRegistry.java:602)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.converter.DefaultTypeConverter.doStart(
> DefaultTypeConverter.java:53)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.support.ServiceSupport.start(
> ServiceSupport.java:61)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.util.ServiceHelper.startService(
> ServiceHelper.java:75)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doAddService(
> DefaultCamelContext.java:1283)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.addService(
> DefaultCamelContext.java:1243)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.getTypeConverter(
> DefaultCamelContext.java:2369)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(
> DefaultCamelContext.java:2392)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(
> DefaultCamelContext.java:3745)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(
> DefaultCamelContext.java:3086)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.access$
> 000(DefaultCamelContext.java:182)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext$2.call(
> DefaultCamelContext.java:2957)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext$2.call(
> DefaultCamelContext.java:2953)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(
> DefaultCamelContext.java:2976)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(
> DefaultCamelContext.java:2953)
> [camel-core-2.18.1.jar:2.18.1]
> at org.apache.camel.support.ServiceSupport.start(
> ServiceSupport.java:61)
> [camel-core-2.18.1.jar:2.18.1]
> at
> org.apache.camel.impl.DefaultCamelContext.start(
> DefaultCamelContext.java:2920)
> [camel-core-2.18.1.jar:2.18.1]
> at com.rr.mep.test.CamelTest.main(CamelTest.java:77) [classes/:?]
> Caused by: java.lang.ClassNotFoundException: org.apache.xmlrpc.
> XmlRpcRequest
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> ~[?:1.8.0_121]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> ~[?:1.8.0_121]
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> ~[?:1.8.0_121]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ~[?:1.8.0_121]
> ... 23 more
>
> 2017-03-24 08:57:10.012 WARN
> org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
> loadConverterMethods - Ignoring converter type:
> org.apache.camel.component.netty.NettyConverter as a dependent class could
> not be found: java.lang.NoClassDefFoundError:
> org/jboss/netty/buffer/ChannelBufferInputStream
> java.lang.NoClassDefFoundError:
> org/jboss/netty/buffer/ChannelBufferInputStream
> at java.lang.Class.getDeclaredMethods0(Native Method)
> ~[?:1.8.0_121]
> at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
> ~[?:1.8.0_121]
> at java.lang.Class.getDeclaredMethods(Class.java:1975)
> ~[?:1.8.0_121]
> at
> 

onException not getting called - only newly added onException does

2017-03-24 Thread bocamel
In my app, I need to inject some new routes.  I do this by running a groovy
script as a Camel processor that adds new routes to the existing context
(exchange.context.addRoutes(new RouteBuilder(){...})).  Everything works
fine except that the existing context-level onException's, that were added
before the new routes, do not catch the exceptions generated by the new
routes.  But if I repeat those onException's again (at context-level) in the
groovy script along with the new routes, then they would catch the
exceptions.  I would rather not duplicate the onException's.

Any insight would be greatly appreciated.





--
View this message in context: 
http://camel.465427.n5.nabble.com/onException-not-getting-called-only-newly-added-onException-does-tp5796106.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Best way to poll a database and process in chunks

2017-03-24 Thread dvlato
Hello,
I have just started working with Camel and I have what I believe is a pretty
common requirement:  poll the database to fetch all the records with a
certain status, and process them in chunks (let's 10 rows at a time). I
though I could leverage the existing components to do this easily but I am
not finding the correct way:

What I have tried so far is to usa the JPA component (as we already have JPA
entities in place) to poll the database and use the @Consumed annotation to
change the status of the record (some pointers about how to deal with
transactionality are also most welcome).  The problem with this approach is:
1) Here the rows are received one by one, and we can later merge them with
an aggregator, which seems suboptimal.
2)  Even if we ignored the performance problem with that approach, I'm not
sure of how to configure the aggregator to have fixed size blocks but taking
into account the whole size of the batch (I mean, if after chunking we only
have 5 rows in a message, just return that instead of waiting for the 10th -
maybe it works like that by default - I don't really know).

I've seen that there is a class called  "JpaPollingConsumer" which returns
all the rows instead of one by one, but I don't know if there is anyway to
use it with a "from()" clause, it seems that Camel calls "createConsumer"
and not "createPollingConsumer", right? Is there a way to use
from("jpa://...") and have Camel use the polling consumer?  I have tried
using pollEnrich but in that case the @Consumed code is not executed. Is
there any other alternative?


 I apologise for such basic questions, I am sure I could probably figure out
a "good enough" approach using my inexistent knowledge of Camel (we have
Camel in Action which has been great so far, but I don't see anything in
Chapter 6 regarding database polling) but, on the other hand, it's such a
common task that someone might have best practices  already available.  I
have browsed the myBatis and SQL docs and I think that they might be better
suited (if I am not using JPA incorrectly, which is quite likely the case),
but I will have the same problem of not knowing if I am using Camel
correctly.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Best-way-to-poll-a-database-and-process-in-chunks-tp5796094.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Process several messages from several JMSEndpoints with single ThreadPool

2017-03-24 Thread makkenza
We have a GUI app that creates a queue for every product to communicate with
the server. As a result for every queue, Camel creates 3 threads
(JmsConsumer, JmsReplyManagerTimoutChecker, and TemporaryQueueReplyManager)
so after user adds 200+ products on his GUI, number of threads hits 2K and
OSX won't allow creating more threads per process and JVM throws OOMError,
with "can't create more native threads" message.

In order to solve this problem (without making much code changes), I would
like to use a single ThreadPool that would process work of above 3
threads/product...

*So far I've tried: 
JmsConfiguration myJmsConfiguration = new
JmsConfiguration(aConnectionFactory);
myJmsConfiguration.setTaskExecutor(theTaskExecutor);
myJmsConfiguration.setDefaultTaskExecutorType(DefaultTaskExecutorType.ThreadPool);
return JmsComponent.jmsComponent(myJmsConfiguration);
*
However, above does not work well, with sporadic errors like : 
org.apache.camel.RuntimeExchangeException: Failed to resolve replyTo
destination on the exchange: Exchange[Message: BLAH]

Was wondering if anyone has done something like that before?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Process-several-messages-from-several-JMSEndpoints-with-single-ThreadPool-tp5796093.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel 2.18.2 Kafka SSL wrong parametrisation

2017-03-24 Thread habdank
My mistake. It is not:

sslKey*S*toreLocation
sslKey*S*torePassword

but

sslKey*s*toreLocation
sslKey*s*torePassword

Simple typo :-).




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-18-2-Kafka-SSL-wrong-parametrisation-tp5796070p5796086.html
Sent from the Camel - Users mailing list archive at Nabble.com.


file input with tail -f behaviour

2017-03-24 Thread Oliver Wulff
Hi there


I've tried to use the stream input component to listen on changes within a file 
to process the lines one by one.





But I noticed it always starts from the beginning. Is there an option in Camel 
to have "tail -f" behaviour to trigger my route?


Thanks

Oli



Camel 2.18.2 Kafka SSL wrong parametrisation

2017-03-24 Thread habdank
Dears,

I am preparing Kafka endpoint with SSL and I am getting strange error
message.

Unknown
parameters=[{sslKeyStoreLocation=/location/client.truststore.jks,
sslKeyStorePassword=passwd}]

Those parameters are staying definitely in the documentation of the
consumer.
The complete ERROR log is below.

Do you have any hints?

Best regards,
Seweryn.

2017-03-24 09:30:21,823 [main] INFO 
org.apache.camel.spring.SpringCamelContext - Apache Camel 2.18.2
(CamelContext: normalProcessingContext) is shutdown in 0.029 seconds
2017-03-24 09:30:21,825 [main] ERROR at.spardat.clj.App - Unable to start
the application
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
ProcessKafkaMessages: Route(ProcessKafkaMessages)[[From[kafka:server:909...
because of Failed to resolve endpoint:
kafka://server:9093,server2:9093?consumersCount=2=mygroup=40=100=SSL=passwd=%2Flocation%2Fclient.truststore.jks=passwd=mytopic
due to: Failed to resolve endpoint:
kafka://server:9093,server2:9093?consumersCount=2=mygroup=40=100=SSL=passwd=%2Flocation%2Fclient.truststore.jks=passwd=mytopic
due to: There are 2 parameters that couldn't be set on the endpoint. Check
the uri if the parameters are spelt correctly and that they are properties
of the endpoint. Unknown
parameters=[{sslKeyStoreLocation=/location/client.truststore.jks,
sslKeyStorePassword=passwd}]







--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-18-2-Kafka-SSL-wrong-parametrisation-tp5796070.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help retaining files in source folder..

2017-03-24 Thread Claus Ibsen
Hi

You need to move the filter from the route up to the file endpoint so
its applied sooner. See the filter option on the file componet
https://github.com/apache/camel/blob/master/camel-core/src/main/docs/file-component.adoc

On Thu, Mar 23, 2017 at 8:51 PM, Hari  wrote:
> Hi,
>
> I am new to camel. I have a requirement to move XML files from one directory
> to another based on some conditions in the content of the XML file.
>
> Here is how the route i wrote looks like. The StatusFilter, returns true or
> false , based on the condition. When the condition is not met, I need the
> file to remain in the source folder. The below route does not move the file
> when the filter returns false, which is exactly what i want, but it is
> moving the file to .camel folder.
>
> Need help to retain the file in the source folder, when the condition is not
> met. Tried noop and delete options, but it did not work.
>
> from("file:d:\\data\\inprocess?recursive=true").convertBodyTo(String.class).filter().method(new
> StatusFilter(), "filter").
> process(new Processor() {
> public void process(Exchange exchange) throws Exception {
> 
> ..
> }
> }).
> to("file:d:\\data\\register\\completed");
>
>
> Please help.
> Regards,
> Hari
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Need-help-retaining-files-in-source-folder-tp5796053.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


why need the jars but i don't use the component?

2017-03-24 Thread vonezzz
2017-03-24 08:57:10.011 WARN 
org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
loadConverterMethods - Ignoring converter type:
org.apache.camel.component.xmlrpc.converter.XmlRpcConverter as a dependent
class could not be found: java.lang.NoClassDefFoundError:
org/apache/xmlrpc/XmlRpcRequest java.lang.NoClassDefFoundError:
org/apache/xmlrpc/XmlRpcRequest
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_121]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
~[?:1.8.0_121]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:1.8.0_121]
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.loadConverterMethods(AnnotationTypeConverterLoader.java:262)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:130)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:602)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)
[camel-core-2.18.1.jar:2.18.1]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
[camel-core-2.18.1.jar:2.18.1]
at 
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1283)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:1243)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:2369)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:2392)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:3745)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3086)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:182)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2957)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2953)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2976)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2953)
[camel-core-2.18.1.jar:2.18.1]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2920)
[camel-core-2.18.1.jar:2.18.1]
at com.rr.mep.test.CamelTest.main(CamelTest.java:77) [classes/:?]
Caused by: java.lang.ClassNotFoundException: org.apache.xmlrpc.XmlRpcRequest
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_121]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_121]
... 23 more

2017-03-24 08:57:10.012 WARN 
org.apache.camel.impl.converter.AnnotationTypeConverterLoader:299
loadConverterMethods - Ignoring converter type:
org.apache.camel.component.netty.NettyConverter as a dependent class could
not be found: java.lang.NoClassDefFoundError:
org/jboss/netty/buffer/ChannelBufferInputStream
java.lang.NoClassDefFoundError:
org/jboss/netty/buffer/ChannelBufferInputStream
at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:1.8.0_121]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
~[?:1.8.0_121]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[?:1.8.0_121]
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.loadConverterMethods(AnnotationTypeConverterLoader.java:262)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:130)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:602)
[camel-core-2.18.1.jar:2.18.1]
at
org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:53)
[camel-core-2.18.1.jar:2.18.1]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
[camel-core-2.18.1.jar:2.18.1]
at