Re: Spring Boot component is missing CamelSpringBootApplicationController

2015-04-07 Thread Claus Ibsen
Hi

Yeah wonder if we can backport this to 2.15.2.

Henryk any thoughts on this?

On Tue, Apr 7, 2015 at 1:51 AM, ccampo cca...@gmail.com wrote:
 Just a follow up - it appears that CamelSpringBootApplicationController won't
 be available until 2.16.0, per
 https://issues.apache.org/jira/browse/CAMEL-8532. Unfortunately, this
 renders the Camel Spring Boot component effectively broken until then.

 A work-around for anybody encountering this issue is just to write the code
 yourself. Create a the class CamelSpringBootApplicationController.java
 somewhere in your codebase using the code
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
 (and of course, follow the license and give credit where it's due). Then in
 your main method, just use the code:

 final ApplicationContext applicationContext = new
 SpringApplication(MainClass.class).run(args);
 final CamelSpringBootApplicationController applicationController =

 applicationContext.getBean(CamelSpringBootApplicationController.class);
 applicationController.blockMainThread();

 ... similar to what's shown in
 https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FatJarRouter.java
 (again, follow the license).

 Finally declare a bean of type CamelSpringBootApplicationController, like
 so:

 @Bean
 public CamelSpringBootApplicationController applicationController(final
 ApplicationContext applicationContext,
 final CamelContext camelContext) {
 return new CamelSpringBootApplicationController(applicationContext,
 camelContext);
 }

 Everything should be OK then.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Spring-Boot-component-is-missing-CamelSpringBootApplicationController-tp5765405p5765406.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/


Re: upgrading to Scala 2.11

2015-04-07 Thread Behrad
Thank you Shreyas,
I don't need xml support, so I can ignore this, however It would be nicer
if I could turn related type converter off, or tell Camel to just warn me
about them... the exception trace turns my logs ugly :(

2015-04-07 11:24 GMT+04:30 shreyas shreyas.puro...@hotmail.com:

 Scala 2.11 does not have native XML support, you need to add the
 dependency: https://github.com/scala/scala-xml

 For SBT: libraryDependencies += org.scala-lang.modules %% scala-xml %
 1.0.3



 Thanks,
 Shreyas


 
  Date: Tue, 7 Apr 2015 11:12:25 +0430
  Subject: upgrading to Scala 2.11
  From: behr...@gmail.com
  To: users@camel.apache.org
 
  When I upgraded to Scala 2.11 (my Camel is 2.14.0) I'm getting this
 error:
 
  AnnotationTypeConverterLoader - Ignoring converter type:
  org.apache.camel.scala.converter.ScalaTypeConverter as a dependent class
  could not be found: java.lang.NoClassDefFoundError: scala/xml/Elem
  java.lang.NoClassDefFoundError: scala/xml/Elem
 
 
 
  --
  --Behrad





-- 
--Behrad


Re: Camel LOOP

2015-04-07 Thread contactreji
And I tried using Xquery this way

*   camel:when

camel:simple${in.header.operationName} ==
'CreateOperation'/camel:simple
camel:setProperty 
propertyName=recordCount

camel:xquerycount(//CustomerRecords/Record)/camel:xquery
/camel:setProperty
camel:log message=Count = 
${property.recordCount}
loggingLevel=INFO 
logName=Log /*

it returns following exception

org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to
insert a node where it is not permitted.

The incoming XML is as follows
*soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
   soapenv:Header/
   soapenv:Body
  CustomerRecords
 
 Record
Cust_ID1010/Cust_ID
Cust_NameREJI MATHEWS/Cust_Name
Cust_Address7TH MAIN, BANGALORE/Cust_Address
Cust_Balance1000/Cust_Balance
Cust_Phone+4231213/Cust_Phone
Cust_PIN560043/Cust_PIN
 /Record
   Record
Cust_ID1004/Cust_ID
Cust_NameREJI MATHEWS/Cust_Name
Cust_Address7TH MAIN, BANASAWADI, BANGALORE/Cust_Address
Cust_Balance1000/Cust_Balance
Cust_Phone+23232/Cust_Phone
Cust_PIN560043/Cust_PIN
 /Record

  Record
Cust_ID1006/Cust_ID
Cust_NameREJI MATHEWS/Cust_Name
Cust_Address7TH MAIN, BANGALORE/Cust_Address
Cust_Balance1000/Cust_Balance
Cust_Phone123/Cust_Phone
Cust_PIN560043/Cust_PIN
 /Record

  /CustomerRecords
   /soapenv:Body
/soapenv:Envelope*



-
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel  
Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-LOOP-tp5765424p5765429.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel LOOP

2015-04-07 Thread contactreji
Hi

Basically, I am trying to develop a module which pushes the customer records
into database. Incoming XML contains multiple customer records.

I am wondering how I can use the CamelLoopIndex property while looping
through xml records.
I have some code like follows. 

I want to loop through records while parsing them using Xpath expressions to
set them into the exchange property which later be used in camel sql insert
statement.

Can someone give me the syntax? Do I have to put the xpath expression inside
the camel simple to access the property CamelLoopIndex ??
*
camel:when

camel:simple${in.header.operationName} ==
'CreateOperation'/camel:simple
camel:loop


camel:xpathcount(//CustomerRecords/Record[${in.header.CamelLoopIndex}]/Cust_ID/text())/camel:xpath
camel:setProperty 
propertyName=customerID

camel:xpath//CustomerRecords/Record/Cust_ID/text()/camel:xpath
/camel:setProperty
camel:setProperty 
propertyName=customerName

camel:xpath//CustomerRecords/Record/Cust_Name/text()/camel:xpath
/camel:setProperty
camel:setProperty 
propertyName=customerAddress

camel:xpath//CustomerRecords/Record/Cust_Address/text()/camel:xpath
/camel:setProperty
camel:setProperty 
propertyName=customerBalance

camel:xpath//CustomerRecords/Record/Cust_Balance/text()/camel:xpath
/camel:setProperty
camel:setProperty 
propertyName=customerPhoneNo

camel:xpath//CustomerRecords/Record/Cust_Phone/text()/camel:xpath
/camel:setProperty
camel:setProperty 
propertyName=customerPostalPIN

camel:xpath//CustomerRecords/Record/Cust_PIN/text()/camel:xpath
/camel:setProperty
camel:setBody
camel:simpleinsert 
into customer
values('${property.customerID}','${property.customerName}','${property.customerAddress}','${property.customerBalance}','${property.customerPhoneNo}','${property.customerPostalPIN}')/camel:simple
/camel:setBody
camel:to uri=jdbc:dataSource 
/
/camel:loop
/camel:when*




-
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel  
Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-LOOP-tp5765424.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: BeanIODataFormat giving exception in OSGI compliant Karaf Server Camel

2015-04-07 Thread gargankur007
We are using Spring to wire beans



--
View this message in context: 
http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404p5765425.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

2015-04-07 Thread Martin Lichtin
JDK 1.8. Karaf's jre.properties has jre-1.8 property with

 javax.annotation;version=1.0, \
 javax.annotation.processing;version=1.6, \

It seems to be an unresolved issue, see
https://issues.apache.org/jira/browse/KARAF-2660

I noticed that if I install mvn:javax.annotation/javax.annotation-api/1.2
ahead of installing the 'camel' feature, then I can later install 'cxf'.



James Carman wrote
 You need to update jre.properties to make sure you have the right version
 coming from the jre.  What jdk?
 
 On Monday, April 6, 2015, Martin Lichtin lt;

 lichtin@.com

 gt; wrote:
 
 In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
 installing 'cxf'.

 karaf@root() feature:repo-add mvn:org.apache.camel.karaf/
 apache-camel/2.15.1/xml/features
 Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
 features

 karaf@root() feature:install camel
 karaf@root() feature:install cxf
 Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
 org.apache.servicemix.bundles.spring-beans (77),
 org.apache.servicemix.bundles.spring-context-support (80),
 org.apache.servicemix.bundles.spring-core (75)
 Error executing command: Can't install feature cxf/0.0.0:
 Could not start bundle
 mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
 in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to
 resolve
 bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
 is exposed to package 'javax.annotation' from bundle revisions
 javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
 dependency chains.

 Chain 1:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import: ((osgi.wiring.package=javax.annotation)(version=1.2.0)(!(
 version=2.0.0)))
  |
 export: osgi.wiring.package=javax.annotation
   javax.annotation-api [93.0]

 Chain 2:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
 import: ((osgi.wiring.package=org.springframework.context.
 annotation)(version=3.1.0)(!(version=5.0.0)))
  |
 export: osgi.wiring.package=org.springframework.context.annotation;
 uses:=javax.annotation
   org.apache.servicemix.bundles.spring-context [79.0]
 import: (osgi.wiring.package=javax.annotation)
  |
 export: osgi.wiring.package=javax.annotation
   org.apache.felix.framework [0]
 karaf@root()

 Anyone else experiencing this issue?

 I see that switching the install (i.e. first installing 'cxf') will make
 it work, however, it seems a klduge to prescribe an installation
 ordering.






--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-javax-annotation-when-installing-camel-followed-by-cxf-feature-tp5765376p5765426.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Issue with high volume load in camel

2015-04-07 Thread Vanshul . Chawla
Hello,

I have a camel context where the messages are picked from a IBM MQ queue and on 
basis of XPATH, we place it onto separate seda queues.
From seda queues, the messages are picked and files are written in per minute 
duration ie append mode for 1 minute.

This camel context has peak volumes of 10 million messages per day.

When we start the context, it runs fine for 5 10 minutes and then slows down 
and finally stops with error:

org.apache.camel.CamelExecutionException: Exception occurred during execution 
on the exchange: Exchange[JmsMessage@0x3f197cf8]
at 
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1379)
at 
org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:283)
at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64)
at 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at 
org.apache.camel.processor.interceptor.HandleFaultInterceptor.process(HandleFaultInterceptor.java:41)
at 
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
at 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at 
org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at 
org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)
at 
org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)
at 
org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown 
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded

Could you please suggest some pointers here. We don't have any java code except 
for a small class which removes tab,linefeed from message before dumping that 
to file.


Thanks and Regards,

Vanshul Chawla



Re: Jetty HTTPS 2way

2015-04-07 Thread garethahealy
Hi Willem,

Switched to camel-http4 and works. 

Cheers.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Jetty-HTTPS-2way-tp5765296p5765431.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: BeanIODataFormat giving exception in OSGI compliant Karaf Server Camel

2015-04-07 Thread Claus Ibsen
What versions of the software are you using? And are you using spring
or blueprint?

On Mon, Apr 6, 2015 at 11:23 PM, gargankur007 gargankur...@gmail.com wrote:
 I am using CAmel for one of my projects.The bundles are deployed in OSGI. I
 have a usecase in which I would need to unmarshal a CSV to POJO. I am using
 BeanIODataFormat for that.

 Somehow I am bale to unmarshal the same in Camel Main Program but when I put
 the same piece of code in OSGI I get following exception

 stackTrace=java.lang.NullPointerException at
 org.apache.camel.dataformat.beanio.BeanIODataFormat.readModels(BeanIODataFormat.java:142)
 at
 org.apache.camel.dataformat.beanio.BeanIODataFormat.unmarshal(BeanIODataFormat.java:110)
 at
 com.hcentive.wig.wem.route.UnmarshallerRouteBuilder$2.process(UnmarshallerRouteBuilder.java:85)
 at
 org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
 at
 org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
 at
 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
 at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at
 org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
 at
 org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
 at
 org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
 at
 org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
 at
 org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1101)



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404.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/


Re: Stop split after reading first line

2015-04-07 Thread Claus Ibsen
Hi

I would then not use the splitter, but you can use a java bean /
processor and read the file by line and read the first and then
validate it.

Java has API for a LineNumberReader or something like that so you can
read the file one line at a time.




On Mon, Apr 6, 2015 at 6:09 PM, manojdevendran manojdevend...@gmail.com wrote:
 How can I stop the split after reading the first line of a file?

 Looking for something like break in the for loop.

 The requirement is to read and validate first line from a large file. Please
 let me know if any suggestions.

 Thanks in advance!!



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Stop-split-after-reading-first-line-tp5765370.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/


RE: upgrading to Scala 2.11

2015-04-07 Thread shreyas
Scala 2.11 does not have native XML support, you need to add the dependency: 
https://github.com/scala/scala-xml

For SBT: libraryDependencies += org.scala-lang.modules %% scala-xml % 
1.0.3



Thanks,
Shreyas



 Date: Tue, 7 Apr 2015 11:12:25 +0430
 Subject: upgrading to Scala 2.11
 From: behr...@gmail.com
 To: users@camel.apache.org

 When I upgraded to Scala 2.11 (my Camel is 2.14.0) I'm getting this error:

 AnnotationTypeConverterLoader - Ignoring converter type:
 org.apache.camel.scala.converter.ScalaTypeConverter as a dependent class
 could not be found: java.lang.NoClassDefFoundError: scala/xml/Elem
 java.lang.NoClassDefFoundError: scala/xml/Elem



 --
 --Behrad
  

upgrading to Scala 2.11

2015-04-07 Thread Behrad
When I upgraded to Scala 2.11 (my Camel is 2.14.0) I'm getting this error:

AnnotationTypeConverterLoader - Ignoring converter type:
org.apache.camel.scala.converter.ScalaTypeConverter as a dependent class
could not be found: java.lang.NoClassDefFoundError: scala/xml/Elem
java.lang.NoClassDefFoundError: scala/xml/Elem



-- 
--Behrad


Re: SFTP: RequiredAuthentications2

2015-04-07 Thread Claus Ibsen
Hi

Thanks for sharing this information with the community. Great to hear
its supported and works.

On Tue, Apr 7, 2015 at 7:06 AM, shreyas shreyas.puro...@hotmail.com wrote:
 For anyone wondering in future, camel sftp works with 
 RequiredAuthentications2 or multiple auth types (both key  password). I 
 tested it on OSX.

 Thanks,
 Shreyas


 
 From: claus.ib...@gmail.com
 Date: Fri, 27 Mar 2015 16:34:39 +0100
 Subject: Re: SFTP: RequiredAuthentications2
 To: users@camel.apache.org

 Hi

 Camel uses jcraft for sftp. You may want to check what it supports.
 http://www.jcraft.com/jsch/



 On Thu, Mar 26, 2015 at 8:02 PM, shreyas shreyas.puro...@hotmail.com wrote:
 Does camel support SFTP with RequiredAuthentications2 as provided in this 
 link for auth: 
 http://security.stackexchange.com/questions/17931/possible-to-use-both-private-key-and-password-authentication-for-ssh-login?

 Thanks
 Shreyas



 --
 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/




-- 
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: Custom Load Balancing based on Inflight Exchange

2015-04-07 Thread Claus Ibsen
Hi

Yeah maybe we have a few different strategies already. But one based
on pick first the ones who are doing no or the least amount of work
sounds like a useable use-case.

So yeah you are welcome to get back when you have something working
and contribute. We love that
http://camel.apache.org/contributing.html

On Mon, Apr 6, 2015 at 1:52 PM, franktva franktyle...@gmail.com wrote:
 Thanks for the quick response.  That's the exact approach I'm taking.  Do you
 think this feature would be useful for a future release?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328p5765358.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/


BeanIODataFormat giving exception in OSGI compliant Karaf Server Camel

2015-04-07 Thread gargankur007
I am using CAmel for one of my projects.The bundles are deployed in OSGI. I
have a usecase in which I would need to unmarshal a CSV to POJO. I am using
BeanIODataFormat for that.

Somehow I am bale to unmarshal the same in Camel Main Program but when I put
the same piece of code in OSGI I get following exception

stackTrace=java.lang.NullPointerException at
org.apache.camel.dataformat.beanio.BeanIODataFormat.readModels(BeanIODataFormat.java:142)
at
org.apache.camel.dataformat.beanio.BeanIODataFormat.unmarshal(BeanIODataFormat.java:110)
at
com.hcentive.wig.wem.route.UnmarshallerRouteBuilder$2.process(UnmarshallerRouteBuilder.java:85)
at
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1101)



--
View this message in context: 
http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Spring Boot component is missing CamelSpringBootApplicationController

2015-04-07 Thread ccampo
Using Camel 2.15.1 - Camel Spring Boot from Maven Central and Spring Boot
1.2.3

The class CamelSpringBootApplicationController is not available in the
camel-spring-boot jar from Maven, despite being referenced in the
documentation HERE: http://camel.apache.org/spring-boot.html

Additionally, I cannot get my program to run without shutting down
immediately. I've created a simple route which copies a file from one
directory to the other, yet when I run the app (./gradlew bootRun or just
running the main method), Spring Boot shuts down immediately after startup.
Here's the code:

import org.apache.camel.builder.RouteBuilder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class AdapterApplication {

public static void main(final String[] args) {
new SpringApplication(AdapterApplication.class).run(args);
}

@Bean
RouteBuilder Router() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from(file:target/input).to(file:target/output);
}
};
}
}

I would appreciate any help with either of these issues.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Spring-Boot-component-is-missing-CamelSpringBootApplicationController-tp5765405.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Stop split after reading first line

2015-04-07 Thread manojdevendran
How can I stop the split after reading the first line of a file? 

Looking for something like break in the for loop.

The requirement is to read and validate first line from a large file. Please
let me know if any suggestions. 

Thanks in advance!! 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Stop-split-after-reading-first-line-tp5765370.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Custom Load Balancing based on Inflight Exchange

2015-04-07 Thread franktva
Thanks for the quick response.  That's the exact approach I'm taking.  Do you
think this feature would be useful for a future release?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Custom-Load-Balancing-based-on-Inflight-Exchange-tp5765328p5765358.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Why so many port used when I use camel-netty4-http

2015-04-07 Thread Yuffie
Hi,
when I use netty4-http compoment, I found it use a lot ports which I have
not defined in my program:

协议  本地地址  外部地址状态   PID
  TCP0.0.0.0:80 0.0.0.0:0  LISTENING   1080
  TCP0.0.0.0:1350.0.0.0:0  LISTENING   992
  TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
  TCP0.0.0.0:1025   0.0.0.0:0  LISTENING   560
  TCP0.0.0.0:1026   0.0.0.0:0  LISTENING   676
  TCP0.0.0.0:1027   0.0.0.0:0  LISTENING   480
  TCP0.0.0.0:1028   0.0.0.0:0  LISTENING   1036
  TCP0.0.0.0:1042   0.0.0.0:0  LISTENING   668
  TCP0.0.0.0:3306   0.0.0.0:0  LISTENING   2924
  TCP0.0.0.0:8009   0.0.0.0:0  LISTENING   10368
  TCP0.0.0.0:8080   0.0.0.0:0  LISTENING   10368
  TCP0.0.0.0:8082   0.0.0.0:0  LISTENING   10368
  TCP0.0.0.0:12025  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12110  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12119  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12143  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12465  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12563  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12993  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:12995  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:27275  0.0.0.0:0  LISTENING   1460
  TCP0.0.0.0:62332  0.0.0.0:0  LISTENING   1512
  TCP127.0.0.1:1135 0.0.0.0:0  LISTENING   8496
  TCP127.0.0.1:8005 0.0.0.0:0  LISTENING   10368
  TCP127.0.0.1:10.0.0.0:0  LISTENING   2980
  TCP127.0.0.1:100150.0.0.0:0  LISTENING   1512
  TCP127.0.0.1:120250.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:121100.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:121190.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:121430.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:124650.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:125630.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:129930.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:129950.0.0.0:0  LISTENING   1460
  TCP127.0.0.1:17568127.0.0.1:17570ESTABLISHED 1620
  TCP127.0.0.1:17570127.0.0.1:17568ESTABLISHED 10368
  TCP127.0.0.1:17573127.0.0.1:17574ESTABLISHED 10368
  TCP127.0.0.1:17574127.0.0.1:17573ESTABLISHED 10368
  TCP127.0.0.1:17575127.0.0.1:17576ESTABLISHED 10368
  TCP127.0.0.1:17576127.0.0.1:17575ESTABLISHED 10368
  TCP127.0.0.1:17580127.0.0.1:17581ESTABLISHED 10368
  TCP127.0.0.1:17581127.0.0.1:17580ESTABLISHED 10368
  TCP127.0.0.1:17582127.0.0.1:17583ESTABLISHED 10368
  TCP127.0.0.1:17583127.0.0.1:17582ESTABLISHED 10368
  TCP127.0.0.1:17584127.0.0.1:17585ESTABLISHED 10368
  TCP127.0.0.1:17585127.0.0.1:17584ESTABLISHED 10368
  TCP127.0.0.1:17586127.0.0.1:17587ESTABLISHED 10368
  TCP127.0.0.1:17587127.0.0.1:17586ESTABLISHED 10368
  TCP127.0.0.1:17588127.0.0.1:17589ESTABLISHED 10368
  TCP127.0.0.1:17589127.0.0.1:17588ESTABLISHED 10368
  TCP127.0.0.1:17590127.0.0.1:17591ESTABLISHED 10368
  TCP127.0.0.1:17591127.0.0.1:17590ESTABLISHED 10368
  TCP127.0.0.1:17592127.0.0.1:17593ESTABLISHED 10368
  TCP127.0.0.1:17593127.0.0.1:17592ESTABLISHED 10368
  TCP127.0.0.1:17594127.0.0.1:17595ESTABLISHED 10368
  TCP127.0.0.1:17595127.0.0.1:17594ESTABLISHED 10368
  TCP127.0.0.1:17596127.0.0.1:17597ESTABLISHED 10368
  TCP127.0.0.1:17597127.0.0.1:17596ESTABLISHED 10368
  TCP127.0.0.1:17598127.0.0.1:17599ESTABLISHED 10368
  TCP127.0.0.1:17599127.0.0.1:17598ESTABLISHED 10368
  TCP127.0.0.1:17600127.0.0.1:17601ESTABLISHED 10368
  TCP127.0.0.1:17601127.0.0.1:17600ESTABLISHED 10368
  TCP127.0.0.1:17602127.0.0.1:17603ESTABLISHED 10368
  TCP127.0.0.1:17603

How to send FLASH through Camel-SMPP component

2015-04-07 Thread bharaniravikanth
Hi,

My application uses Camel-smpp component for sending SMS and Flash SMS, I
could able to send SMS through my application successfully,

But may I know what are the additional parameters to be set in the headers
for sending  FLASH SMS.

Regards,
BRK



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-send-FLASH-through-Camel-SMPP-component-tp5765434.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: @UriPath and @UriSyntax

2015-04-07 Thread Claus Ibsen
Hi

Oh if you have this as a component outside Camel, then you need to add
the apt plugin
https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L63

And this plugin if you want to include a .properties file in the JAR
with a list of components it contains
https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L217

Then you do the same as all the components in Apache Camel.

On Tue, Apr 7, 2015 at 3:34 PM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 All the 150+ components is an example of this. Just pick a similar /
 simple component and see its source code.

 On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott cpigg...@gmail.com 
 wrote:
 Hi,

 According to
 https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release


- Custom components using @UriEndpoint must now include a syntax
attribute to document the uri syntax of the endpoint, when using the apt
compiler plugin to generate documentation.


 I'm looking for documentation on this and not really finding how to use it
 or simple examples:


- http://camel.apache.org/endpoint-annotations.html  says what it is,
but not how to use it
-

 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
is an example soembody wrote that uses @UriParam ... that works fine, but
when I try to add a @UriPath parameter it silently ends up  null
- Tons of examples in git but most of them don't have a 'syntax=' so I
must be looking at old source


 Trying to piece all this together from scarce examples and documentation:


- It doesn't seem like I really need to extend UriComponentConfiguration
at all, do I?  If I declare my component a @ManagedResource it seems to
bind all the @UriParam just fine.  It doesn't bind the @UriPath 
 parameters,
though, and fails to do so silently, despite the fact that they are marked
@Meadata(required = true).
- Are there any simple examples out there using
@UriComponentConfiguration ?


 --Chris



 --
 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/



-- 
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: @UriPath and @UriSyntax

2015-04-07 Thread Claus Ibsen
Hi

All the 150+ components is an example of this. Just pick a similar /
simple component and see its source code.

On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott cpigg...@gmail.com wrote:
 Hi,

 According to
 https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release


- Custom components using @UriEndpoint must now include a syntax
attribute to document the uri syntax of the endpoint, when using the apt
compiler plugin to generate documentation.


 I'm looking for documentation on this and not really finding how to use it
 or simple examples:


- http://camel.apache.org/endpoint-annotations.html  says what it is,
but not how to use it
-

 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
is an example soembody wrote that uses @UriParam ... that works fine, but
when I try to add a @UriPath parameter it silently ends up  null
- Tons of examples in git but most of them don't have a 'syntax=' so I
must be looking at old source


 Trying to piece all this together from scarce examples and documentation:


- It doesn't seem like I really need to extend UriComponentConfiguration
at all, do I?  If I declare my component a @ManagedResource it seems to
bind all the @UriParam just fine.  It doesn't bind the @UriPath parameters,
though, and fails to do so silently, despite the fact that they are marked
@Meadata(required = true).
- Are there any simple examples out there using
@UriComponentConfiguration ?


 --Chris



-- 
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: @UriPath and @UriSyntax

2015-04-07 Thread Christopher Piggott
I will try that, thanks.

For a test, I just tried getting back to basics, and getting rid of all the
Uri configuration entirely - just to see what happens.  I still have
META-INF/services/org/apache/camel/component/jssc (a text file) which
allows me to do:

from(jssc:com10?baud=19200) ...

and it locates the component just fine.  The next thing I did was change
the Component to extend UriEndpointComponent rather than DefaultComponent.
That broke it as follows:

2015-04-07 10:15:41,550 [main] ERROR app.tasks.CamelTask - Failed to start
camel
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1: Route(route1)[[From[jssc:com10?baud=19200]] - [To[xmpp://cl...
because of Failed to resolve endpoint: jssc://com10?baud=19200 due to:
Cannot auto create component: jssc

So something, by doing that, just broke its ability to locate the endpoint
by name using the entry in META-INF.  The stack trace it gives me is not
exceptionally helpful; what it's really telling me is that it can't locate
my component.  What's especially confusing is that a UriEndpointComponent
extends DefaultComponent so it seems like, as far as camel is concerned,
they should be the same thing.


I checked in what I have so far ...

https://github.com/wz2b/camel-jssc/tree/master/src/main/java/com/autofrog/camel




On Tue, Apr 7, 2015 at 9:36 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Oh if you have this as a component outside Camel, then you need to add
 the apt plugin
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L63

 And this plugin if you want to include a .properties file in the JAR
 with a list of components it contains
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L217

 Then you do the same as all the components in Apache Camel.

 On Tue, Apr 7, 2015 at 3:34 PM, Claus Ibsen claus.ib...@gmail.com wrote:
  Hi
 
  All the 150+ components is an example of this. Just pick a similar /
  simple component and see its source code.
 
  On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott cpigg...@gmail.com
 wrote:
  Hi,
 
  According to
  https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release
 
 
 - Custom components using @UriEndpoint must now include a syntax
 attribute to document the uri syntax of the endpoint, when using the
 apt
 compiler plugin to generate documentation.
 
 
  I'm looking for documentation on this and not really finding how to use
 it
  or simple examples:
 
 
 - http://camel.apache.org/endpoint-annotations.html  says what it
 is,
 but not how to use it
 -
 
 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
 is an example soembody wrote that uses @UriParam ... that works
 fine, but
 when I try to add a @UriPath parameter it silently ends up  null
 - Tons of examples in git but most of them don't have a 'syntax=' so
 I
 must be looking at old source
 
 
  Trying to piece all this together from scarce examples and
 documentation:
 
 
 - It doesn't seem like I really need to extend
 UriComponentConfiguration
 at all, do I?  If I declare my component a @ManagedResource it seems
 to
 bind all the @UriParam just fine.  It doesn't bind the @UriPath
 parameters,
 though, and fails to do so silently, despite the fact that they are
 marked
 @Meadata(required = true).
 - Are there any simple examples out there using
 @UriComponentConfiguration ?
 
 
  --Chris
 
 
 
  --
  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/



 --
 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: @UriPath and @UriSyntax

2015-04-07 Thread Claus Ibsen
A component must have a default no-arg constructor.

So add that, and call super(JsscEndpoint.class) and remove the other
constructors as they are not really needed.

On Tue, Apr 7, 2015 at 4:55 PM, Christopher Piggott cpigg...@gmail.com wrote:
 I will try that, thanks.

 For a test, I just tried getting back to basics, and getting rid of all the
 Uri configuration entirely - just to see what happens.  I still have
 META-INF/services/org/apache/camel/component/jssc (a text file) which
 allows me to do:

 from(jssc:com10?baud=19200) ...

 and it locates the component just fine.  The next thing I did was change
 the Component to extend UriEndpointComponent rather than DefaultComponent.
 That broke it as follows:

 2015-04-07 10:15:41,550 [main] ERROR app.tasks.CamelTask - Failed to start
 camel
 org.apache.camel.FailedToCreateRouteException: Failed to create route
 route1: Route(route1)[[From[jssc:com10?baud=19200]] - [To[xmpp://cl...
 because of Failed to resolve endpoint: jssc://com10?baud=19200 due to:
 Cannot auto create component: jssc

 So something, by doing that, just broke its ability to locate the endpoint
 by name using the entry in META-INF.  The stack trace it gives me is not
 exceptionally helpful; what it's really telling me is that it can't locate
 my component.  What's especially confusing is that a UriEndpointComponent
 extends DefaultComponent so it seems like, as far as camel is concerned,
 they should be the same thing.


 I checked in what I have so far ...

 https://github.com/wz2b/camel-jssc/tree/master/src/main/java/com/autofrog/camel




 On Tue, Apr 7, 2015 at 9:36 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 Oh if you have this as a component outside Camel, then you need to add
 the apt plugin
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L63

 And this plugin if you want to include a .properties file in the JAR
 with a list of components it contains
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L217

 Then you do the same as all the components in Apache Camel.

 On Tue, Apr 7, 2015 at 3:34 PM, Claus Ibsen claus.ib...@gmail.com wrote:
  Hi
 
  All the 150+ components is an example of this. Just pick a similar /
  simple component and see its source code.
 
  On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott cpigg...@gmail.com
 wrote:
  Hi,
 
  According to
  https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release
 
 
 - Custom components using @UriEndpoint must now include a syntax
 attribute to document the uri syntax of the endpoint, when using the
 apt
 compiler plugin to generate documentation.
 
 
  I'm looking for documentation on this and not really finding how to use
 it
  or simple examples:
 
 
 - http://camel.apache.org/endpoint-annotations.html  says what it
 is,
 but not how to use it
 -
 
 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
 is an example soembody wrote that uses @UriParam ... that works
 fine, but
 when I try to add a @UriPath parameter it silently ends up  null
 - Tons of examples in git but most of them don't have a 'syntax=' so
 I
 must be looking at old source
 
 
  Trying to piece all this together from scarce examples and
 documentation:
 
 
 - It doesn't seem like I really need to extend
 UriComponentConfiguration
 at all, do I?  If I declare my component a @ManagedResource it seems
 to
 bind all the @UriParam just fine.  It doesn't bind the @UriPath
 parameters,
 though, and fails to do so silently, despite the fact that they are
 marked
 @Meadata(required = true).
 - Are there any simple examples out there using
 @UriComponentConfiguration ?
 
 
  --Chris
 
 
 
  --
  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/



 --
 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/




-- 
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/


@UriPath and @UriSyntax

2015-04-07 Thread Christopher Piggott
Hi,

According to
https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release


   - Custom components using @UriEndpoint must now include a syntax
   attribute to document the uri syntax of the endpoint, when using the apt
   compiler plugin to generate documentation.


I'm looking for documentation on this and not really finding how to use it
or simple examples:


   - http://camel.apache.org/endpoint-annotations.html  says what it is,
   but not how to use it
   -
   
https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
   is an example soembody wrote that uses @UriParam ... that works fine, but
   when I try to add a @UriPath parameter it silently ends up  null
   - Tons of examples in git but most of them don't have a 'syntax=' so I
   must be looking at old source


Trying to piece all this together from scarce examples and documentation:


   - It doesn't seem like I really need to extend UriComponentConfiguration
   at all, do I?  If I declare my component a @ManagedResource it seems to
   bind all the @UriParam just fine.  It doesn't bind the @UriPath parameters,
   though, and fails to do so silently, despite the fact that they are marked
   @Meadata(required = true).
   - Are there any simple examples out there using
   @UriComponentConfiguration ?


--Chris


Re: Stop split after reading first line

2015-04-07 Thread manojdevendran
Thank you Claus!!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Stop-split-after-reading-first-line-tp5765370p5765438.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel process evaluates XPath to a DTMNodeList object

2015-04-07 Thread vdhawan
Hello, 

i have a process with a method signature

public void process(Exchange exchange,@XPath(value=//MyXpath) Object value,
@XPath(value=//MyXpath1)Object value1)

Both the xpath return 1 match when a xml is fed to this processor. I am
expecting the processor to evaluate the xpath and convert to import
net.sf.saxon.dom.DOMNodeList
However it converts it to org.apache.xml.dtm.ref.DTMNodeList.

Is there a way where i can force my processor to convert to a specific type
on xpath evaluation. 
P.S - i am using camel 2.12 and my camel routes also use saxon. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-process-evaluates-XPath-to-a-DTMNodeList-object-tp5765441.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Multimedia files aggregation and split

2015-04-07 Thread yonas demeke

Hi,I wanted to use camel aggregator EIP to combine text and image files, and 
splitter EIP to split web page into text and images. I googled, but n't 
succeeded.
Please do have any idea or examples that show some tips?


RE: upgrading to Scala 2.11

2015-04-07 Thread shreyas
As far as I see, it is a warn

catch (NoClassDefFoundError e) {
LOG.warn(Ignoring converter type:  + type.getCanonicalName() +  as a 
dependent class could not be found:  + e, e);
}

You should be able to suppress it in your log4j config for this particular 
class.

Also, may be you can try to remove this convertor from registry using (never 
tried myself):
context.getTypeConverterRegistry.removeTypeConverter


Thanks,
Shreyas



 Date: Tue, 7 Apr 2015 11:30:15 +0430
 Subject: Re: upgrading to Scala 2.11
 From: behr...@gmail.com
 To: users@camel.apache.org

 Thank you Shreyas,
 I don't need xml support, so I can ignore this, however It would be nicer
 if I could turn related type converter off, or tell Camel to just warn me
 about them... the exception trace turns my logs ugly :(

 2015-04-07 11:24 GMT+04:30 shreyas shreyas.puro...@hotmail.com:

 Scala 2.11 does not have native XML support, you need to add the
 dependency: https://github.com/scala/scala-xml

 For SBT: libraryDependencies += org.scala-lang.modules %% scala-xml %
 1.0.3



 Thanks,
 Shreyas


 
 Date: Tue, 7 Apr 2015 11:12:25 +0430
 Subject: upgrading to Scala 2.11
 From: behr...@gmail.com
 To: users@camel.apache.org

 When I upgraded to Scala 2.11 (my Camel is 2.14.0) I'm getting this
 error:

 AnnotationTypeConverterLoader - Ignoring converter type:
 org.apache.camel.scala.converter.ScalaTypeConverter as a dependent class
 could not be found: java.lang.NoClassDefFoundError: scala/xml/Elem
 java.lang.NoClassDefFoundError: scala/xml/Elem



 --
 --Behrad





 --
 --Behrad
  

Re: @UriPath and @UriSyntax

2015-04-07 Thread Christopher Piggott
OK that hellped.  What I ended up doing was:

* Component extends UriEndpointComponent
* Endpoint extends DefaultEndpoint and is marked @ManagedResource and
@UriEndpoint.  It also has a @UriParam for 'baud' and another one for
'path' -- that last one is a problem (will explain in a second)
* Consumer extends DefaultConsumer and uses a processor to launch events

The endpoint is marked like this:

@UriEndpoint(scheme = jssc,
syntax = jssc:path,
consumerClass = JsscConsumer.class,
title = JSSC Component)


I would like to be able to do this:


from(jssc:com10?baud=19200)


but THIS still does not work:


@UriPath
@Metadata(required=true)
private String path


so I end up having to do this:

  from(jssc:com10?path=com10baud=19200)


What is wrong with specifying it as a path parameter whose name
matches the 'syntax' in the @UriEndpoint annotation - shouldn't that
work?


*https://github.com/wz2b/camel-jssc/blob/master/src/main/java/com/autofrog/camel/JsscEndpoint.java
https://github.com/wz2b/camel-jssc/blob/master/src/main/java/com/autofrog/camel/JsscEndpoint.java*


--Chris








On Tue, Apr 7, 2015 at 10:59 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 A component must have a default no-arg constructor.

 So add that, and call super(JsscEndpoint.class) and remove the other
 constructors as they are not really needed.

 On Tue, Apr 7, 2015 at 4:55 PM, Christopher Piggott cpigg...@gmail.com
 wrote:
  I will try that, thanks.
 
  For a test, I just tried getting back to basics, and getting rid of all
 the
  Uri configuration entirely - just to see what happens.  I still have
  META-INF/services/org/apache/camel/component/jssc (a text file) which
  allows me to do:
 
  from(jssc:com10?baud=19200) ...
 
  and it locates the component just fine.  The next thing I did was change
  the Component to extend UriEndpointComponent rather than
 DefaultComponent.
  That broke it as follows:
 
  2015-04-07 10:15:41,550 [main] ERROR app.tasks.CamelTask - Failed to
 start
  camel
  org.apache.camel.FailedToCreateRouteException: Failed to create route
  route1: Route(route1)[[From[jssc:com10?baud=19200]] - [To[xmpp://cl...
  because of Failed to resolve endpoint: jssc://com10?baud=19200 due to:
  Cannot auto create component: jssc
 
  So something, by doing that, just broke its ability to locate the
 endpoint
  by name using the entry in META-INF.  The stack trace it gives me is not
  exceptionally helpful; what it's really telling me is that it can't
 locate
  my component.  What's especially confusing is that a UriEndpointComponent
  extends DefaultComponent so it seems like, as far as camel is concerned,
  they should be the same thing.
 
 
  I checked in what I have so far ...
 
 
 https://github.com/wz2b/camel-jssc/tree/master/src/main/java/com/autofrog/camel
 
 
 
 
  On Tue, Apr 7, 2015 at 9:36 AM, Claus Ibsen claus.ib...@gmail.com
 wrote:
 
  Hi
 
  Oh if you have this as a component outside Camel, then you need to add
  the apt plugin
 
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L63
 
  And this plugin if you want to include a .properties file in the JAR
  with a list of components it contains
 
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L217
 
  Then you do the same as all the components in Apache Camel.
 
  On Tue, Apr 7, 2015 at 3:34 PM, Claus Ibsen claus.ib...@gmail.com
 wrote:
   Hi
  
   All the 150+ components is an example of this. Just pick a similar /
   simple component and see its source code.
  
   On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott 
 cpigg...@gmail.com
  wrote:
   Hi,
  
   According to
  
 https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release
  
  
  - Custom components using @UriEndpoint must now include a syntax
  attribute to document the uri syntax of the endpoint, when using
 the
  apt
  compiler plugin to generate documentation.
  
  
   I'm looking for documentation on this and not really finding how to
 use
  it
   or simple examples:
  
  
  - http://camel.apache.org/endpoint-annotations.html  says what it
  is,
  but not how to use it
  -
  
 
 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
  is an example soembody wrote that uses @UriParam ... that works
  fine, but
  when I try to add a @UriPath parameter it silently ends up  null
  - Tons of examples in git but most of them don't have a 'syntax='
 so
  I
  must be looking at old source
  
  
   Trying to piece all this together from scarce examples and
  documentation:
  
  
  - It doesn't seem like I really need to extend
  UriComponentConfiguration
  at all, do I?  If I declare my component a @ManagedResource it
 seems
  to
  bind all the @UriParam just fine.  It doesn't bind the @UriPath
  parameters,
  though, and fails to do so silently, despite the fact that they
 are
  marked
  

Re: dynamic file route creation in spring dsl

2015-04-07 Thread chaituu
thanks yogesh.I am also thinking in those lines.



--
View this message in context: 
http://camel.465427.n5.nabble.com/dynamic-file-route-creation-in-spring-dsl-tp5765331p5765451.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: @UriPath and @UriSyntax

2015-04-07 Thread Claus Ibsen
For any values in the path you need to set them from the component
class in the createEndpoint method. The values are from the remaining
parameter.

Though in the future we may be able to let Camel do this mapping a bit
more automatic since we now have the syntax option. But that was just
recently introduced in 2.15.0. But historically this mapping is done
manually in the component.







On Wed, Apr 8, 2015 at 2:49 AM, Christopher Piggott cpigg...@gmail.com wrote:
 OK that hellped.  What I ended up doing was:

 * Component extends UriEndpointComponent
 * Endpoint extends DefaultEndpoint and is marked @ManagedResource and
 @UriEndpoint.  It also has a @UriParam for 'baud' and another one for
 'path' -- that last one is a problem (will explain in a second)
 * Consumer extends DefaultConsumer and uses a processor to launch events

 The endpoint is marked like this:

 @UriEndpoint(scheme = jssc,
 syntax = jssc:path,
 consumerClass = JsscConsumer.class,
 title = JSSC Component)


 I would like to be able to do this:


 from(jssc:com10?baud=19200)


 but THIS still does not work:


 @UriPath
 @Metadata(required=true)
 private String path


 so I end up having to do this:

   from(jssc:com10?path=com10baud=19200)


 What is wrong with specifying it as a path parameter whose name
 matches the 'syntax' in the @UriEndpoint annotation - shouldn't that
 work?


 *https://github.com/wz2b/camel-jssc/blob/master/src/main/java/com/autofrog/camel/JsscEndpoint.java
 https://github.com/wz2b/camel-jssc/blob/master/src/main/java/com/autofrog/camel/JsscEndpoint.java*


 --Chris








 On Tue, Apr 7, 2015 at 10:59 AM, Claus Ibsen claus.ib...@gmail.com wrote:

 A component must have a default no-arg constructor.

 So add that, and call super(JsscEndpoint.class) and remove the other
 constructors as they are not really needed.

 On Tue, Apr 7, 2015 at 4:55 PM, Christopher Piggott cpigg...@gmail.com
 wrote:
  I will try that, thanks.
 
  For a test, I just tried getting back to basics, and getting rid of all
 the
  Uri configuration entirely - just to see what happens.  I still have
  META-INF/services/org/apache/camel/component/jssc (a text file) which
  allows me to do:
 
  from(jssc:com10?baud=19200) ...
 
  and it locates the component just fine.  The next thing I did was change
  the Component to extend UriEndpointComponent rather than
 DefaultComponent.
  That broke it as follows:
 
  2015-04-07 10:15:41,550 [main] ERROR app.tasks.CamelTask - Failed to
 start
  camel
  org.apache.camel.FailedToCreateRouteException: Failed to create route
  route1: Route(route1)[[From[jssc:com10?baud=19200]] - [To[xmpp://cl...
  because of Failed to resolve endpoint: jssc://com10?baud=19200 due to:
  Cannot auto create component: jssc
 
  So something, by doing that, just broke its ability to locate the
 endpoint
  by name using the entry in META-INF.  The stack trace it gives me is not
  exceptionally helpful; what it's really telling me is that it can't
 locate
  my component.  What's especially confusing is that a UriEndpointComponent
  extends DefaultComponent so it seems like, as far as camel is concerned,
  they should be the same thing.
 
 
  I checked in what I have so far ...
 
 
 https://github.com/wz2b/camel-jssc/tree/master/src/main/java/com/autofrog/camel
 
 
 
 
  On Tue, Apr 7, 2015 at 9:36 AM, Claus Ibsen claus.ib...@gmail.com
 wrote:
 
  Hi
 
  Oh if you have this as a component outside Camel, then you need to add
  the apt plugin
 
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L63
 
  And this plugin if you want to include a .properties file in the JAR
  with a list of components it contains
 
 https://github.com/apache/activemq/blob/master/activemq-camel/pom.xml#L217
 
  Then you do the same as all the components in Apache Camel.
 
  On Tue, Apr 7, 2015 at 3:34 PM, Claus Ibsen claus.ib...@gmail.com
 wrote:
   Hi
  
   All the 150+ components is an example of this. Just pick a similar /
   simple component and see its source code.
  
   On Tue, Apr 7, 2015 at 3:12 PM, Christopher Piggott 
 cpigg...@gmail.com
  wrote:
   Hi,
  
   According to
  
 https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.15.0+Release
  
  
  - Custom components using @UriEndpoint must now include a syntax
  attribute to document the uri syntax of the endpoint, when using
 the
  apt
  compiler plugin to generate documentation.
  
  
   I'm looking for documentation on this and not really finding how to
 use
  it
   or simple examples:
  
  
  - http://camel.apache.org/endpoint-annotations.html  says what it
  is,
  but not how to use it
  -
  
 
 https://github.com/sigrist/camel-rxtx/blob/master/src/main/java/org/apache/camel/rxtx/RxTxEndpoint.java
  is an example soembody wrote that uses @UriParam ... that works
  fine, but
  when I try to add a @UriPath parameter it silently ends up  null
  - Tons of examples in git but most of them don't 

Re: BeanIODataFormat giving exception in OSGI compliant Karaf Server Camel

2015-04-07 Thread gargankur007
Hi Claus

Thanks for your interest.
Use case is Can we use a beaniodataformat depending upon the exchange
filetype or file extension?

Eg
from(file://filPath)
// do a little logging

// aggregate based on header 
correlation key
// use class 
MyAggregationStrategy for aggregation
// and complete when we have 
aggregated 14 messages
.process(new Processor() {

@Override
public void 
process(Exchange exchange) throws Exception {


System.out.println(B3);
final 
DataFormat language = new BeanIODataFormat(CSVMappings.xml,
languageFile);

System.out.println(B2

+ language.unmarshal(exchange,
exchange.getIn().getBody(InputStream.class))); 

}
})

The above code does not work and throws runtime exceptions.



--
View this message in context: 
http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404p5765442.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: file:absolute.path is not printing value

2015-04-07 Thread Claus Ibsen
Hi

You need to start from a file to have all those file mappings, eg
from uri=file:.../
The file producer, eg to uri=file: set a header with the name of the
file that was saved,

See section -
Message Headers - File producer only

At
http://camel.apache.org/file2

On Wed, Apr 8, 2015 at 3:01 AM, chaituu yarlagadd...@gmail.com wrote:
 from uri=direct:start/
 to uri=file:D://Test/?fileName=1.csv/
 log message=header.Filepath:${file:absolute.path}/
   to uri=velocity:Response.vm/

 why logger is not printing file:absolute.path?I want to print
 file:absolute.path in the velocity template.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/file-absolute-path-is-not-printing-value-tp5765449.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/


Re: how to get the value from cxf request payload

2015-04-07 Thread yogu13
Try exploring CXF InInterceptors for this.

Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-the-value-from-cxf-request-payload-tp5765452p5765459.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with high volume load in camel

2015-04-07 Thread yogu13
Incase you need to seda for any reason then setting queueSize and
blockWhenFull properties on  Seda http://camel.apache.org/seda.html  
could also help!




Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-high-volume-load-in-camel-tp5765430p5765462.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with high volume load in camel

2015-04-07 Thread yogu13
I wouldnt choose to pick the messages from the queue and write it to seda and
instead write it to files directly after picking up from the queue. Seda
seems to be an overhead in this case.

Just my thought.

Regards,
-Yogesh







--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-high-volume-load-in-camel-tp5765430p5765461.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel process evaluates XPath to a DTMNodeList object

2015-04-07 Thread yogu13
I think the default mode uses XALAN, Not that i have tried this but do check
@ http://camel.apache.org/xpath.html for configuring SAXON 
The section Setting a custom XPathFactory using System Property looks to
be an interesting option 

Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-process-evaluates-XPath-to-a-DTMNodeList-object-tp5765441p5765460.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: BeanIODataFormat giving exception in OSGI compliant Karaf Server Camel

2015-04-07 Thread Claus Ibsen
Use the data format outside the processor, so it properly gets
initialized. It would need this to work in osgi with classloading
http://camel.apache.org/data-format.html



On Tue, Apr 7, 2015 at 6:41 PM, gargankur007 gargankur...@gmail.com wrote:
 Hi Claus

 Thanks for your interest.
 Use case is Can we use a beaniodataformat depending upon the exchange
 filetype or file extension?

 Eg
 from(file://filPath)
 // do a little logging

 // aggregate based on header 
 correlation key
 // use class 
 MyAggregationStrategy for aggregation
 // and complete when we have 
 aggregated 14 messages
 .process(new Processor() {

 @Override
 public void 
 process(Exchange exchange) throws Exception {

 
 System.out.println(B3);
 final 
 DataFormat language = new BeanIODataFormat(CSVMappings.xml,
 languageFile);
 
 System.out.println(B2
   
   + language.unmarshal(exchange,
 exchange.getIn().getBody(InputStream.class)));

 }
 })

 The above code does not work and throws runtime exceptions.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404p5765442.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/


RE: Issue with high volume load in camel

2015-04-07 Thread Vanshul . Chawla
Thanks. We tested with queue to file and queue to seda and then file for 150K 
message per hour. It works fine. Beyond that, it starts slowing in 5 10 min in 
both cases.
Started 2 contexts together and it worked.

Thanks and Regards,

Vanshul Chawla

-Original Message-
From: yogu13 [mailto:yog...@gmail.com] 
Sent: Wednesday, April 08, 2015 11:05 AM
To: users@camel.apache.org
Subject: Re: Issue with high volume load in camel

Incase you need to seda for any reason then setting queueSize and blockWhenFull 
properties on  Seda http://camel.apache.org/seda.html
could also help!




Regards,
-Yogesh



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-high-volume-load-in-camel-tp5765430p5765462.html
Sent from the Camel - Users mailing list archive at Nabble.com.


file:absolute.path is not printing value

2015-04-07 Thread chaituu
from uri=direct:start/
to uri=file:D://Test/?fileName=1.csv/
log message=header.Filepath:${file:absolute.path}/
  to uri=velocity:Response.vm/

why logger is not printing file:absolute.path?I want to print
file:absolute.path in the velocity template.



--
View this message in context: 
http://camel.465427.n5.nabble.com/file-absolute-path-is-not-printing-value-tp5765449.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Marshal with quote in CSV

2015-04-07 Thread chaituu
thanks.its working now.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Marshal-with-quote-in-CSV-tp5765160p5765450.html
Sent from the Camel - Users mailing list archive at Nabble.com.


how to get the value from cxf request payload

2015-04-07 Thread chaituu
from
uri=cxf:bean:OrderEndPoint?loggingFeatureEnabled=trueamp;dataFormat=MESSAGE
/
to uri=bean:enrichBean/

I am hitting below SOAP request in SOAP UI and in the enrich bean I need to
get the orderId value?If I do doc.getElementsByTagName(v1:orderId) then
the value
will come but I cannot hardcoded the prefix before the name(v1:orderId)
because namespace prefix can be dynamic.it cannot be always v1.I need the
orderId value from the payload?


soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:v1=http://xx.xx/xx;
   soapenv:Header/
   soapenv:Body
  v1:orderRequest
 v1:orderIdabcd/v1:orderId
  /v1:orderRequest
   /soapenv:Body
/soapenv:Envelope


public class EnrichBean {

public Document enrich(Document doc) {
Node node = doc.getElementsByTagName(orderId).item(0);
String orderId = node.getTextContent();

System.out.println(orderId was  + orderId );

return doc;
}
}



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-the-value-from-cxf-request-payload-tp5765452.html
Sent from the Camel - Users mailing list archive at Nabble.com.