Re: Scala DSL - How do I give a route an id

2012-08-13 Thread Claus Ibsen
On Mon, Jul 30, 2012 at 6:25 PM, Lance Walton wrote: > Hi. > > I'm using the Scala DSL to add routes to the CamelContext. However, I also > want to be able to remove some of these routes from the CamelContext later. I > can see how to do this if I have a route id, but I can't see how to assign a

Re: Camel Custom Data Format xmljson

2012-08-13 Thread Henryk Konsek
> Colon (:) support means, I am passing soap creation data in json to camel > which I need to transform inside a soap xml which I am trying to achieve > using xml2json library Assuming that there is really no way of escaping colon in JSON keys... Maybe instead of creating your own data format, yo

Re: Camel Custom Data Format xmljson

2012-08-13 Thread Henryk Konsek
> BTW reading SOAP messages as JSON looks suspicious in the first place > :) . SOAP is a transport envelope for the message, so it is usually > created only for the time of web service communication. Do you really > need to store SOAP messages somewhere in the JSON format? I'd rethink > this approa

Re: Issue with JMS endpoint & headers that do not conform to JMS spec

2012-08-13 Thread Claus Ibsen
Hi Its documented on the Camel JMS page about the JMS spec limitations on header keys / header value types etc http://camel.apache.org/jms Also see the option jmsKeyFormatStrategy where you can provide a custom strategy On Wed, Aug 1, 2012 at 4:59 PM, Ignat wrote: > Hello, > > I think I've r

Re: New JMS connection being created for every message

2012-08-13 Thread Claus Ibsen
On Wed, Aug 1, 2012 at 10:33 PM, Christian Schneider wrote: > Just to recap what we found today. The reason for the bad performance seems > to be that camel polls for replies in the producer with a default > of 1000ms. Setting receiveTimeout=10 on the producer seems to speed up the > route a lot.

Re: Problem with getting messages via POP3

2012-08-13 Thread Claus Ibsen
Hi pop3 has limitations with delete/seen flags on processed mail messages. Use imap instead if possible. On Wed, Aug 1, 2012 at 9:38 AM, Caa_man wrote: > Hi! > > I use this route: > >uri="pop3://mail:110?password=123456&username=mas...@mail.example.com&delete=true&debugMode=true"/> > >

Re: Is it possible to create a custom DataFormat to translate a message into a BlobMessage?

2012-08-13 Thread Claus Ibsen
On Sat, Aug 4, 2012 at 7:09 AM, Pontus Ullgren wrote: > I am talking about the (spring) jms message converter used by the jms > component to create jms messages is handed the correct session. > See the messageConverter option on the JMS component page. > Yes you should use a JMS message converter

Re: How to set parameter dynamically in uri

2012-08-13 Thread Claus Ibsen
Hi See the FAQ http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html On Wed, Aug 8, 2012 at 5:15 AM, Deepthi wrote: > Hi, > > I am trying to set parameter dynamically in uri in the following manner: > > uri="file://[fo

Re: Camel-freemarker deletes Attachments from Exchange

2012-08-13 Thread Claus Ibsen
On Thu, Aug 9, 2012 at 5:38 PM, Laurentiu Trica wrote: > Hello, > > I have a problem with Camel 2.6 when a camel-freemarker deletes the > attachments from the Exchange. Is this a known issue? Can I overcome it? > Yes I think it has been fixed since. Code on trunk propagate attachments. > Many t

Re: Splitter + aggregator + dynamic timeout

2012-08-13 Thread Henryk Konsek
Hi Olek, > I'm not sure if the example I've added in the original message is visible > by you? I've added example route to the message above and it is visible via > web page.Please advice as this is my first post here :) Yeah, I can see the code via Nabble web interface, but the code formatting m

Re: Need Help converting XML-CSV(flatfile)

2012-08-13 Thread Claus Ibsen
There is also beanio http://camel.apache.org/beanio.html And the others we have listed here http://camel.apache.org/data-format.html On Fri, Aug 10, 2012 at 11:42 PM, Christian Müller wrote: > Have a look at Camel csv [1] and bindy [2]. > > [1] http://camel.apache.org/csv.html > [2] http://cam

Re: Camel Aries Blueprint dependency needs to be changed from 0.3 to 1.0.0 for Karaf 3

2012-08-13 Thread Claus Ibsen
On Fri, Aug 10, 2012 at 10:07 AM, Willem jiang wrote: > Currently only camel-blueprint has the dependency of Aries. > I don't think there are lots of work need to be do there to support Aries > Blueprint 1.0.0. > > I will create a JIRA for it once the Apache JIRA service is recovered. > We must

Re: Consuming a remote FTP server triggered by a route in Camel 2.9

2012-08-13 Thread Claus Ibsen
On Fri, Aug 10, 2012 at 9:04 PM, Pontus Ullgren wrote: > Hello, > > No it seems headers are not copied over by > ExchangeHelper.copyResultsPreservePattern(Exchange result, Exchange > source). Properties are copied are but not headers. > Headers is part of the Message and are copied as part of cop

Re: Need Help converting XML-CSV(flatfile)

2012-08-13 Thread Charles Moulliard
As you uses/knows camel-bindy, why don't you simply combine camel jaxb and camel bindy for XML <--> CSV transformation. Jaxb annotations can be added into the same model as Apache Bindy annotations. On Mon, Aug 13, 2012 at 10:25 AM, Claus Ibsen wrote: > There is also beanio > http://camel.apache

Re: Splitter + aggregator + dynamic timeout

2012-08-13 Thread Babak Vahdat
Hi the sample unit-test Alek has already provided by this thread puzzles me a bit, so I changed it to a minimum (without parallel processing) which I expect it to pass but it doesn't as "mock:result" is not satisfied: java.lang.AssertionError: mock://result Body of message: 0. Expected: <1+2+

Re: Splitter + aggregator + dynamic timeout

2012-08-13 Thread Babak Vahdat
Changing the second route as the following makes the unit-test to pass: @Override protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:sta

Re: Character set issue with File Consumer & FTP Publication

2012-08-13 Thread Claus Ibsen
Hi Maybe its related to https://issues.apache.org/jira/browse/CAMEL-5461 That on windows a stream is open on the file, and thus cannot move the file afterwards. Can you try with SNAPSHOT code? On Wed, Aug 8, 2012 at 11:33 PM, pglebow wrote: > I'm struggling with a very odd issue with Camel 2.1

Re: Camel JMX Component query

2012-08-13 Thread helander
Claus Ibsen-2 wrote > > We love contributions, however I wonder how easy it would be to setup > a syntax for specifying which JMX attributes you want to poll? That > may get message pretty quickly, if you need to configure this in a > style. > To some extent I think you can compare this with h

XPathBuilder used in Processor() throws XPathException for header variables

2012-08-13 Thread chris.koester
I am trying to get a camel header variable via an xpath expression in a processor. import org.apache.camel.builder.xml.XPathBuilder; ... from(endpointUri) .process(new Processor() { @Override public void process(Exch

Re: XPathBuilder used in Processor() throws XPathException for header variables

2012-08-13 Thread Claus Ibsen
On Mon, Aug 13, 2012 at 4:04 PM, chris.koester wrote: > I am trying to get a camel header variable via an xpath expression in a > processor. > > import org.apache.camel.builder.xml.XPathBuilder; > ... > > from(endpointUri) > .process(new Processor() { > > @Override >

Re: How to create a message manually for mock testing

2012-08-13 Thread Henryk Konsek
Hi Gael, > I am creating a Junit class and would like to create a mock representing a > message. > Is there a way to initialize "mockMessage" as a Camel Message using the > method "setBody", etc... ? Actually mocking the message is not the best way to test Camel routing, since by mocking message

Accessing activemq queue operations from a processor

2012-08-13 Thread Alberto Brosich
Hi, I have the following problem: I have a queue that receive different "types" of messages. For some of these types I need to be sure that only one message of that type is in the queue. I have two possible solutions. 1) put on the queue only if browseMessages(String selector) or browseAsTa

Re: How to create a message manually for mock testing

2012-08-13 Thread Gael Anex
Thank you very much Henryk. I'd like to mock a message to control its internals variables. Do you think it's not a good idea ? I taught it could be pretty useful to be able to check the content of a message. As I understand, it could give some random results due to hidden Camel process ? Thank

Re: Character set issue with File Consumer & FTP Publication

2012-08-13 Thread pglebow
Hi Claus, I tried with a snapshot and still encountered the error. I've detailed my test procedure below between the s; the test case was the same one that I sent previously. Phil 1. Downloaded this snapshot: https://repository.apache.org/content/repositories/snapshots/org/apache/came

Re: Character set issue with File Consumer & FTP Publication

2012-08-13 Thread Claus Ibsen
On Mon, Aug 13, 2012 at 6:30 PM, pglebow wrote: > Hi Claus, > > I tried with a snapshot and still encountered the error. I've > detailed my test procedure below between the > s; the test case was the same one that I sent previously. > > Phil > > 1. Downloaded this snapshot: > https://r

Re: Character set issue with File Consumer & FTP Publication

2012-08-13 Thread pglebow
Hi Claus, Thank you for the fix. I used https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.11-SNAPSHOT/apache-camel-2.11-20120813.030929-58.zip and the test case passes. Is there a plan to put this into a maintenance release for 2.10? We have a big

Re: How to create a message manually for mock testing

2012-08-13 Thread Henryk Konsek
> I'd like to mock a message to control its internals variables. > Do you think it's not a good idea ? > > I taught it could be pretty useful to be able to check the content of a > message. You can do it anyway with Message interface and DefaultMessage [1] class. You can retrieve headers and body.

Re: Splitter + aggregator + dynamic timeout

2012-08-13 Thread Aleksander Pena
Henryk, thanks for another way of resolving my requirements it works perfectly well, but there are missing some important req: I need to setup timeout dynamically, so the flow could looks like following: .when(body().isEqualTo("foo")) .enrich("direct:emulateLegacyHttp").timeout(property(TIME

Re: Managing the Camel libraries and Setting up the Camel Classpath

2012-08-13 Thread Christian Müller
Again, you should provide more detailed information if you want help. What was the error you got? Did you changed some Java VM parameter to solve it? Could you provode your dependency tree? Your questions are not Camel related, by the way... But yes for question 1) and I think no for 2) (Classes in

Re: Splitter + aggregator + dynamic timeout

2012-08-13 Thread Henryk Konsek
Hi Olek, I'll take a look at both timeout in my solution and in possible bug in your original one. Probably tomorrow, I'll got some spare time to analyze these issues. Laters. -- Henryk Konsek http://henryk-konsek.blogspot.com

Http4 component throws useless NPE if request body is String (instead of InputStream)

2012-08-13 Thread pmcb55
We've been using the Camel HTTP4 component for a while now, but today we wanted to call a HTTP endpoint and pass some text as input to the endpoint. But when we use 'exchange.getIn().setBody("Some input string...");' we got a very unhelpful NullPointerException (i.e. no detail information, no stack

Re: Character set issue with File Consumer & FTP Publication

2012-08-13 Thread Claus Ibsen
On Mon, Aug 13, 2012 at 7:00 PM, pglebow wrote: > Hi Claus, > > Thank you for the fix. I used > https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.11-SNAPSHOT/apache-camel-2.11-20120813.030929-58.zip > and the test case passes. > > Is there a plan to

returning xml file content as response

2012-08-13 Thread javakurious
Hi I have a very straightforward question.. In my camel config, I am trying to handle exception be returning a static xml response, indicating that there was an error. So, in tag, I just send the message to a component in a different route. And for each message in that component I just want

Re: returning xml file content as response

2012-08-13 Thread Claus Ibsen
On Tue, Aug 14, 2012 at 7:51 AM, javakurious wrote: > Hi > > I have a very straightforward question.. > > In my camel config, I am trying to handle exception be returning a static > xml response, indicating that there was an error. > > So, in tag, I just send the message to a component in > a di

Re: Http4 component throws useless NPE if request body is String (instead of InputStream)

2012-08-13 Thread Claus Ibsen
What version of Camel do you use? On Mon, Aug 13, 2012 at 9:47 PM, pmcb55 wrote: > We've been using the Camel HTTP4 component for a while now, but today we > wanted to call a HTTP endpoint and pass some text as input to the endpoint. > But when we use 'exchange.getIn().setBody("Some input strin