Re: Camel route stop consuming
Hi, Can you check the status of envioMailProcessor? It could be some thing wrong when sending the mail to user. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, August 3, 2013 at 4:53 AM, jaime.salvador wrote: Thanks for you reply, this is my routes String dd[] = { direct:mail01, direct:mail02 ... direct:mail50 }; from(activemq:mail?concurrentConsumers=15) .delay( 500 ) .loadBalance( ) .roundRobin( ) .to(dd); from( direct:mail01 ) .beanRef( envioMailProcessor01, processLoadbalancer ) . . . The envioMailProcesorXX sends a mail to the user. Using seda, only replace activemq:mail with seda:mail Thanks -- View this message in context: http://camel.465427.n5.nabble.com/Camel-route-stop-consuming-tp5736611p5736714.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: How to escape {{ and }} in a property's content
Hi, You can set another prefix and SuffixToken on your custom property component, just like this bean id=properties class=org.apache.camel.component.properties.PropertiesComponent property name=prefixToken value=((/ property name=suffixToken value=))/ /bean -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, August 4, 2013 at 7:58 PM, mananjani wrote: Hi, We are using hybris e-commerce platform, which has its own flexible search query language. It uses {{ as prefix and }} as suffix for a subquery. We want to fire such a query using camel spring dsl, but it's trying to evaluate the content within {{ and }} as a property. Here's our configuration... camel:route camel:from uri=direct:processProducts/ camel:log message=${header.fromRow} - ${property[googleProductExport.batchSize]}/camel:log camel:setBody camel:constant select {p.pk (http://p.pk)}, {p.code}, ( {{ select group_concat({pr.price} separator ', ') from {PriceRow AS pr} where {pr.product}={p.pk (http://p.pk)} }} ) AS prices, group_concat({cat.code} separator ', ') AS categories FROM {Product AS p JOIN CatalogVersion AS cv ON {cv.PK}={p.catalogVersion} JOIN Catalog AS c ON {c.PK}={cv.catalog} JOIN CategoryProductRelation AS r on {r.target}={p.pk (http://p.pk)} JOIN Category AS cat on {cat.pk (http://cat.pk)}={r.source}} WHERE {p.variantType} IS NULL AND {p.code} IS NOT NULL AND {p.name (http://p.name)} IS NOT NULL AND {c.id} = 'clothescatalog' AND {cv.version} = 'Online' group by {p.pk (http://p.pk)} LIMIT ${in.headers.fromRow}, ${googleProductExport.batchSize} /camel:constant /camel:setBody camel:to uri=jdbc:hybrisDataSource / camel:log message=${in.body}/camel:log /camel:route Can someone please let me know how to escape them? Thanks Manan -- View this message in context: http://camel.465427.n5.nabble.com/How-to-escape-and-in-a-property-s-content-tp5736742.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Expose files in a directory over HTTP
If you just watt expose the static files though jetty, you can set the org.eclipse.jetty.server.handler.ResourceHandler into the jetty consumer with option of handlers. You don't need to do it on the camel route. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, August 1, 2013 at 7:22 PM, Cristiano Costantini wrote: Hi all, Does it exist an easy way with Camel to publish a folder of static files to HTTP? I expect that it should be possible to write a route like: from uri=jetty: to uri=file: with the proper options so that the input request to jetty is used to read a file, and return it as http response via the inOut exchange. Is this possible? Any idea on which parameters to use for the two components? Thanks, Cristiano
Re: save message across exchanges
I'm not sure how do you store the headers and properties. You can store the object instance reference into the exchange properties, then camel will copy it for you across the exchanges. Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thu, Aug 1, 2013 at 11:39 PM, javamonkey79 javamonke...@gmail.comwrote: The headers and properties I have tried will only persist the message across *that* exchange, not across *multiple* exchanges. -- View this message in context: http://camel.465427.n5.nabble.com/save-message-across-exchanges-tp5736593p5736646.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: save message across exchanges
If you store the message into the exchange property, camel will copy the message reference across the exchange. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, August 1, 2013 at 3:48 AM, David Karlsen wrote: You could place a copy in a header or preferably a property. Den 31. juli 2013 20:54 skrev javamonkey79 javamonke...@gmail.com (mailto:javamonke...@gmail.com) følgende: Is there a way to store a message across exchanges? It seems like you should be able to put something in to the context, but I’m not seeing anything obvious. For now, I’m just using a bean to save off a static reference, but this seems sorta dirty. Thanks in advance. -- View this message in context: http://camel.465427.n5.nabble.com/save-message-across-exchanges-tp5736593.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: mvn build with -Pfastinstall not enabling noassembly flag?
I think the Aki's solution doesn't change the default behavior of mvn install. If we use the -Pfastinstall it will skip the assembly module automatically. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, August 1, 2013 at 3:43 AM, Christian Müller wrote: Claus, do you still -1 this change? In this case Aki, I suggest to remove the line noassemblytrue/noassembly Best, Christian - Software Integration Specialist Apache Camel committer: https://camel.apache.org/team V.P. Apache Camel: https://www.apache.org/foundation/ Apache Member: https://www.apache.org/foundation/members.html https://www.linkedin.com/pub/christian-mueller/11/551/642 On Wed, Jul 31, 2013 at 2:07 PM, Aki Yoshida elak...@gmail.com (mailto:elak...@gmail.com) wrote: Hi, thanks Raúl,. setting assembly.skipAssembly in the fastinstall profile seems to work (goes into apache-camel and does a little bit of processing but skips the assembling itself), It's not as fast as using -Dnoassembly=true explicitly which completely skips the step, though. I have to rerun it to verify it. If it is verified to work, I'll add this prop setting line in the fastinstall profile. regards, aki 2013/7/31 Raul Kripalani r...@evosent.com (mailto:r...@evosent.com): Have you tried the assembly.skipAssembly property instead? Regards, Raúl. On 19 Jul 2013 11:14, Aki Yoshida elak...@gmail.com (mailto:elak...@gmail.com) wrote: I would like to avoid the lengthy assembly step in the build at the end when I quickly just build the camel project. By looking at camel's parent/pom.xml, it seems that it was intended to not assemble the distribution when built with the fastinstall profile. profile idfastinstall/id activation property namefastinstall/name /property /activation properties maven.test.skip.exectrue/maven.test.skip.exec noassemblytrue/noassembly /properties but I see the assembly phase is always executed when I built it with -Pfastinstall. I can only disable the assembly step by setting the noassembly flag explicitly like: mvn -Dnoassembly=true -Pfastinstall Not sure if anyone have this problem, it is intended that way or has something to do with my environment? thanks. aki
Re: Camel route stop consuming
Can you show us your camel route? I'm not sure if it related to the SEDA queue is full. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, August 1, 2013 at 10:01 AM, jaime.salvador wrote: Hi, I have a big number of messages routed to a ActiveMQ queue. the route works fine at begining, but after some hours of work, Camel stop comsuming the messages from queue. I try to get out activemq and use SEDA and the same problema apears. I have the next message when I try to stop Camel: 2013-07-28 11:32:53,140 INFO [org.apache.camel.impl.DefaultShutdownStrategy] - Waiting as there are still 2262 inflight and pending exchanges to complete, timeout in 287 seconds. Any idea? Thanks a lot -- View this message in context: http://camel.465427.n5.nabble.com/Camel-route-stop-consuming-tp5736611.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel Enrich in a Loop
Splitter[1] + Aggregator[2]. [1]http://camel.apache.org/splitter.html [2]http://camel.apache.org/aggregator2.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 31, 2013 at 3:17 PM, sushil_vsk5 wrote: Hello, I have the following use case, From a route, I want to call a remote service A using CXF which gives me a list of data. For each data element in the list, I populate a response object, and then I again have to call service B to get addtional data to enrich this response object. Finally, I will return a collection of response objects. How should I implement this in the best way? For example, Response - CollectionX X f1 f2 f3 f4 Service A returns CollectionP I map from each element of this collection to create a new X with fields f1 and f2 populated. Then I call Service B which returns object Q with which I populate fields f3 and f4. Finally I return a collection of X What are the best patterns to realize this use case? -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Enrich-in-a-Loop-tp5736543.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Is it Camel Bug?
Are you using Camel ProducerTemplate to send the request to the camel context? If so , you need to stop it first. BTW, it will be helpful if you can show us what's the process thread do. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 29, 2013 at 1:56 AM, SyedBhai wrote: Sir, The question here is not about web application or standalone application. The question is camel is creating some threads. These threads are not getting terminated at all. I am having a web application. For every incoming request I create a thread to process the request. This thread uses camel framework. Because of camel the thread is not getting terminated. Because internally camel is creating more threads which keep running ever. To prove my point I copied that camel code and run it as a standalone application using main(). And even after main() finishes the program is still running. I have thus proved my point that camel is creating some threads which do not terminate at all. So I wanted to know if the bug is in camel or the components used by camel such as cxf, etc. Thanks, Syed. -- View this message in context: http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736372.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Different response messages
How did you feed the message to activemq? Have you been always sending the Event1 to the queue? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 25, 2013 at 6:52 AM, Usha13 wrote: Hello, I am using an InOut queue and configured the following route on that queue: from(activemq:queue:numbers).unmarshal(mapFormat) .choice() .when(simple(${in.body['EventType']} == 'Event1')) .convertBodyTo(String.class) .setHeader(Exchange.HTTP_METHOD, constant(GET)) .enrich(http://service1;, aggrStrategy) .when(simple(${in.body['EventType']} == 'Event2')) .beanRef(multiplier, multiply) .otherwise() .beanRef(multiplier, multiply) ; I have implemented content enricher pattern here and the aggrStrategy will retrieve a parameter from the response of service1, add it to the original request and send that new response. The first time I run this code it works fine and gives me the new response. Then next time I run it, the response I get is the response directly from service1. The aggregation strategy code is not applied and it just returns the complete response from service1. I get this response for any event type (EventType1, EventType2 etc). This happens in an alternate fashion. Meaning every second run I get the wrong response. I am using activemq component and activemq is running on my local machine. Am I missing some configuration or some piece of code here? Thank you Usha -- View this message in context: http://camel.465427.n5.nabble.com/Different-response-messages-tp5736239.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel CXF Consumer Route in OSGi not available
Hi, It looks like an issue of Talend ESB, you should ask the question in Talend forum. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 25, 2013 at 6:21 AM, Hilderich wrote: Hello folks! We have two Camel CXF Consumer Routes built. Each route is in a different bundle (OSGi). Theses bundles are running in Apache Karaf 2.3.1. I have read the article on Camel Website http://camel.apache.org/cxf-example-osgi-blueprint.html in order to build and reach the web services correctly. We could install the bundles inside Karaf without any error notifications though the web service endpoints are not reachable. Furthermore the camel context in each bundle was started correctly. Pax Web was configured correctly as the article stated and all required Karaf features were installed also. To be honest with a plain Apache Karaf 2.3.1 it was possible to reach all Web Service Endpoints but with a pre-configured Apache Karaf 2.3.1 by Talend ESB 5.3.1 it's not possible to reach these endpoints. That makes it hard to figure out why. Do you have any ideas? Cheers Hilderich -- View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-Consumer-Route-in-OSGi-not-available-tp5736238.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Mina Component Question
Hi, Do you need to listen to the same socket that you use to send the request? Or do you just start a new port to listen to call back message? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 25, 2013 at 10:09 AM, Gershaw, Geoffrey wrote: Hello All, I am using the mina component as a client to connect to server. The interaction between the client and server is sometimes request reply, but it can also be request and listen. I understand how to implement the request and reply scenario. How do I listen to the mina endpoint continuously? In other words, I send a request for a stock's price, and I listen to the socket and prices come all day. It seems like I need more than just the mina component. I was looking into the polling consumer. Am I on the right track? Thanks Geoffrey A Gershaw === Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===
Re: camel error with simple program with camel-core-2.11.1.jar
Which version JDK are you using? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 22, 2013 at 12:33 PM, vinay wrote: update.. I get following warning when starting camel... WARNING: Module [camel-groovy] - Unable to load extension class [class org.apach e.camel.groovy.extend.CamelGroovyMethods] due to [org/apache/camel/Expression]. Maybe this module is not supported by your JVM version. regards, Vinay -- View this message in context: http://camel.465427.n5.nabble.com/camel-error-with-simple-program-with-camel-core-2-11-1-jar-tp5735829p5736000.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel cache consumer (event based)
Hi, Did you have chance to check out the example5 of this wiki page[1]? [1]http://camel.apache.org/cache.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 22, 2013 at 2:46 PM, rrajen2 wrote: Hi I have a Camel cache producer built using EHCache. I was wondering if I want a event-based Cache consumer to consume from it, how would I be able to do it? Assume I have a Cache named cache://testCache with its producer built. Please share sample code demonstrating a event based consumer from the cache cache://testCache showing cache changes like addition/update/delete events. Thanks -- View this message in context: http://camel.465427.n5.nabble.com/Camel-cache-consumer-event-based-tp5736001.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel Example Restlet JDBC Master
Hi, How did you find the the example? I don't think we ship this example within Apache Camel kit. If it is using maven, it could be easy to check the dependency issue by using mvn dependency:tree. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 23, 2013 at 3:17 AM, tKronos wrote: I am trying to get the example called Camel Example Restlet JDBC Master working. But everytime I try running it, I get the following error: Could not instantiate listener org.springframework.web.context.ContextLoaderListener (http://web.context.ContextLoaderListener) Plus a bunch of other errors following that with the class not being found and such. I think it is a versioning problem with some of the dependencies or something. If someone knows what dependencies and what versions I need to make this example work I would be very grateful. I am using Camel version 2.11.0. Thank you very much. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Example-Restlet-JDBC-Master-tp5736048.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: NPE with splitter, aggregator and JMS - properties and transferExchange option
I suggest you clean up the exchange properties before trying to marshall the properties. From the stack trace, it looks like there are some trouble to marshall the CXF XMLMessage which could be store into the exchange properties. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 22, 2013 at 6:42 PM, Martin Stiborský wrote: Fortunately I can solve the problem with kind of workaround - not passing exchange to JMS and use just Exchange headers. That works for me. Anyway i'd like to know what is wrong with the transferExchange=true solution. On Mon, Jul 22, 2013 at 12:01 PM, Martin Stiborský martin.stibor...@gmail.com (mailto:martin.stibor...@gmail.com) wrote: Hello guys, I have a route, where List from Exchange body is splitted and each item is sent to JMS, the main route waits for response, performs some more transformation and then continue with next item from the list in the same way. All the response are aggregated into another list, which is processed once the splitter get its job done. In the JMS route, I need to use some Exchange properties, so I used tranferExchange=true option for both JMS producer and consumer endpoint. But I have strange problem there, sometime it works, sometimes not and the NPE exception is raised. I can't find the wrong point, it seems that the problem is with properties when transferring the exchange to JMS route. I broke the code into smaller pieces and wrote some unit tests to locate the problem. Here is link to the test, the routes there describes what I'm doing, in simplified version: https://gist.github.com/stibi/6052674 Here is the jaxrs service resource class: https://gist.github.com/stibi/6052697 Could you guys try to run the test? Or if you spot something completely wrong there, please let me know. Sometimes the route works, the second test pass green (the first one without transferring the exchange always pass), but sometimes this exception occur: https://gist.github.com/stibi/6052726 I'm running Camel 2.11.0. Maybe it could be related to this issues: https://issues.apache.org/jira/browse/CAMEL-6218 -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz (mailto:st...@njs.netlab.cz) Twitter: http://www.twitter.com/stibi -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz (mailto:st...@njs.netlab.cz) Twitter: http://www.twitter.com/stibi
Re: Camel HTTP component vs. Apache HTTP client
Do you know what's the size of the XML file? Camel will try to cache the XML input stream into a file if the input stream size is big than 64K. You can set the size bigger to avoid caching the input stream into a file by setting the properties in CamelContext like context.getProperties().put(CachedOutputStream.THRESHOLD, 1048576); You can find more information here[1] [1]http://camel.apache.org/stream-caching.html On Mon, Jul 22, 2013 at 1:50 AM, humayun0156 humayun0...@gmail.com wrote: i've used http4 component and test my code. but it still took 600-800 ms per request. my route looks like : from(direct:npGet) .setHeader(Exchange.HTTP_METHOD, constant(GET)) .setProperty(url, simple(${body})) .setHeader(Exchange.HTTP_URI, simple(${body})) .to(http4://dummyHost.com? + npAuthenticationString) .convertBodyTo(Document.class) .bean(HelperBean.class, setUrlETagMapping) .process(new ObjectCreationProcess(xmlToObjectMapping)); -- View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-component-vs-Apache-HTTP-client-tp5735943p5735974.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Message Processing Performance while splitting
When you add more processors into the route, camel need to do lots of addition work to handle the message. If you want a good performance, you should use the Java code to do the loop in a single method. But it could be good method for us find the hot spots the performance those camel introduces. Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Mon, Jul 22, 2013 at 4:29 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi You cant really compare the 2 approaches. In the pure java code you just have a for loop in a single method which is as fast as you can go. When using Camel routes and the EIPs then a lot more goes on under the hood. On Sun, Jul 21, 2013 at 10:12 PM, Viktor Kubinec vikto...@seznam.cz wrote: Thanks Willem. I've created custom splitter, which is using BufferedReader, just as you suggested. It has improved the performance a bit but it is still much slower (10-20x) than the java code that I posted. I have spent bit more time investigating this problem. The code (with documentation on how to use it) is available here : https://github.com/Viktor-Kubinec/Camel I am using Apache Camel verison 2.11.1. My test file is ~1Gb large, contains 100M rows with message Test Line in each row. I have two testing scenarios : 1. SplitTest - I just read big file containing short lines, split it line by line with my custom splitter and logging the process (every 50k-th message) 2. Same as 1. but I've added 10 processors that do nothing (because I observed that adding processors reduces performance) Results : java code : 1.5-2M lines per second - no profiling done 1. 150k lines per second and here are some hot spots (from VisualVM) : java.lang.Class.getSimpleName() (57.3%) org.apache.camel.processor.MulticastProcessor.doAggregate() (39.2%) java.io.BufferedReader.readLine()(3.1%) ... 2. 72k lines per second : org.apache.camel.processor.MulticastProcessor.doAggregate() (70.5%) java.lang.Class.getSimpleName() (28.8%) java.io.BufferedReader.readLine() (0.3%) ... I have saved snapshots from VisualVM - they are available in the github repository (link above) : SplitTest.nps, SplitTestWithProcessors.nps. More details are available there. This was done on my laptop. I've read that VisualVM has some effect on performance (~5%). java.lang.Class.getSimpleName() is being called in constructor of org.apache.camel.impl.DefaultUnitOfWork. In first scenario only 3.1% of thread time was spent in the readLine() method. In second scenario it was only 0.3%. That is very low. Is there a way how I can optimize this? Thanks, Viktor -- View this message in context: http://camel.465427.n5.nabble.com/Message-Processing-Performance-while-splitting-tp5735824p5735979.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
Re: After camelContext shutdown, is any way to exit the Java main() method?
As you are using camel main to start the camel context. You need to call the System.exit() when the Camel context is stopped. Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Mon, Jul 22, 2013 at 10:40 AM, bonnahu bonn...@gmail.com wrote: Hi guys, I got another question here. I start my camelContext in the main(), then in the route, I stop the camelContext in a Processor. Now I can see the camelContext is shutdown gracefully. However, the Java application is still running. My question is that whether there is a way to exit the Java main() automatically after the camelContext is shutdown. public static void main(String[] args) throws Exception { String filename = META-INF/spring/testingcontext.xml; Main main = new Main(); main.setApplicationContextUri(filename); main.enableHangupSupport(); main.run(); } public class DownloadLogger implements Processor { public void process(final Exchange exchange) throws Exception { System.out.println(We just downloaded: + exchange.getIn().getHeader(CamelFileName)); Thread stop = new Thread() { @Override public void run() { try { //exchange.getContext().stopRoute(myRoute); exchange.getContext().getShutdownStrategy().setTimeout(5); exchange.getContext().stop(); } catch (Exception e) { // ignore } } }; stop.start(); System.out.println(after camel context stop); } } I thansk in advance! Lei -- View this message in context: http://camel.465427.n5.nabble.com/After-camelContext-shutdown-is-any-way-to-exit-the-Java-main-method-tp5735993.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel HTTP component vs. Apache HTTP client
It makes sense that camel has lots of things to do beside processing the message as you do with HttpClient. Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Mon, Jul 22, 2013 at 11:26 AM, humayun0156 humayun0...@gmail.com wrote: my xml files are not more than 5kb and i don't want to cache them. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP-component-vs-Apache-HTTP-client-tp5735943p5735995.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel HTTP4, not able to use httpContext endpoint option
Hi, Can you show us more about the cause of the exception? As the NoSuchBeanException should have the cause of the exception. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, July 20, 2013 at 10:12 PM, lmanchanda75 wrote: Hi, I want to set preemtive auth On of the servers, I am using http4 component, going through various posts/camel documentation (http://camel.apache.org/http4.html), I arrived at conclusion that I need to set httpContext on the component/endpoint. I wrote a small piece of code to create HttpContext and called the same in blueprint to set my bean in registry as shown below: public class HttpContextFactory { Code- public static HttpContext getObject(String httpHost,Integer httpPort) { HttpContext httpContext = new BasicHttpContext() ; BasicAuthCache authCache = new BasicAuthCache(); BasicScheme basicAuth = new BasicScheme(); authCache.put(new HttpHost(httpHost, httpPort), basicAuth); httpContext.setAttribute(ClientContext.AUTH_CACHE, authCache); return httpContext; } } Blueprint - bean id=messageBrokerAuthContext class=manchanda.lalit.TryCxfSmooks.HttpContextFactory factory-method=getObject argument value=172.168.1.100/ argument value=1443/ /bean Usage - http4://172.168.1.100?authUsername=useramp;authPassword=passwordamp;httpContext=messageBrokerAuthContext During execution I get the following error- Caused by: org.apache.camel.NoSuchBeanException: Found bean: messageBrokerAuthCo ntext in BlueprintContainer: org.apache.aries.blueprint.container.BlueprintConta inerImpl@c8f24 of type: org.apache.http.protocol.BasicHttpContext expected type was: interface org.apache.http.protocol.HttpContext This does not seem to be correct as it will never be possible to get instance of HttpContext type it being an Interface. How can I solve my problem of setting preemptive auth? Regds Lalit -- View this message in context: http://camel.465427.n5.nabble.com/Camel-HTTP4-not-able-to-use-httpContext-endpoint-option-tp5735937.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: invoking camel route
If you want to invoke the route, you still need to send a message to the route, even the message body and header are empty. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, July 19, 2013 at 11:32 AM, Tarun Kumar wrote: Hi Claus, My camelContext has 1 route. From testMethod, i dont want to send any body or headers. i just want to invoke route1 from this method. On Thu, Jul 18, 2013 at 9:33 PM, Claus Ibsen claus.ib...@gmail.com (mailto:claus.ib...@gmail.com) wrote: Hi See this page http://camel.apache.org/walk-through-an-example.html You can use a producer template to send a message to a Camel route from java code. On Thu, Jul 18, 2013 at 5:58 PM, Tarun Kumar agrawal.taru...@gmail.com (mailto:agrawal.taru...@gmail.com) wrote: Hi, I want to invoke camel route from java code. CamelContext doesn't seem to have any method to invoke route. Here is what my code looks like: @Autowired private CamelContext cc; public void testMethod() { System.out.println(cc.getRouteStatus(route1)); // prints true // how to invoke this route - route1 from here? } -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com (mailto:cib...@redhat.com) Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Replacing standalone client with generic one in cxf component
Hi, What's the operation that your standalone client is invoking? If you know which operation your client should invoke, you can set it throughout the camel-cxf endpoint uri. If you want to change it dynamically, you can setup the message header per invocation. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, July 18, 2013 at 12:31 PM, cannykanna wrote: HI I have a wsdl with has many operations and input parameters defined for each. Now I wrote a standalone client with talks to my endpoint which exposes its services through webservices. This client talks with this endpoint and only one operation is defined in it. Now What I am looking is as follows. From my starting triggering point I say I have to hit the endpoint and do one operation on it say get operation. Now through Camel the the message has to pass as defined by our routing and hit that endpoint and give back the response as per our routing. For this my client has to be replaced by a generic one. How can I do this..? Any ideas? And through my endpoint I can do any operation uses SOAP messages only.? Does camel has SOAP Component? For Any Extra Information, feel free to ask. Regards, Kannaiah -- View this message in context: http://camel.465427.n5.nabble.com/Replacing-standalone-client-with-generic-one-in-cxf-component-tp5735827.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Groovy script synchronized issue with 2.10.x and 2.11.x prevents camel groovy script for High Concurrenc
The ScriptEngine evaluate method is not thread safe, I think you can use seda component to cache the request in the queue, then using one consumer to processing the groovy script. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 18, 2013 at 1:21 AM, apatel wrote: In below code why method is synchronized? This prevents camel groovy script for High Concurrency. protected synchronized Object evaluateScript(Exchange exchange) { try { getScriptContext(); populateBindings(getEngine(), exchange); addScriptEngineArguments(getEngine(), exchange); Object result = runScript(exchange); LOG.debug(The script evaluation result is: {}, result); return result; } catch (ScriptException e) { if (LOG.isDebugEnabled()) { LOG.debug(Script evaluation failed: + e.getMessage(), e); } throw createScriptEvaluationException(e.getCause()); } catch (IOException e) { throw createScriptEvaluationException(e); } } I've below two routes. When i tested this route with 1 tps it returns responses in avg 1005 ms but when i tested same route with 5tps it returns responses in avg 8005 ms. My goal is tuning this routes for High Concurrency. route xmlns=http://camel.apache.org/schema/spring; trace=true from uri=restlet:/test/v1.0/testGroovyWait/ to uri=direct:test.directGroovyWait.v1.0/ /route route xmlns=http://camel.apache.org/schema/spring; errorHandlerRef=noErrorHandler from uri=direct:test.directGroovyWait.v1.0/ setHeader headerName=foo groovy Thread.sleep(1000) return OK /groovy /setHeader setBody headerfoo/header /setBody /route I think we've found the root cause of our groovy performance problem. I did a little testing this morning and found that a single thread test with the route that waits 1 second had an average response time of about 1005 milliseconds. When I took this to 5 threads the average response time went up to 4389. When I went to 10 threads the average went to 9169. This is all without any pauses in the script so each thread is hitting the server as soon as the result returns. Here's the pattern of response times at the beginning of the 10 thread test: 1004, 1101, 2201, 3303, 4403, 5504, 6605, 7705, 8806, 9908, 2000, 4001, 6001, 8002, 10003, 12003, 14005, 16005, 18006 Interestingly the 3rd thread took 2.2 seconds, the 4th thread took 3.3 seconds, the 5th thread 5.5 seconds and so on. This clearly pointed to some sort of semaphore or single resource that each thread was waiting for in turn. I took a look at the active threads using console. Here's where most of the worker threads (http-bio-8080-exec-n) were waiting: Name: http-bio-8080-exec-3 State: BLOCKED on org.apache.camel.builder.script.ScriptBuilder@12349d8 owned by: http-bio-8080-exec-6 Total blocked: 99 Total waited: 271 Stack trace: org.apache.camel.builder.script.ScriptBuilder.evaluateScript(ScriptBuilder.java:338) org.apache.camel.builder.script.ScriptBuilder.evaluate(ScriptBuilder.java:92) org.apache.camel.builder.script.ScriptBuilder.evaluate(ScriptBuilder.java:96) org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103) org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) from --Doug -- View this message in context: http://camel.465427.n5.nabble.com/Groovy-script-synchronized-issue-with-2-10-x-and-2-11-x-prevents-camel-groovy-script-for-High-Concurc-tp5735815.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Groovy script synchronized issue with 2.10.x and 2.11.x prevents camel groovy script for High Concurrenc
I think we can cache the ScriptEngine as a thread local variable, and we need to find a way to clean up these variables when the camel route is shutdown. So I just fill a JIRA[1] for it. [1] https://issues.apache.org/jira/browse/CAMEL-6559 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 18, 2013 at 3:01 PM, Willem jiang wrote: The ScriptEngine evaluate method is not thread safe, I think you can use seda component to cache the request in the queue, then using one consumer to processing the groovy script. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 18, 2013 at 1:21 AM, apatel wrote: In below code why method is synchronized? This prevents camel groovy script for High Concurrency. protected synchronized Object evaluateScript(Exchange exchange) { try { getScriptContext(); populateBindings(getEngine(), exchange); addScriptEngineArguments(getEngine(), exchange); Object result = runScript(exchange); LOG.debug(The script evaluation result is: {}, result); return result; } catch (ScriptException e) { if (LOG.isDebugEnabled()) { LOG.debug(Script evaluation failed: + e.getMessage(), e); } throw createScriptEvaluationException(e.getCause()); } catch (IOException e) { throw createScriptEvaluationException(e); } } I've below two routes. When i tested this route with 1 tps it returns responses in avg 1005 ms but when i tested same route with 5tps it returns responses in avg 8005 ms. My goal is tuning this routes for High Concurrency. route xmlns=http://camel.apache.org/schema/spring; trace=true from uri=restlet:/test/v1.0/testGroovyWait/ to uri=direct:test.directGroovyWait.v1.0/ /route route xmlns=http://camel.apache.org/schema/spring; errorHandlerRef=noErrorHandler from uri=direct:test.directGroovyWait.v1.0/ setHeader headerName=foo groovy Thread.sleep(1000) return OK /groovy /setHeader setBody headerfoo/header /setBody /route I think we've found the root cause of our groovy performance problem. I did a little testing this morning and found that a single thread test with the route that waits 1 second had an average response time of about 1005 milliseconds. When I took this to 5 threads the average response time went up to 4389. When I went to 10 threads the average went to 9169. This is all without any pauses in the script so each thread is hitting the server as soon as the result returns. Here's the pattern of response times at the beginning of the 10 thread test: 1004, 1101, 2201, 3303, 4403, 5504, 6605, 7705, 8806, 9908, 2000, 4001, 6001, 8002, 10003, 12003, 14005, 16005, 18006 Interestingly the 3rd thread took 2.2 seconds, the 4th thread took 3.3 seconds, the 5th thread 5.5 seconds and so on. This clearly pointed to some sort of semaphore or single resource that each thread was waiting for in turn. I took a look at the active threads using console. Here's where most of the worker threads (http-bio-8080-exec-n) were waiting: Name: http-bio-8080-exec-3 State: BLOCKED on org.apache.camel.builder.script.ScriptBuilder@12349d8 owned by: http-bio-8080-exec-6 Total blocked: 99 Total waited: 271 Stack trace: org.apache.camel.builder.script.ScriptBuilder.evaluateScript(ScriptBuilder.java:338) org.apache.camel.builder.script.ScriptBuilder.evaluate(ScriptBuilder.java:92) org.apache.camel.builder.script.ScriptBuilder.evaluate(ScriptBuilder.java:96) org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103) org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) from --Doug -- View this message in context: http://camel.465427.n5.nabble.com/Groovy-script-synchronized-issue-with-2-10-x-and-2-11-x-prevents-camel-groovy-script-for-High-Concurc-tp5735815.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Message Processing Performance while splitting
Hi , Camel is using java.util.Scanner for splitting the input stream by using token \n. So it makes sense that it is slower then using the BufferedReader to read the file. You can read the file yourself by implementing a customer splitter just like the ZipFile does[1] [1]https://issues.apache.org/jira/browse/CAMEL-6139 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 18, 2013 at 10:28 AM, Vic wrote: I am processing big file - line by line with camel. The average amount of processed messages per second is 30k. When I do the same in java using BufferedReader - the average amount of processed messages per second is 500k. I am processing the same file. This is significant performance lost. Am I doing something wrong in Camel? camel route : from(file:C:/Test?fileName=test_file.txtnoop=true) .split().tokenize(\n).streaming() .to(log:INFO?groupSize=1); java code: FileReader fr = new FileReader(C:/Test/test_file.txt); BufferedReader br = new BufferedReader(fr); long count = 0; long start = System.currentTimeMillis(); while(br.readLine() != null) { count++; if(count % 1 == 0) { long now = System.currentTimeMillis(); long msgPerSecond = 1000*count/(now-start); System.out.println(msgPerSecond); } } br.close(); -- View this message in context: http://camel.465427.n5.nabble.com/Message-Processing-Performance-while-splitting-tp5735824.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Work with Exchange.HTTP_QUERY
There are two character of ?. Can you change the recipientList to .recipientList(simple(${body}authMethod=BasicauthUsername=userauthPassword=pass) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 18, 2013 at 4:35 PM, humayun0156 wrote: Hi, I've an url with query parameters which is dynamically generated. i don't know how many parameters there are. i want to hit the url and get the body. say my url looks like : http://myhost.com?name=xxxid=yyy it needs basic authentication. so i request Object object = producerTemplate.requestBody(direct:get, url); and my route is : from(direct:epGet) .setHeader(Exchange.HTTP_METHOD, constant(GET)) .recipientList(simple(${body}?authMethod=BasicauthUsername=userauthPassword=pass)); but when i run there is an error. The exchange message body is set correctly Endpoint[direct://epGet] Exchange[Message: http://myhost.com?name=xxxid=yyy] but it creates the following endPoint which is not correct. DEBUG DefaultComponent:117 - Creating endpoint uri=[http://myhost.com?authPassword=**authUsername=userid=yyyname=xxx%3FauthMethod%3DBasic], path=[myhost.com (http://myhost.com)] to resolve this query param what should i do? any idea? -- View this message in context: http://camel.465427.n5.nabble.com/Work-with-Exchange-HTTP-QUERY-tp5735839.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Hessian support (from/to endpoints)
Hi, I don't think we have the camel-hessina component, and we love contribution, please share the idea with us :) I think you can take a look at the camel-xmlrpc[1] component I just have quick question of the methodName option. What's the prepose of methodName? If you need to specify the methodName, you may also need to provide a Interface class for camel-hassina endpoint to use. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 17, 2013 at 3:54 PM, flangel wrote: Hi, what is the current state of hessian support. I like to use Hessian as a from endpoint, i.e. start the route by exposing an http endpoint and decoding the payload. Something along the line of from (hessian:\\uri). Currently, i am using an http endpoint and add a processor that decodes the hessian wire protocol/payload. Question: 1. Does a Hessian component that provides a consumer (From) endpoint already exist. I could not find any source code/examples. 2. If not, and if you are experienced with Hessian, what would a good api be for the hessian from endpoint. What about from (hessian:\\uri\Service?methodName=method1). This would create an endpoint waiting for the invocation of method1 through a client. The client created a factory connection to \\uri\Service previously to invoking the method. 3. the to case would be rather simple to(hessian:\\uri\service?methodName=method1) with the parameters in the header Your feedback is appreciated Best Frank -- View this message in context: http://camel.465427.n5.nabble.com/Hessian-support-from-to-endpoints-tp5735774.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Ftp connection through SOCKS Proxy.
As you know current camel-ftp is based of common net API, if the NET-468 patch is released, I think we can easily as the support of setting the Proxy object. Please feel free to fill a JIRA[1] and we can keep it in mind :) [1]https://issues.apache.org/jira/browse/CAMEL -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 17, 2013 at 1:59 AM, ninadmnaik wrote: In our project, we need to establish FTP connection through a SOCKS proxy. Since Camel uses Apache Commons Net API underneath for FTP connections, I tried looking into how Commons Net API supports this. Till last year, the only way to achieve this was to set Java's System Properties as explained here: http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions But according to Java docs (http://docs.oracle.com/javase/6/docs/technotes/guides/net/properties.html): If socksProxyHost is specified then all TCP sockets will use the SOCKS proxy server to establish a connection or accept one. The following patch seems to address this problem by using the Proxy class in Java 6 http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html Patch to apache commons net: https://issues.apache.org/jira/browse/NET-468 So is there a way in Camel to achieve this? The FTP component link: http://camel.apache.org/ftp.html and the book: Camel In Action don't indicate that this feature is available in Camel yet. Can you please advice on this? Thanks, Ninad. -- View this message in context: http://camel.465427.n5.nabble.com/Ftp-connection-through-SOCKS-Proxy-tp5735735.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel resources URI into OSGi environment
Hi, I just checked the code of XsltUriResolver code in the trunk, it should be resolved since Camel 2.11.x. You may need to consider to upgrade the Camel version of it. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 16, 2013 at 8:53 PM, Cristiano Costantini wrote: Hi all again, in the end I think I've detected an issue, I don't know ho to report it, I don't even know if it is a Camel or ServiceMix/Karaf issue. I report here what it is about and please help me pointing me to report it the right way. The full problem is: - If I deploy a route using beans.xml file, - in a ServiceMix 4.5.1 running under windows 7 - where I have an XSLT endpoint which point to a resource in the folder src/main/resources/subfolder i.e.: to uri=xslt://subfolder/file.xsl / the file file.xsl is not seen an the following error is throw: 2013-07-16 14:21:16,589 | ERROR | xtenderThread-12 | ContextLoaderListener | 80 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=test-xslt-bundle, config=osgibundle:/META-INF/spring/*.xml)) org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route cxfEntryRoute at: Choice[[When[xpath{//*[local-name()='alert']} - [To[xslt://subfolder/file.xsl]]], Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] in route: Route[[From[cxf:bean:cxfEntry]] - [Choice[[When[xpath{... because of Failed to resolve endpoint: xslt://subfolder/file.xsl due to: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder\file.xsl at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)[96:org.apache.camel.camel-core:2.10.4] [...] Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route cxfEntryRoute at: Choice[[When[xpath{//*[local-name()='alert']} - [To[xslt://subfolder/file.xsl]]], Otherwise[[To[log:messagesNotManaged?showAll=true], Stop]]] in route: Route[[From[cxf:bean:cxfEntry]] - [Choice[[When[xpath{... because of Failed to resolve endpoint: xslt://subfolder/file.xsl due to: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder\file.xsl at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:879)[96:org.apache.camel.camel-core:2.10.4] [...] Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: xslt://subfolder/file.xsl due to: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder\file.xsl at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:479)[96:org.apache.camel.camel-core:2.10.4] [...] Caused by: javax.xml.transform.TransformerException: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder\file.xsl at org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:83)[96:org.apache.camel.camel-core:2.10.4] [...] Caused by: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder\file.xsl at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:106)[96:org.apache.camel.camel-core:2.10.4] at org.apache.camel.builder.xml.XsltUriResolver.resolve(XsltUriResolver.java:81)[96:org.apache.camel.camel-core:2.10.4] [...] Relevant clues: - the same problem does not happen on linux - if I don't use a subfolder i.e. to uri=xslt://file.xsl /, the route works also on windows. - the error is throw when installing the bundle - the same problem is not present when running the route in a java application, only when deploying to ServiceMix - the same problem does not happen on the velocity component which has similar way to resolve velocity templates resources (i.e. a route with to uri=velocity://subfolder/template.vm / works on windows). Additional Clue: - if I use a bad resource name on velocity template, i see that velocity does not change the slash to backslash i.e. error due to bad name of file subfolder/bad_resource_name.vm, 2013-07-16 14:42:46,567 | ERROR | ault-workqueue-2 | DefaultErrorHandler | 96 - org.apache.camel.camel-core - 2.10.4 | Failed delivery for (MessageId: ID-AOCC-WS2-50100-1373969104441-9-3 on ExchangeId: ID-AOCC-WS2-50100-1373969104441-9-4). Exhausted after delivery attempt: 1 caught: java.io.FileNotFoundException: Cannot find resource in classpath for URI: subfolder/bad_resource_name.vm java.io.FileNotFoundException: Cannot find resource in classpath for URI: vm/bad_resource_name.vm at org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream
Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option
Hi Which version of Camel are you using? This issue is related to the schema definition, I think you need to disable the Spring schema validation[1] I just checked the latest camel spring schema, the attribute type of autoStartup is string now, which means you will not hit this kind of issue in latest released Camel. [1]http://stackoverflow.com/questions/4160104/disable-schema-validation-in-spring-3 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, July 14, 2013 at 5:38 AM, bonnahu wrote: Hey guys, I am new to Camel. Currently, I want to use PropertyPlaceholderConfigurer to specify the autoStartup option in Camel route. Here is the PropertyPlaceholderConfigurer bean: bean id=inventoryProperties class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer property name=locations list value autostartup.properties /value /list /property /bean Here is the content of the autostartup.properties file: route.autostart=true Here is what I use in the spring DSL xml: route id=testingRoute1 autoStartup = ${route.autostart} The error I got is [OnException[[class... because of Error parsing [${route.autostart}] as a Boolean. Can anyone help me here? -- View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: org.apache.camel.CamelException: Cannot connect to
When you using 0.0.0.0:7000 on the server side, netty will listen to all the net work interfaces, such as localhost and ips which you can access outside. But 0.0.0.0 don't work for the client side, because we don't know which address it really means, it could localhost or the other network interface. You'd better change the address to localhost just like this from(netty:tcp://0.0.0.0:7000?textline=true) .bean(MainDummyProcessor.class) .to(netty:tcp://0.0.0.0:7001?textline=true).to(netty:tcp://localhost:7004?textline=true) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 10, 2013 at 4:35 PM, kiranreddykasa wrote: Hi , while performing load testing on the following route I am getting these error for *some *messages from(netty:tcp://0.0.0.0:7000?textline=true) .bean(MainDummyProcessor.class) .to(netty:tcp://0.0.0.0:7001?textline=true).to(netty:tcp://0.0.0.0:7004?textline=true) .bean(MainDummyProcessor.class) .to(netty:tcp://0.0.0.0:7002?textline=true).to(netty:tcp://0.0.0.0:7004?textline=true) .bean(MainDummyProcessor.class) .to(netty:tcp://0.0.0.0:7003?textline=true).to(netty:tcp://0.0.0.0:7004?textline=true) .bean(MainDummyProcessor.class); Here is the full stacktrace ERROR 10 Jul 2013 12:32:35,252 org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-FSSCHN61-59989-1373476603039-0-73530 on ExchangeId: ID-FSSCHN61-59989-1373476603039-0-61620). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelException: Cannot connect to 0.0.0.0:7001 org.apache.camel.CamelException: Cannot connect to 0.0.0.0:7001 at org.apache.camel.component.netty.NettyProducer.openChannel(NettyProducer.java:404) at org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:472) at org.apache.camel.component.netty.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:467) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188) at org.apache.camel.component.netty.NettyProducer.process(NettyProducer.java:215) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73
Re: Get the exception org.apache.camel.RuntimeCamelException: java.lang.RuntimeException: Protocol mismatch for port 443: engine's protocol is http, the url protocol is https
Hi, If you changed the protocol form http to https, you need to add some configuration on the Jetty engine just like this[1] [1]http://cxf.apache.org/docs/jetty-configuration.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, July 12, 2013 at 5:18 PM, cannykanna wrote: Hi I am using the camel-cxf example and created a project in eclipse. In src/main/java org.apache.camel.example.Provider package, I created my own Client which talks to end application. I used this client in my CamelCxfExample.java Class and modified the tester bean as well. Now I modified the CamelCXFProviderRouteConfig.xml in the same project. Now when I run mvn exec:java -PWebServiceProvider command from eclipse, I am getting below stack of error: [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Camel :: Example :: CXF 2.11.0 [INFO] [INFO] [INFO] exec-maven-plugin:1.1.1:java (default-cli) @ camel-example-cxf [INFO] [INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-example-cxf --- [INFO] [INFO] exec-maven-plugin:1.1.1:java (default-cli) @ camel-example-cxf [INFO] [INFO] --- exec-maven-plugin:1.1.1:java (default-cli) @ camel-example-cxf --- [rovider.CamelCxfExample.main()] ClassPathXmlApplicationContext INFO Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@6b5b5783: startup date [Fri Jul 12 12:35:44 IST 2013]; root of context hierarchy [rovider.CamelCxfExample.main()] XmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/spring/CamelCXFProviderRouteConfig.xml] [rovider.CamelCxfExample.main()] XmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml] [rovider.CamelCxfExample.main()] ClassPathXmlApplicationContext INFO Bean 'cxf' of type [class org.apache.cxf.bus.spring.SpringBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) [rovider.CamelCxfExample.main()] DefaultListableBeanFactory INFO Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3da997a: defining beans [bridgePropertyPlaceholder,cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,testBean,soapMessageEndpoint,template,consumerTemplate,test_context:beanPostProcessor,test_context]; root of factory hierarchy [rovider.CamelCxfExample.main()] CamelContextFactoryBean INFO Bridging Camel and Spring property placeholder configurer with id: bridgePropertyPlaceholder [rovider.CamelCxfExample.main()] SpringCamelContext INFO Apache Camel 2.11.0 (CamelContext: test_context) is starting [rovider.CamelCxfExample.main()] ManagementStrategyFactory INFO JMX enabled. [rovider.CamelCxfExample.main()] DefaultTypeConverter INFO Loaded 196 type converters [rovider.CamelCxfExample.main()] ReflectionServiceFactoryBean INFO Creating Service {http://www.service-now.com/incident}ServiceNow_incident from WSDL: wsdl/incident.do.wsdl [rovider.CamelCxfExample.main()] SpringCamelContext INFO Apache Camel 2.11.0 (CamelContext: test_context) is shutting down [rovider.CamelCxfExample.main()] SpringCamelContext INFO Uptime 0.898 seconds [rovider.CamelCxfExample.main()] SpringCamelContext INFO Apache Camel 2.11.0 (CamelContext: test_context) is shutdown in 0.004 seconds Get the exception org.apache.camel.RuntimeCamelException: java.lang.RuntimeException: Protocol mismatch for port 443: engine's protocol is http, the url protocol is https My endpoint application runs on https protocol. Can you please help me.? -- View this message in context: http://camel.465427.n5.nabble.com/Get-the-exception-org-apache-camel-RuntimeCamelException-java-lang-RuntimeException-Protocol-mismatcs-tp5735568.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Cannot access CamelLoopIndex in route using spel
Hi, If you want to access the CamelLoopIndex, you should use properties['CamelLoopIndex'] instead of property(CamelLoopIndex). -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 15, 2013 at 9:24 AM, bocamel wrote: I need to access CamelLoopIndex within a route. According to http://camel.apache.org/loop.html, CamelLoopIndex is a property in the Exchange while in the loop. I tried this simple test route: camel:route camel:from uri=file:src/data?noop=true/ setBodyconstantCount /constant/setBody camel:loop constant5/constant setBodycamel:spel#{body + ':' + property(CamelLoopIndex)}/camel:spel/setBody camel:to uri=file:target/messages/out / /camel:loop /camel:route But I received the error below. Any help will be greatly appreciated. org.apache.camel.ExpressionEvaluationException: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 22): Field or property 'CamelLoopIndex' cannot be found on object of type 'org.apache.camel.language.spel.RootObject' at org.apache.camel.language.spel.SpelExpression.evaluate(SpelExpression.java:64) at org.apache.camel.processor.SetBodyProcessor.process(SetBodyProcessor.java:38) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.LoopProcessor.process(LoopProcessor.java:103) at org.apache.camel.processor.LoopProcessor.process(LoopProcessor.java:74) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90
Re: Bean Method Invocation regression in 2.11
Hi, Thanks for reporting this. I just filled a JIRA[1] for it. [1]https://issues.apache.org/jira/browse/CAMEL-6544 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, July 13, 2013 at 1:27 AM, Ashwin Pejavar wrote: I'm testing my upgrade to 2.11 and noticed a bug in how beanMethod invocations are parsed. I'm using Spring to define my routes. The following invocation expression: exec(*, '', 'arg3') gets parsed as arg1: * arg2: arg3: ,arg3 (notice the comma). I tracked down the bug to the class org.apache.camel.util.StringQuoteHelper. The code-block } else if (ch == separator) { // add as answer if we are not in a quote if (!singleQuoted !doubleQuoted sb.length() 0) { String text = sb.toString(); if (trim) { text = text.trim(); } answer.add(text); sb.setLength(0); continue; } } Should instead be } else if (ch == separator) { // add as answer if we are not in a quote if (!singleQuoted !doubleQuoted) { if (sb.length() 0) { String text = sb.toString(); if (trim) { text = text.trim(); } answer.add(text); sb.setLength(0); } continue; //always skip separator if not in quotes } } -- View this message in context: http://camel.465427.n5.nabble.com/Bean-Method-Invocation-regression-in-2-11-tp5735576.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: How do I close Netty connections and shutdown my application gracefully?
I'm sorry, I don't mention it rightly. NettyProducer closes all the open channels when it is stopped. context.stop will shutdown the routes, consumers and producers. If you don't want to shutdown the CamelContext to close the channel, you can set the option disconnect to be true. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 11, 2013 at 1:57 PM, ignos wrote: Thanks. I edit the source. SpringCamelContext context = (SpringCamelContext) applicationContext.getBean(contextId); context.start(); ProducerTemplate template = context.createProducerTemplate(); template.sendBody(endPoint, message); context.stop(); context.stop() works the way I want it to. There is something I have been curious about. What's the difference between context.stop() and template.stop()? -- View this message in context: http://camel.465427.n5.nabble.com/How-do-I-close-Netty-connections-and-shutdown-my-application-gracefully-tp5735496p5735504.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Using Bindy for multiple record types in the same file
I think you can split the file and routing the lines to different bindy data format base on the first 2 character. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, July 12, 2013 at 2:59 AM, rodrickmusser wrote: I am wondering if Bindy can be used in the following scenario: The file format I am working with is fixed length. The first two characters indicate the record type. For example, 01 indicates an order record, 02 indicates a customer record. If the record is an order record, characters 2-11 are the order id. If the record is a customer record, characters 2-20 is the customer name. How does Bindy handle this situation? -- View this message in context: http://camel.465427.n5.nabble.com/Using-Bindy-for-multiple-record-types-in-the-same-file-tp5735541.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: CamelSpringTestSupport with PowerMock
Can you submit a simple test case to show the error? BTW, I just checked code of InterceptSendToMockEndpointStrategy, it has the construction with the parameter list of (java.lang.String,boolean). Can you check if you have more then one version of camel-core in you class path? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 10, 2013 at 6:20 PM, Dayakar wrote: Hi, Iam using CamelSpringTestSupport class to write my JUnit. But in one scenario i want to use PowerMock too. If i use PowerMock with CamelTestSupport its giving following error Error: java.lang.IllegalStateException: Failed to transform class with name org.apache.camel.test.junit4.CamelTestSupport. Reason: [source error] cannot find constructor org.apache.camel.impl.InterceptSendToMockEndpointStrategy(java.lang.String,boolean) Below is my SampleCode: @RunWith(PowerMockRunner.class) @PrepareForTest({SecurityUtil.class }) public class TestCEM extends CamelTestSupport { @Test public void testeventProcessorFailureDetails(){ } } Could anyone can help in this -- View this message in context: http://camel.465427.n5.nabble.com/CamelSpringTestSupport-with-PowerMock-tp5735421.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: CamelTestSupport Import
You need add camel-core.jar at same time. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 10, 2013 at 10:23 PM, Bovas wrote: Hi everybody, I use camel 2.11, java dsl. /import org.apache.camel.test.junit4.CamelTestSupport; public class TestCamelProcess extends CamelTestSupport { ...}/ Which JAR should I import to use CamelTestSupport? I have imported camel-test-2.11.0.jar but it's not enough. I download these jar here http://www.findjar.com/class/org/apache/camel/test/junit4/CamelTestSupport.html but I should download others jar... and it's doesn't work. Can someone help me pls. Thanks - regards, Bovas -- View this message in context: http://camel.465427.n5.nabble.com/CamelTestSupport-Import-tp5735452.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: How do I close Netty connections and shutdown my application gracefully?
You need to shutdown the template if you don't want to use it anymore. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, July 11, 2013 at 8:10 AM, ignos wrote: * camel 2.11.0 * netty 3.6.5.Final I make a simple main method to try out a simple message with Netty producer. The message is well sended, but my application is not exit and tcp connection is not closed. How do I close TCP connections and shutdown my application gracefully? sendMessage(camel_tcp, direct:tcp, Hello); public void sendMessage(String contextId, String endPoint, String message) { SpringCamelContext context = (SpringCamelContext) applicationContext.getBean(contextId); ProducerTemplate template = context.createProducerTemplate(); template.sendBody(endPoint, message); } camelContext id=camel_tcp xmlns=http://camel.apache.org/schema/spring; route from uri=direct:tcp / to uri=netty:tcp://localhost:9200?disconnect=trueamp;textline=true / to uri=log:tcp_log?level=DEBUG/ /route /camelContext -- View this message in context: http://camel.465427.n5.nabble.com/How-do-I-close-Netty-connections-and-shutdown-my-application-gracefully-tp5735496.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: twitter version updated to v1.1
camel-twitter is based on twitter4j project, and 3.0.x of twitter4j support the twitter API v1.1 natively. I just checked the camel master and 2.11.x branch, they are using the twitter4j 3.0.3. So my question is which version of camel are you using? You may consider to upgrade the camel version to the latest release on. 2.11.1. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 10, 2013 at 5:02 AM, hwerner wrote: I'm trying to use twitter in my routes and am currently getting the 410 error message from twitter stating that twitter REST api v1.0 is no longer being used, please update to v1.1. Does this mean Camel needs to update, or do I need to update my api somewhere? This is for a basic twitter search call, and as such we don't really have an api for it, we are simply utilizing camel's twitter component. So, ultimately, I would like to know whether we, now, need to register an app, or if camel just needs to update their component to utilize twitter v1.1, and if camel has, is the spring dsl uri call for a search different? -- View this message in context: http://camel.465427.n5.nabble.com/twitter-version-updated-to-v1-1-tp5735379.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Jetty component. Is it possible do nut put request body into header?
Can I have a look at your camel route? It could be easy to remove the message header just by using the removeHeaders DSL[1]. [1]http://camel.apache.org/how-to-avoid-sending-some-or-all-message-headers.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 9, 2013 at 11:33 PM, Evgeniy wrote: I work with big messages(about 1mb) and jetty component reads the message body into camel exchange header. It causes such errors: WARN header full: java.lang.RuntimeException: Header6144 So, how can I make jetty component do not put HttpRequest body into headers? Regards, Evgeniy -- View this message in context: http://camel.465427.n5.nabble.com/Jetty-component-Is-it-possible-do-nut-put-request-body-into-header-tp5735358.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel 2.11.0 -- TypeConverterLoaderException
Hi, Can you check if there are two camel-scala jars in you class path and the scala version that you are using? BTW, if you don't use the scala, you can just move the camel-scala jars away directly. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 10, 2013 at 11:36 AM, vkarkhanis wrote: Hello, We switched from camel 2.9.0 to 2.11.0 version. However, when we load the camel context (using springs dsl), we get following exception: Exception in thread main org.apache.camel.RuntimeCamelException: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.apache.camel.scala.converter.ScalaMutableCollections, org.apache.camel.scala.converter.ScalaOption, org.apache.camel.scala.converter.ScalaImmutableCollections] at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1338) at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1091) at org.apache.camel.impl.DefaultCamelContext.getTypeConverterRegistry(DefaultCamelContext.java:1106) at org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(DefaultCamelContext.java:2154) at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1573) at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1478) at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1446) at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228) at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118) at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:287) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428) at org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:83) .. ... ... Caused by: org.apache.camel.TypeConverterLoaderException: Failed to load type converters because of: Cannot find any type converter classes from the following packages: [org.apache.camel.scala.converter.ScalaMutableCollections, org.apache.camel.scala.converter.ScalaOption, org.apache.camel.scala.converter.ScalaImmutableCollections] at org.apache.camel.impl.converter.AnnotationTypeConverterLoader.load(AnnotationTypeConverterLoader.java:117) at org.apache.camel.impl.converter.BaseTypeConverterRegistry.loadTypeConverters(BaseTypeConverterRegistry.java:511) at org.apache.camel.impl.converter.DefaultTypeConverter.doStart(DefaultTypeConverter.java:42) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1803) at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:959) at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:920) at org.apache.camel.impl.DefaultCamelContext.getTypeConverter(DefaultCamelContext.java:1089) ... 19 more Is this because of camel-scala-2.9.0-2.11.0.jar ? Do we need to add any more jars..? Thank you, Regards vkarkhanis -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-11-0-TypeConverterLoaderException-tp5735404.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Enriching SOAP messages
FYI, this question is just answer here[1] [1]https://community.jboss.org/message/826938 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 9, 2013 at 1:40 AM, anirban.gupta4 wrote: Hi, I have a requirement to enrich a SOAP message using the contents of another SOAP message using Camel. Previously I have enriched a XML by unmarshaling the XML using proper JAXB annotated class, performing the enrichment and then marshaling it to XML, but I'm not sure how to do it for SOAP message. Kindly suggest. Regards, Anirban. -- View this message in context: http://camel.465427.n5.nabble.com/Enriching-SOAP-messages-tp5735292.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Enricher - coping strategy
The enricher is just a common EIP implementation, we don't care much about the implementation of message. I just went though the code, it could be more easy if you can override the default copy method of the heavy message. I think we can enhance the enrich DSL by providing the plugin parameter to prepare the exchange for enricher target, but it real depends on how the enricher wants to reuse the message. Just my 2 cents. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 9, 2013 at 1:01 AM, solimo wrote: Hello! After few route implementations which use enricher I've found it quite inconvenient to copy whole exchange. The concept is quite brilliant, but could anyone explain why, instead of implementing some ExchangeCreateStrategt (like AggregationStrategy for aggregation), the whole exchange is being copied? I can see two drawbacks here: 1. When a message is quite heavy we will suffer (although it can be workarounded by implementing own Message and overriding copy method). 2. Usually, we do not need whole in message (to process in enricher target), so it's quite pointless to copy it as a whole and then transform (or select part of it) to format which is required. So far, we've ended with own implementation of Enricher which requires additional bean reference of processor which copies exchange (in our case, it is used to select interesting data and fill new exchange with appropriate data format) in desired way. Any way, I'm really curious why enricher has been implemented in such a way by Camel Team. Any reason? Maybe I miss something important :)! Robert Budźko -- View this message in context: http://camel.465427.n5.nabble.com/Enricher-coping-strategy-tp5735290.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: under the hood architecture of camel-jetty and camel-http4
Hi Please see my comments inline. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 9, 2013 at 1:35 AM, geert wrote: Hello all, I'm working on the concept for a camel route and I have some high level questions about the internal architecture of camel and especially camel-jetty and camel-http4. I need an extremely fast processing time and for this I want to control the connection pool, enforce keep-alive connections, timing out of connections, ... My route will take http soap requests (call A) and dispatch them to multiple web services using soap once more (call B). I know how to write this route, so that's not the question. My issue is that I want to exert high control both connection pools. I already know there are quite a few parameters you can set, as explained in various article on google, the docs and the forum, for example http://camel.apache.org/jetty.html and http://camel.apache.org/http4.html and http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html etc.. But I would like to understand the underlying architecture so that it can be confirmed that above settings will be sufficient or that I need to start digger deeper and how I best tackle this digging. Any pointers and advice are appreciated. Below are a few points where I would like to have answers, pointers to doc, corrections if I didn't get it, confirmation if I got it, suggestions, advice, ... Both high and detailed reactions are appreciated: - I want to enforce the usage of a connection pool and keep-alive connections for call A and call B. Most simple solution is to use the standard configuration options, explained in the links above. Because the camel components just wrap jetty and http client, I really need to start looking at respectively the docs of jetty and http client to understand the possible parameters and their implications? For the jetty service side, there is no much parameters those you can change. But for the client side, you can configure the connection pool, connection time out etc through the http4 options. - If the documented configuration parameters are not sufficient for my needs, I need to take the existing components and enrich them or even write my own component. To give a very crazy example, I could have a my-jetty component and let it point to an hard coded jetty server. - Another idea, probably a very bad one and only valid for call B is to forget about camel-http4: I could write my own processor to do the call B and integrate it into the route. I could then try to write the processor such that it would use a self-built connection pool? You could do it yourself, but you don't have to. - camel-cxf ensures that soap is being integrated into the built-in jetty server automatically, so I don't need to worry about the fact that I'm using a very specific kind of http request (SOAP). I really only need to focus on the http communications going on under the hood, ie. jetty and httpclient? If you don't need to change the soap request or response, you don't need to use the camel-cxf component. - Would I be able to influence the configuration of the built-in jetty under the hood of camel (without going via camel-jetty) and would this configuration be picked up at run time? I'm mentioning this because I'm considering to deploy the whole application on servicemix, where I have high control over the jetty server (if I use the right version of servicemix :-) Using the camel-servlet component, you can leverage the web container function which servicemix already provides. Best regards, thank you for reading and big thank you if you also respond :-) geert -- View this message in context: http://camel.465427.n5.nabble.com/under-the-hood-architecture-of-camel-jetty-and-camel-http4-tp5735291.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: zip file best practices
Hi Juan, Thanks for reporting it. I will check out your patch when I get some time next week. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, July 6, 2013 at 3:50 AM, Gardella juan wrote: Hello Willieem, It seems there is a problem with the ZipSplitter that you did. I had added a test ZipProcessRouteBuilderIT to reproduce the error at https://issues.apache.org/jira/browse/CAMEL-6139. If you use my ZipSplitter the test works. Thanks, Juan -- View this message in context: http://camel.465427.n5.nabble.com/zip-file-best-practices-tp5713437p5735214.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Chunking issue with http producer
Thanks for sharing the solution with us. I think we can enable this kind of feature when the http producer is working in the Bridge mode. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 3, 2013 at 5:47 PM, Bernard Ligny wrote: I finally found a solution that i am sharing here for the community. With that proposed patch, the streaming capability is preserved, and the latency is now much better: http://camel.465427.n5.nabble.com/file/n5735129/difference2.png Here are the details of my patching of *HttpProducer.java* There is one small drawback: since the http connection is released only when the stream is closed, it is very important to...close the stream ;-) (NB: compared to AutoCloseInputStream, which automatically /closes and discards the underlying stream as soon as the end of input has been reached/...) Yet interested by your opinion about other potential drawbacks... Bernard. -- View this message in context: http://camel.465427.n5.nabble.com/Chunking-issue-with-http-producer-tp5735075p5735129.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Entity Manager is null
Which version of Spring are you using? How did you use PersistenceContext? Maybe the class that you want to inject the EntityManager is not managed by Spring. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 2, 2013 at 5:31 PM, abhi wrote: Hi All, I am facing issue with EntityManager being null when I access it from my Java Code. Below is my camel-context in which I am defining Entity MAnager. bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean property name=persistenceUnitName value=com.baselogic.jpa / property name=jpaVendorAdapter ref=jpaAdapter / property name=jpaProperties props prop key=openjpa.ConnectionURLjdbc:sqlserver://10.10.10.11:1433;databaseName=XYZ;instanceName=SQLEXPRESS;/prop prop key=openjpa.jdbc.DBDictionaryorg.apache.openjpa.jdbc.sql.SQLServerDictionary/prop prop key=openjpa.ConnectionDriverNamecom.microsoft.sqlserver.jdbc.SQLServerDriver/prop prop key=openjpa.ConnectionUserNameuser1/prop prop key=openjpa.ConnectionPasswordpass123/prop prop key=openjpa.LogEnhance=TRACE,SQL=TRACE/prop prop key=openjpa.jdbc.SynchronizeMappingstrue/prop /props /property /bean When I am persisting data using camel route its working perfectly fine, but when I am trying to access Entity manager through code its null. @PersistenceContext(unitName = com.baselogic.jpa) private EntityManager entityManager; Can anybody tell me if I am missing anything ? Thanks, Abhi -- View this message in context: http://camel.465427.n5.nabble.com/Entity-Manager-is-null-tp5735076.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Choice sendTo and overwriting exchange body
Maybe we can add an option in sendTo DSL, to let it restore the original Exchange if the option is enabled. Please feel free to fill a JIRA for it, if you like you can share us with the solution you have. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, July 3, 2013 at 8:19 AM, David MacDonald wrote: Hi Willem, I guessed this much. Oracle Service Bus has a service call feature out which could do callouts to internal routes without affecting the incoming message which was quite useful. I might see if I can come up with a reusable Expression that does something similar. Cheers, David -- View this message in context: http://camel.465427.n5.nabble.com/Choice-sendTo-and-overwriting-exchange-body-tp5734867p5735107.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Chunking issue with http producer
If you are using http client 3, it will clean up the input stream when you close the connection. You can find more information by checking the the comments in the doExtractResponseBodyAsStream. That is why we need to cache the input stream as it will be used in the other part of camel route. If you disable the streamCache it doesn't affect it, but you may consider to disable cache the stream into file as the default size is 64K. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 2, 2013 at 5:10 PM, Bernard Ligny wrote: I've got a back-end web service returning large **chunked** data. I have defined a Camel route with a proxy to this web service. I do not want Camel to buffer the entire back-end response, and then return it as a whole to the client. Instead, i would like to preserve the original streaming (mainly to avoid read timeouts on the client side). How can i achieve this (a pipe actually) in Camel ? Even when I disable streamCache on CamelContext, it seems Camel is yet buffering internally the response. Hereunder the difference between a direct call to the back-end, and the same call via Camel: http://camel.465427.n5.nabble.com/file/n5735075/difference.png = see Latency ! In the first case, client gets a beginning of response after 2 sec, while in the second case, he has to wait for 12 sec before getting any data... I looked into the code of HttpProducer.java, and I'm a bit puzzled about what i can see in the doExtractResponseBodyAsStream method: private static InputStream doExtractResponseBodyAsStream(InputStream is, Exchange exchange) throws IOException { // As httpclient is using a AutoCloseInputStream, it will be closed when the connection is closed // we need to cache the stream for it. try { // This CachedOutputStream will not be closed when the exchange is onCompletion CachedOutputStream cos = new CachedOutputStream(exchange, false); IOHelper.copy(is, cos); // When the InputStream is closed, the CachedOutputStream will be closed return cos.getWrappedInputStream(); } finally { IOHelper.close(is, Extracting response body, LOG); } } If you always *copy* the stream, you need to read the whole stream :-( Where do you take account of the streamCache flag when deciding to cache or not cache the response input stream ? Thanks for your help. Bernard. -- View this message in context: http://camel.465427.n5.nabble.com/Chunking-issue-with-http-producer-tp5735075.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Bug in org.apache.camel.main.Main#doStop() ?
Hi, I just had a quick look of the code and confirmed it's a bug. I will commit a quick fix for it shortly. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, July 2, 2013 at 7:42 PM, Sven Bauhan wrote: I opened a bug report: https://issues.apache.org/jira/browse/CAMEL-6504 On 06/28/13 12:10, Christian Müller wrote: I cannot look into the code yet, but I think this should be fixed. Feel free to create a JIRA. Best, Christian Sent from a mobile device Am 28.06.2013 10:54 schrieb Sven Bauhan sven.bau...@ast.dfs.de (mailto:sven.bau...@ast.dfs.de): Hi, I think I found a bug in org.apache.camel.main.Main#**doStop(): When I call a Camel application with parameter -h all parameters are printed an the program exits. But it is no clean exit; it throws an java.lang.** IndexOutOfBoundsException. The reason for this is the expression in doStop(): + getCamelContexts().get(0).**stop(); I implemented a workaround in my class derived from org.apache.camel.main.Main: + @Override protected void doStop() throws Exception { List? contexts = getCamelContexts(); if (contexts != null ! contexts.isEmpty()) { super.doStop(); } else { completed(); } } Is this a real bug, or did I just use org.apache.camel.main.Main the wrong way? Thanks, Sven
Re: Jetty asynchronous processing with seda
pollEnrich doesn't use any data of the current exchange, which means the setHeader doesn't take effect on pollEnrich. I think you should check the message body, if it is null then set the message header with the response code you want. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, July 1, 2013 at 7:04 PM, LeviStrauss wrote: Hi, I would like to create a kind of proxy which receives the requests, sends it to a seda process and waits for the response. How can I send custom error code back? This doesn't work with camel 2.4, I always get 200 OK when file shows up in dir within 30 seconds, if not then I get 500 Server Error not 520. How can I pass the request (body) to seda process? I would like to push HTTP request(xml) to a ActiveMQ queue and based on the returned file content (xpath evaluation) return a code and body to jetty. (200,500 whatever) route id=seda from uri=jetty:http://localhost:8088/sedatest/ to uri=seda:input/ /route route id=seda2 from uri=seda:input/ setHeader headerName=HttpProducer.HTTP_RESPONSE_CODEconstant520/constant/setHeader pollEnrich uri=file:///tmp/seda timeout=5/ /route Thanks, Levente
Re: id of wireTap will be overrided by the id of next node
Yeah, you need to use the block to avoid this issue. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, June 27, 2013 at 3:15 PM, liugang594 Liu wrote: I found a way to make it works: change wireTap(direct:a).id(wireTapId) to wireTap(direct:a).id(wireTapId).end() , then it works. 2013/6/27 liugang594 Liu clevers...@gmail.com (mailto:clevers...@gmail.com) Hi All: I have below route: from(timer:foo).routeId(route1).setBody(constant(Hello)).id(setBodyID).wireTap(direct:a).id(wireTapId).process(new Processor(){...}).id(processId); When I'm trying to trace each node by id, I found the id of wireTap will be always processId. Seems all sub-classes of ProcessorDefinition have the same problem. is it a bug of Camel? or is there any other way to resolve this problem? -- Thanks GangLiu MSN: liugang_0...@hotmail.com (mailto:liugang_0...@hotmail.com) Skype: gang.liu.talendbj -- Thanks GangLiu MSN: liugang_0...@hotmail.com (mailto:liugang_0...@hotmail.com) Skype: gang.liu.talendbj
Re: Choice sendTo and overwriting exchange body
Hi, When you using sendTo expression, the exchange will be processed, so the original exchange will be processed. If you need to use the original message body again, you need to resort it yourself. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, June 27, 2013 at 9:20 AM, David MacDonald wrote: Hi all, I'm attempting to use a sub-route via the sendTo expression to act as a filter (this involves a callout to a web-service), however I run into a problem in that the sendTo callout overwrites the original exchange body. For example, ... .choice() .when(sendTo(direct:someFilterService).isEqualTo(false)) .log(the body is now false, rather than the original body) .otherwise() .log(the body is now true, rather than the original body') .end() I've worked around this by using .setProperty(OriginalBody,body()) and replacing it after the filtering however this isn't terribly elegant. I also realize that it's possible to use a Processor and some kind of producer template but I'd like to avoid adding Java code. So, is it possible for the sendTo expression to return a new exchange purely for evaluation? Thanks, David -- View this message in context: http://camel.465427.n5.nabble.com/Choice-sendTo-and-overwriting-exchange-body-tp5734867.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: xmpp uri in camel / naming a JID resource [solved]
Thanks for sharing this with us :) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, June 26, 2013 at 3:46 AM, Garbage wrote: I reread the documentation on the XMPP component (http://camel.apache.org/xmpp.html) and rearranged the url from an earlier attempt. It now works, I can use one account and vary it by adding a resource. Here you can find an example: from(stream:in?promptMessage=sachwas:).to(xmpp:installati...@xmpp.srv.net?resource=apppassword=yesparticipant=installati...@xmpp.srv.net/device1 (mailto:installati...@xmpp.srv.net?resource=apppassword=yesparticipant=installati...@xmpp.srv.net/device1)); This logs on the user as installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/app and has it send the entered message to the same user but with a different active resource (installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/device). Now I can proceed and add marshalling and remoting ... -- View this message in context: http://camel.465427.n5.nabble.com/xmpp-uri-in-camel-naming-a-hid-resource-tp5734609p5734766.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: xmpp uri in camel / naming a hid resource
Hi, I think it is make sense to treat the installation as a chat room, then you can let the application and device talk to each other. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, June 23, 2013 at 7:12 PM, garb...@gmx.de wrote: Hello, I doubt that I understood how to name a jid-resource when using Apache Camel. Perhaps it is not even possible because the xmpp endpoint will take what I intent to be a resource as an participant. format for an xmpp url in camel: xmpp://[login@]hostname[:port][/participant][?Options] format of a jid: node@domain/resource Background: I want to use xmpp in order to access a central application (which is behind a firewall I have no influence on) from various clients. The xmpp server will be the coordinator for all the clients which send commands to the central applicatoin which in turn will answer. I will create one openfire user per installation (an installation is the combination of 1 central application and n clients accessing it). The idea is then to have the clients logged into the xmpp server and have a jabber ressource set accordingly to differentiate between them. I want to create only one account per installation. In a picture the communication will look like this: +-+ | application: | | installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/app | +-+ I I I +-+ | XMPP Server | | hostname: xmpp.srv.net (http://xmpp.srv.net) +-+ / \ / \ / \ +-- +-- | contacting device #1 | | contacting device #n | | installat...@xmpp.srv.net (mailto:installat...@xmpp.srv.net)/device1 | | installat...@xmpp.srv.net (mailto:installat...@xmpp.srv.net)/devicen | +-- +-- Question: How should I address the application from device1 and make sure that an outgoing answer to the request only reaches that device and no other device ? I would have expected something like this, but this is where the interpretation of the / comes into my way: from device to application: xmpp://installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/device1/installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/app?password=keptmessage=whatIsTwoTimesFour from application to device: xmpp://installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/app/installati...@xmpp.srv.net (mailto:installati...@xmpp.srv.net)/device1?passwort=secretmessage=8 Any other comments concerning what I plan to do are welcome because the idea is quite new and I don't know if this is the ideal way ! But please don't comment on my drawing skills in ASCII art ;-)
Re: Servet Componnet HttpSession
Checking the cookies header could help us find out the reason. BTW, I think Camel will cache the HttpEndpoint for sending the message, I'm not sure if it can cause some trouble here. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, June 23, 2013 at 1:05 AM, Claus Ibsen wrote: On Wed, Jun 19, 2013 at 12:11 AM, ramrubio ramru...@yahoo.com (mailto:ramru...@yahoo.com) wrote: It looks like Camel caches the client connection as long as URL is exactly the same. This causes multiple requests by different browser clients to use same session id. Is this expected behavior? It does not seem correct to me for two different clients to have the same session id on server simply because they use the same URL. I would assume that the cookies for the session id's from the real target needs to be propagated, and then on the Camel side, there shouldn't really be any session in use, as its just a proxy. So can you see if the session id cookies returned from the real target gets returned to Camel, and that Camel sends those back to the client. Use case is that Camel is acting as a proxy with a slip configuration that routes the request to a servlet component. /Ramon -- View this message in context: http://camel.465427.n5.nabble.com/Servet-Componnet-HttpSession-tp5734314p5734320.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com). -- Claus Ibsen - www.camelone.org (http://www.camelone.org): The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com (mailto:cib...@redhat.com) Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Camel-Cxf Payload Mode - DefaultSEI not found
You need to specify the wsdlUrl attribute in the cxfEndpoint element. 发自我的 iPhone 在 2013-6-12,下午3:18,lmanchanda75 lmanchand...@gmail.com 写道: Hi Experts, I am writing a PAYLOAD mode client and for the same I have defined following blueprint: ?xml version=1.0 encoding=UTF-8? blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:camel=http://camel.apache.org/schema/blueprint; xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0; xmlns:jaxws=http://cxf.apache.org/blueprint/jaxws; xmlns:cxf=http://cxf.apache.org/blueprint/core; xmlns:camel-cxf=http://camel.apache.org/schema/blueprint/cxf; xsi:schemaLocation= http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.10.0-blueprint.xsd bean id=helloBean class=manchanda.lalit.cxfclient.HelloBean property name=say value=Hi from Camel/ /bean bean id=cxfClient class=manchanda.lalit.cxfclient.TestCxfClient/ camel-cxf:cxfEndpoint xmlns:hy=http://bd.prws.ksrtc.com; id=ksrtc address=http://111.93.131.108:9080/AWATAR_WSRouter/services/ResvAdaptee; serviceName=hy:ResvAdapteeService /camel-cxf:cxfEndpoint camelContext trace=false id=blueprintContext xmlns=http://camel.apache.org/schema/blueprint; route id=timerToLog from uri=timer:foo?period=5/ bean ref=cxfClient method=dispatchByCamel/ log message=The message contains ${body}/ to uri=mock:result/ /route route id=ksrtc-request from uri=direct:ksrtc/ to uri=cxf:bean:ksrtc?portName=hy:ResvAdapteeamp;dataFormat=PAYLOADamp;allowStreaming=true/ /route /camelContext /blueprint But my application does not start and gives the following exception: 12:27:13,273 | ERROR | t-0.1.0-thread-1 | BlueprintCamelContext| 138 - org.apache.camel.camel-blueprint - 2.10.0.redhat-60024 | Error occurred during starting Camel: CamelContext(blueprintContext) due Failed to create Producer for endpoint: Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee]. Reason: java.lang.ClassNotFoundException: org.apache.camel.component.cxf.DefaultSEI not found by manchanda.lalit.TryCxfClient [595]^M org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[cxf://bean:ksrtc?allowStreaming=truedataFormat=PAYLOADportName=hy%3AResvAdaptee]. Reason: java.lang.ClassNotFoundException: org.apache.camel.component.cxf.DefaultSEI not found by manchanda.lalit.TryCxfClient [595]^M at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)^M at org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:114)^M at org.apache.camel.impl.ProducerCache.startProducer(ProducerCache.java:145)^M at org.apache.camel.processor.SendProcessor.doStart(SendProcessor.java:175)^M at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:73)^M at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:78)^M at org.apache.camel.processor.interceptor.TraceInterceptor.doStart(TraceInterceptor.java:358)^M at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)^M at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:52)^M at org.apache.camel.processor.WrapProcessor.doStart(WrapProcessor.java:52)^M at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)^M
Re: Upgrade Camel 2.10.1 - 2.11.0 - Camel keeps restarting
which version of Karaf are you using? It looks like a Karaf issue. I don't think camel's change will cause this issue. 发自我的 iPhone 在 2013-6-12,上午1:51,Martin Stiborský martin.stibor...@gmail.com 写道: It's been a while but now I had some time to investigate this problem again. I think I have found the problem. It's caused by property-placeholder in blueprint, to be specific - it's restarting over and over when there is configured update-strategy=reload. Without this option, it works. I tried also camel 2.11.1-SNAPSHOT but it seems that the problem is there as well. So far I don't know more, just that without this option I haven't noticed any problem. On Thu, May 23, 2013 at 3:25 PM, Martin Stiborský martin.stibor...@gmail.com wrote: Hi! We are using features for deployment (https://cwiki.apache.org/KARAF/46-provisioning.html). I did a quick test with Camel 2.11 and Karaf 2.3.1, completely fresh installation and this I have there some dependencies troubles, like missing osgi.wiring.package=org.apache.aries.util and few others. This seems to be like problem on our side. I'll know more soon hopefully. On Thu, May 23, 2013 at 2:12 PM, Raul Kripalani r...@evosent.com wrote: It could be an issue with the way you deploy your bundles. If you drop them in the deploy/ directory, and you happen to deploy libraries that fulfill optional imports elsewhere, the OSGi framework could force a refresh of the entire bundle set. Hence justifying the observed behaviour to some extent. How exactly do you deploy your bundles? *Raúl Kripalani* Enterprise Architect, Open Source Integration specialist, Program Manager | Apache Camel Committer http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Thu, May 23, 2013 at 1:04 PM, Martin Stiborský martin.stibor...@gmail.com wrote: Not yet - I hasn't spent too much time on this and we postponed Camel 2.11 upgrade right now. I'll check debug log of camel and try to find the problem there. It seems I'm not alone on this :) http://camel.465427.n5.nabble.com/prevent-CamelContext-from-shutting-down-in-blueprint-td5733004.html On Fri, May 3, 2013 at 8:35 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Did you figure out this problem? On Wed, May 1, 2013 at 1:42 PM, Martin Stiborský martin.stibor...@gmail.com wrote: Hi guys, I'm trying to upgrade Camel and Karaf in our project to newer version, as the Camel 2.11 is out. Camel 2.10.1 - 2.11 Karaf 2.2.10 - 2.3.1 There were needed few modifications. nothing serious, but Camel and Karaf behaves a little bit weird - CamelContent is created and immediatelly shut down and then created down and again and again… I can't see anything wrong in log output. Sometimes it even start ok, sometimes it needs few tries to start correctly, but it's weird. I'm using Blueprint and some libraries, like camel-cxf, camel-ldap and similar, so I know it's hard to find possible problem from such description I provided here. Just if you spot something obvious or I missed something related to upgrade.. -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz Twitter: http://www.twitter.com/stibi -- Claus Ibsen - Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz Twitter: http://www.twitter.com/stibi -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz Twitter: http://www.twitter.com/stibi -- S pozdravem / Best regards Martin Stiborský Jabber: st...@njs.netlab.cz Twitter: http://www.twitter.com/stibi
Re: Regarding request routing through camel web app
Hi, How did you deploy the servlet? If you are using the camel-servelt you just need to use the relative path not use the full path. Please check the document in the camel-servlet[1] for more information. [1]http://camel.apache.org/servlet.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, June 7, 2013 at 9:26 PM, indrayani wrote: hi all, I need a little help. My web application A is sending http request to camel web application . and i have defined a route in camel routebuilder which says if the request comes from A then forward it to other web application B. web application A's http get method is making a http call to camel web application. what i have observed is, the route defined in camel application is not getting invoked. here is the defined route. from(servlet:http://localhost:8085/AppA/a.do?;) .setHeader(Exchange.HTTP_METHOD, constant(POST)) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { System.out.println( inside the new route123); } }).to(http://localhost:8085/AppB/a.do?bridgeEndpoint=trueamp;throwExceptionOnFailure=true;) ; what i am expecting is, the sysout statement inside process() should get printed in the logs. but when i am hitting the web application A's url, its http get method is getting called, and it is making http call to camel web app, but after that nothing is happening. I can not see the sysout in logs. Please let me know if anybody has any clue for this kind of behaviour. am i missing anyting ?? -- View this message in context: http://camel.465427.n5.nabble.com/Regarding-request-routing-through-camel-web-app-tp5734013.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel 2.9.2, CXF 2.6.2 - How should the response look for CXF producer using Payload dataformat
Hi, I just found you didn't specify the wsdlURL or serviceClass attributes in you CxfEndpoint element. They are useful when CXF is trying to build up ServiceModel for handling the request and response. Can you add either one of them to your CxfEndpoint definition? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, June 5, 2013 at 10:23 PM, sunita wrote: Hi William, Thanks for your response. I was initially posting only on camel user group but since I did not get any responses to my earlier posts, I decided to post on both since it may have different audiences. Do you know why I am getting this error when I wrap the response in soap envelope. I had posted this question earlier as well. org.apache.cxf.interceptor.Fault: Unexpected element {http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService}ccdaResponse found. Expected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse. at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:258) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:200) see the Post with following tittle for more details Camel 2.9.2 - Error parsing custom CXF response - org.apache.cxf.interceptor.Fault: Unexpected element {http://CcdaXdrService}ccdaResponse found. Expected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-2-CXF-2-6-2-How-should-the-response-look-for-CXF-producer-using-Payload-dataformat-tp5733748p5733881.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel without Spring. Limitations?
Camel and CXF support Blueprint which can do the same thing as Spring does. Did you have a chance to try it? 发自我的 iPhone 在 2013-6-3,下午6:59,Jose jagavi...@gmail.com 写道: Hi, I am trying to use Camel without Spring and I am wondering if there are some limitations. I guess the configuration would be more complicated but I wonder if I will loose some features. In particular, I am planning to use Camel with CXF. All the examples that I have seen use Camel with Spring. Thanks a lot. Jose -- View this message in context: http://camel.465427.n5.nabble.com/Camel-without-Spring-Limitations-tp5733686.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: No bean named 'CamelBeanParameterMappingStrategy' is defined
If you don't use APM, can your camel context be started rightly? It looks like you are missing the definition of CamelBeanParameterMappingStrategy somewhere. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, June 4, 2013 at 6:14 AM, salemi wrote: Hi, I started profilng my code with an APM software and I seeorg.springframework.beans.factory.NoSuchBeanDefinitionException and the message detail is No bean named 'CamelBeanParameterMappingStrategy' is defined. Did I miss something in my Spring Context? Thanks, Ali - Alireza Salemi -- View this message in context: http://camel.465427.n5.nabble.com/No-bean-named-CamelBeanParameterMappingStrategy-is-defined-tp5733753.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Camel 2.9.2, CXF 2.6.2 - How should the response look for CXF producer using Payload dataformat
Hi, Please don't send the same question into two different users mailing list. I already answer you question in the cxf users mailing list. The answer is you the response should be wrapped with soap envelope. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, June 4, 2013 at 4:05 AM, Monga, Sunita (GE Healthcare) wrote: Hello all, I have a route which sends a request to CXF webservice using Payload dataformat. My question should the response consist of only Soap:body or should it be the entire message soap:envelope Spring context cxf:cxfEndpoint id=xdrReceiverEndpoint address=${xdrWebserviceUrl} endpointName=s:CcdaXdrServicePort serviceName=s:CcdaXdrService xmlns:s=http://service.webservices.xdrreceiverimpl.pil.hcit.ge.com; cxf:properties entry key=mtom-enabled value=true/ entry key=dataFormat value=PAYLOAD/ entry key=loggingFeatureEnabled value=true/ !-- entry key=defaultOperationName value=submitCcda/-- /cxf:properties /cxf:cxfEndpoint Sample request: static final String REQ_MESSAGE=ccdaRequest xmlns=\ +http://service.webservices.xdrreceiverimpl.pil.hcit.ge.com/CcdaXdrService\; +clinicalDocument +ccDocument +xop:Include xmlns:xop=\http://www.w3.org/2004/08/xop/include\; + href=\cid: + REQ_DOC_CID + \/ +/ccDocument +/clinicalDocument +/ccdaRequest; I am trying to use SoapUI mockservice to mock the response as below ccdaResponse xmlns=http://service.webservices.xdrreceiverimpl.pil.hcit.ge.com/CcdaXdrService; !--Optional:-- ccdaAcknowledgement !--Optional:-- statusCode0/statusCode !--Optional:-- statusDescSuccess/statusDesc /ccdaAcknowledgement /ccdaResponse But I get following error [http-bio-8080-exec-1] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://service.webservices.xdrreceiverimpl.pil.hcit.ge.com}CcdaXdrService#{http://camel.apache.org/cxf/jaxws/dispatch}Invoke has thrown exception, unwinding now org.apache.cxf.binding.soap.SoapFault: http://service.webservices.xdrreceiverimpl.pil.hcit.ge.com/CcdaXdrService;, the namespace on the ccdaResponse element, is not a valid SOAP version. at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:116) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:142) at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:61) If the response is the entire soap envelope I get following error. So not sure what the response should like org.apache.cxf.interceptor.Fault: Unexpected element {http://model.webservices.ihe.adapters.ccg.dataexchange.hcit.ge.com/CcdaXdrService}ccdaResponse found. Expected {http://camel.apache.org/cxf/jaxws/dispatch}InvokeResponse. at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:258) at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:200)
Re: the namespace on the IReportServiceExecuteRequest element, is not a valid SOAP version
Where did you call the exchange.getOut() ? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, June 4, 2013 at 2:00 AM, sunita wrote: Hello, I am facing same issue. I get the same error - namespace is not a valid SOAP version. I added exchange.hasOut() before calling exchange.getOut(). hasOut returned true but getOut returned null headers and body Were you able to resolve the issue. -- View this message in context: http://camel.465427.n5.nabble.com/the-namespace-on-the-IReportServiceExecuteRequest-element-is-not-a-valid-SOAP-version-tp5284067p5733738.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: No bean named 'CamelBeanParameterMappingStrategy' is defined
I don't know which version of camel you are using. But you can try to use class org.apache.camel.component.bean.DefaultParameterMappingStrategy -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, June 5, 2013 at 2:24 AM, salemi wrote: Thank you for your answer. Do you know where it gets instantiated and which class is referring to it? - Alireza Salemi -- View this message in context: http://camel.465427.n5.nabble.com/No-bean-named-CamelBeanParameterMappingStrategy-is-defined-tp5733753p5733821.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Performance Degradation due to Reverse DNS Lookups
Hi, I'm not sure if setting the dummy implementation of X509HostnameVerifier can resolve the issue. Can you try it to see if it work? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, June 4, 2013 at 10:23 AM, rouble wrote: In my router configuration I am specifying https4 - is that what you wanted to know? cheers rouble On Mon, Jun 3, 2013 at 9:59 PM, Willem jiang willem.ji...@gmail.com (mailto:willem.ji...@gmail.com) wrote: Hi, There are lots of http related components can provide the https connection, it could be helpful if you can tell us which http component you are using. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, June 4, 2013 at 5:20 AM, rouble wrote: Camel Dudes, We have detected a very strange issue in that our https routes degrade in performance when an ip address is used (as opposed to a domain name). Turns out that the Java core libraries do reverse DNS lookup for ip address when SSL connections are created. Read all about it here: https://forums.oracle.com/forums/thread.jspa?threadID=1532033 http://stackoverflow.com/questions/3193936/how-to-disable-javas-ssl-reverse-dns-lookup This becomes an issue when the IP address is not configured in the DNS server and the reverse DNS fails. In this case each connection has to wait for a timeout of the reverse DNS request before it can proceed. This makes domain name connections faster than ip address connections - which is backwards. Is this a known issue? There are a few workarounds/hacks recommended on the interwebs, I was wondering if it would be possible to introduce them into camel (http://www.velocityreviews.com/forums/showpost.php?p=2959030postcount=8). tia, rouble
Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response
It could save me some time if you can provide a simple test case for it. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 30, 2013 at 9:51 AM, liugang594 Liu wrote: Sorry to bothering you again, I'd like to know is there any progress on this issue? and I saw one bug is created related to it https://issues.apache.org/jira/browse/CAMEL-6404 . Thanks. 2013/5/29 liugang594 Liu clevers...@gmail.com (mailto:clevers...@gmail.com) If the required service with ws-addressing enable, and from CXF component (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing information inside. then got a NullPointerException, the error msg is: Exception in thread default-workqueue-1 java.lang.NullPointerException at org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642) at org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151) at org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81) at org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353) at java.lang.Thread.run(Thread.java:722) The expect msg looks like: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Header/ soap:Body soap:Fault faultcode xmlns:ns1=http://www.w3.org/2005/08/addressing ns1:MessageAddressingHeaderRequired/faultcode faultstringA required header representing a Message Addressing Property is not present/faultstring /soap:Fault /soap:Body /soap:Envelope is it a bug of Camel? -- Thanks GangLiu MSN: liugang_0...@hotmail.com (mailto:liugang_0...@hotmail.com) Skype: gang.liu.talendbj -- Thanks GangLiu MSN: liugang_0...@hotmail.com (mailto:liugang_0...@hotmail.com) Skype: gang.liu.talendbj
Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response
From the stack trace I can tell there are something when camel-cxf wants to read the content from CXF message. Can you show me the whole Camel route and your camel version? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 29, 2013 at 11:36 AM, liugang594 Liu wrote: If the required service with ws-addressing enable, and from CXF component (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing information inside. then got a NullPointerException, the error msg is: Exception in thread default-workqueue-1 java.lang.NullPointerException at org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642) at org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151) at org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81) at org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353) at java.lang.Thread.run(Thread.java:722) The expect msg looks like: soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Header/ soap:Body soap:Fault faultcode xmlns:ns1=http://www.w3.org/2005/08/addressing ns1:MessageAddressingHeaderRequired/faultcode faultstringA required header representing a Message Addressing Property is not present/faultstring /soap:Fault /soap:Body /soap:Envelope is it a bug of Camel? -- Thanks GangLiu MSN: liugang_0...@hotmail.com (mailto:liugang_0...@hotmail.com) Skype: gang.liu.talendbj
Re: camel-cxf and synchronous vs. asynchronous endpoints
Hi It's a known issue, CXF jms transport doesn't support the asynchronous invocation well. 发自我的 iPhone 在 2013-5-27,下午5:59,Jens smix...@dzbank.de 写道: Hi, I have a very simple route of the form from(cxf:bean:router).to(cxf:bean:realEP?synchronous=true) The realEP endpoint uses JMS. If the router endpoint uses HTTP things work as expected (presumably because HTTP is synchronous by default) but if the router endpoint is JMS as well (and therefore async by default) the route hangs after calling the realEP and never returns the response to the caller. Switching the router endpoint to synchronous operation as well seems to fix that, but is this behaviour to be expected? Is there another way to make it work? Thanks, Jens -- View this message in context: http://camel.465427.n5.nabble.com/camel-cxf-and-synchronous-vs-asynchronous-endpoints-tp5733246.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Custom component for weird legacy format
I don't think we need to write a customer HTTP binding this time, writing a custom Data Format should be enough. If you have some special HTTP header need to deal with, you may consider to write that HTTP binding. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, May 24, 2013 at 1:03 AM, Raul Kripalani wrote: Hi Frank, By no means do you need to write a custom component! Camel has a lot of features to help you in processing and/or transforming the message. First of all, take a look at our Data Formats [1] and see any can help you digest the message. Of special relevance in your case are Bindy, Flatpack, BeanIO, etc. If none helps you, you need to think what overcoming this mess actually means. Do you mean transforming the content into a POJO? Or into another serialized format for which there are more processing options readily available, e.g. XML, JSON? Your solution could be as simple as a Bean that transforms the message into something higher-level, if this is just a one-off case in your integration middleware platform (one service, one operation). If it's a recurring scenario, you're seeking something reusable and pluggable: - If all your interactions are over HTTP, you can consider a custom HTTP Binding for camel-jetty [2]. - If you're targeting a variety of protocols, you want something more higher-level, in which case you can create your own custom Data Format [3]. To sum up, with Camel you normally don't need to create custom components, unless you're interfacing over/with a new protocol, technology or communication channel for which a component doesn't already exist (somewhat unlikely). Hope this helps, [1] http://camel.apache.org/data-format.html [2] http://camel.apache.org/jetty.html#Jetty-CustomizingHttpBinding [3] http://camel.apache.org/custom-dataformat.html *Raúl Kripalani* Enterprise Architect, Open Source Integration specialist, Program Manager | Apache Camel Committer http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani http://blog.raulkr.net | twitter: @raulvk On Thu, May 23, 2013 at 2:56 PM, Frank Ertl frank.e...@f-i-solutions-plus.de (mailto:frank.e...@f-i-solutions-plus.de) wrote: Hi everybody, we have to implement a route that listens on a defined http-port and receives a message with a very strange legacy format. Partly XML, partly TLV (tag-length-value). I wonder what would be the best option to overcome this mess. Writing a custom component that could work as a consumer endpoint (somehow using jetty, maybe by extending the jetty-component) or would it be better just to write a new TypeConverter and call convertToType after receiving the message via the jetty-component? What would you propose? Regards, Frank -- View this message in context: http://camel.465427.n5.nabble.com/Custom-component-for-weird-legacy-format-tp5733030.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Problem in mqtt Component
Hi Did you push some message to the topic which the route is subscribed? Can you add some log between your first route from and to endpoints? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 23, 2013 at 11:34 PM, Jinesh M.K wrote: Hi, I have some problem with mqtt end point using spring DSL. Here my route definition camel:route camel:from uri=mqtt:foo?host=tcp://myhost:1883amp;subscribeTopicName=test/# / camel:to uri=mqtt:bar?host=tcp:/myhost:1883amp;publishTopicName=test1/test / camel:log message=Message processed / /camel:route Using this route definition, the program taking long time to print the log message and nothing is published under test1/test topic. If I remove any one the mqtt route. It will works fine. For example camel:route camel:from uri=mqtt:foo?host=tcp://myhost:1883amp;subscribeTopicName=test/# / camel:to uri=file:/myhome/test / camel:log message=Message processed / /camel:route or camel:route camel:from uri=file:/myhome/test / camel:to uri=mqtt:bar?host=tcp:/myhost:1883amp;publishTopicName=test1/test / camel:log message=Message processed / /camel:route Both these condition works fine. Problem only using mqtt in from and to route. Any idea about it? Thanks in advance -- Jinesh M.K mkjin...@gmail.com (mailto:mkjin...@gmail.com)
Re: how is the automatica type conversion happening
There is a cache of the JAXB context, so the FallbackTypeConverter don't need to create a new one per request. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 21, 2013 at 8:38 PM, Vegi, Vamsi (MAN-Corporate-CON) wrote: Thank you, Well CompanyMsg is indeed a JaxB annotated. it is generated by the XJC compiler. But here is the question: Does Camel creates the JaxBContext every time? You know, that is an expensive operation. I am talking about performance tuning here. If that was already taken care of, great. in case, it is not taken care of, how can I use spring bean (JaxBContext) and give it to Camel for it to use the type conversion. Thanks much -Vamsi -Original Message- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Tuesday, May 21, 2013 1:13 AM To: users@camel.apache.org (mailto:users@camel.apache.org) Subject: Re: how is the automatica type conversion happening Hi Its the type converter that kicks in http://camel.apache.org/type-converter.html There is a fallback converter for JAXB so when you declare the method signature to have CompanyMsg as parameter type, then Camel will try to convert the message body to this type. And as CompanyMsg is a JAXB annotated class, then JAXB kicks-in. On Mon, May 20, 2013 at 7:22 PM, Vegi, Vamsi (MAN-Corporate-CON) vamsi.v...@manheim.com (mailto:vamsi.v...@manheim.com) wrote: Hello I am confused how the camel framework is automatically unmarshalling the XML file into an JaxB object Here is my Configurator, with the route def == @Override public void configure() throws Exception { LOG.info (http://LOG.info)(CompanyMsgRouter: configure called); try { jaxbContext = JAXBContext.newInstance(CompanyMsg.class); jaxbUnmarshaller = jaxbContext.createUnmarshaller(); } catch (JAXBException e) { e.printStackTrace(); } from(file:C:\\camel\\files\\in?noop=true) // contains XML Msg .routeId(READ_Q_ROUTE_ID) .log(LoggingLevel.INFO, uploading file:${header.CamelFilePath}) .bean(new TransformSvcCompanyMsg(), getCompleteCompanyDao); // expects JAXB object here } == The method: getCompleteCompanyDao has the signature like like public Company getCompleteCompanyDao(final CompanyMsg compMsg) { : : } Question is: when I run the app, it works fine, but I am confused as when and where the unmarshalling is happening. I am not explicitly calling the JaxB unmarshaller Is it using the jaxBUnMarshaller that I had previously defined? Btw, all the needed JaxB classes are in the path. -thanks -V -- Claus Ibsen - www.camelone.org (http://www.camelone.org): The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com (mailto:cib...@redhat.com) Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Sharing a solution for discussion
It will have nothing to do with camel, if you redirect the request to another location :) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 21, 2013 at 7:13 PM, wagnermarques wrote: About the creation of the SOAP message, I will take a look about data format, thanks. About javascript, the main purpose is provide a human response to the user. I think that it could be 1) a redirect to another location (possible another orbeon form) or 2) show a link to the user for he/her achieve the next page that the route determine or 3) just to thanks the user for the submitted data. My option for doing this by javascript is because I think it can provide much power to interact to the user in the browser and because it is more scalable in case of future necessity. What do you think about it? thanks -- View this message in context: http://camel.465427.n5.nabble.com/Sharing-a-solution-for-discussion-tp5732560p5732884.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: SSL : Server Certs and Client certificate passthrough
Yeah, it is very complex, I don't think current camel-cxf can support it out of box. Can I know more detail about the web service that you proxy with Camel? Why do you need to pass the clients request with re-attached key to the back service? Can you just pass the client id of something and let camel route use the fixed private key to send the request to back service? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 22, 2013 at 5:08 AM, RTernier wrote: My camel app is running pretty well, however it's using our unsecured webservice platform for development and PoC. I now need to change it so it works with our server certificates (x509) and use client certificate passthrough. We encrypt with the server cert. and use client certificates as a lock/key pair to get access. -Clients require the private key installed -The Server camel is on (currently windows) requires the private key installed. -Client sends public key, Camel will accept it, and then re-attach/re-send (find the key from a store) and pass that key onto the other end point. I'm not sure how all this will play out though. My current dev environment is on Windows, however this will be released onto a Linux box running Apache. Some of the routes I have in Camel/Spring are a reverse-proxy, and it requires the certificate to be re-attached, where others are a bit more complex - I'm hoping to figure out how to do the reverse-proxy part first. Are there any documents or papers on how this will work with Camel? Or any hints? Cheers. -- View this message in context: http://camel.465427.n5.nabble.com/SSL-Server-Certs-and-Client-certificate-passthrough-tp5732925.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Enable disable routes at startup using Spring
Hi, How about importing routes from other XML files[1]? You can put a dummy xml in you test resource directory which could be find first when you doing the POC or testing. When you want to run the route in production, you just need to make sure the dummy one is not in the class path. [1]http://camel.apache.org/spring.html#Spring-HowdoIimportroutesfromotherXMLfiles -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 21, 2013 at 10:28 PM, javaCzar wrote: Willem, My error in the last post. Your assitance with the {{xxx}} naming was correct. The variable is being set correctly and can be accessed bia this naming. I thought is was not working because what I am seeing that with autoStartup=false the endpoint still initializes, just the incoming data is not sent to the rest of the route. So, I guess this brings me to a second question. Is there a way to not initialize the endpoint via configuration. The reason that I need is for the following. I have an endpoint (QuickFIXj) that should not be connecting in certain circumstances For example, testing and dev instances should not attemtp to connect to a FIX server via this endpoint. However, prod instances need to have this enabled. I would imagine that this scenario exixst for many connection based services/endpoints. Is there a way to configure the camelContext with what essentially would work like old school compiler derectives: something along the lines of: camelContext route /route #ifdef PROD route /route #endif /camelContext Again, I know this code above is not valid, just an example of what I would need it to work like. As if it was not even there when not in prod. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-routes-at-startup-using-Spring-tp5732852p5732911.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Sharing a solution for discussion
Hi, I guess you need to do some xml transformation to make the xml fit of the soap message. Did you check out camel-xslt[1] before? [1]http://camel.apache.org/xslt.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, May 20, 2013 at 7:24 PM, wagnermarques wrote: Raúl, thanks for help. Your remark provide a councious reason to use camel-cxf, but, for now, as I am working with camel 2.8.0 and the parameters received from orbeon will never change (even for future forms) I planning making this change in another moment. Now I would like to ask about my next challenge I am facing: What could be a good approach to put the xml camming from existdb and send it, in a soap message, to a webserver? -- View this message in context: http://camel.465427.n5.nabble.com/Sharing-a-solution-for-discussion-tp5732560p5732839.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Sharing a solution for discussion
For the Question 1 I just found you create the SOAP message by hand, it could be more easy for you to use camel soap data format[1]. For the Question 2 What's the javascript looks like, if it is static you can add customer handler to the camel-jetty endpoint to return the static file to the browser. [1]http://camel.apache.org/soap.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 21, 2013 at 5:47 AM, wagnermarques wrote: Willem, I was thinking to start with a simple hardcoded string message first because I have a so simple webservice that receive a string and return the same string. If this is ok, I will work with real xml instances... I found a aproach to do it and if someone have a remark, please help me!!! My inspiration was https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-cxf/ Sorry for the length of the post and much comments, but I am put the solution in this way because was so hard to me find and understand a solution to create a cxf provider and it can help someone in the future. I would like to ask: 1) I am not shure if I still need xslt? Maybe in another moment. 2) Could I return javascript to the browser? *BELOW IS THE ROUTE* ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:cxf=http://camel.apache.org/schema/cxf; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd; cxf:cxfEndpoint id=echoEndpoint serviceClass=org.apache.camel.example.cxf.provider.GreeterProvider address=http://localhost:8282/ode/processes/ProcessoSincrono; wsdlURL=wsdl/ProcessoSincronoArtifacts.wsdl endpointName=s:ProcessoSincronoPort serviceName=s:ProcessoSincronoService xmlns:s=br.edu.fzlbpms.teste/ camelContext xmlns=http://camel.apache.org/schema/spring; route id=FZLBPMS_CAMEL_ROUTE___OrbeonService from uri=jetty:http://localhost:18181/orbeonservice/pega_dados_do_formulario?sessionSupport=true/ to uri=Handle_App_e_FormTitle_camming_from_orbeonformPROCESSOR/ setHeader headerName=CamelHttpUri simplehttp://localhost:8282/exist/rest/db/orbeon/fr/${header.fzlbpms_orbeon_app}/${header.fzlbpms_orbeon_form}/data/${header.fzlbpms_orbeon_dataId}/data.xml/simple /setHeader log message=--/ log message=before inOut.../ log message=### body = ${body}/ log message=###/ log message=###/ log message=###/ inOut uri=http://doesnt.matter.we/override/it/anyways; / log message=--/ log message=before SOAPMessageProducerPROCESSOR.../ log message=### body = ${body}/ log message=###/ log message=###/ log message=###/ to uri=SOAPMessageProducerPROCESSOR/ log message=--/ log message=before SOAPMessageProducerPROCESSOR.../ log message=### body = ${body}/ log message=###/ log message=###/ log message=###/ to uri=cxf:bean:echoEndpoint / log message=--/ log message=before SOAPMessageConsumerPROCESSOR.../ log message=### body = ${body}/ log message=###/ log message=###/ log message=###/ to uri=SOAPMessageConsumerPROCESSOR/ log message=--/ log message=before SOAPMessageConsumerPROCESSOR.../ log message=### body = ${body}/ log message=###/ log message=###/ log message=###/ inOut uri=http://doesnt.matter.we/override/it/anyways; / /route /camelContext bean id=SOAPMessageConsumerPROCESSOR class=br.edu.fzlbpms.service.orbeon.SOAPMessageConsumerPROCESSOR / bean id=SOAPMessageProducerPROCESSOR class=br.edu.fzlbpms.service.orbeon.SOAPMessageProducerPROCESSOR / bean id=Handle_App_e_FormTitle_camming_from_orbeonformPROCESSOR class=br.edu.fzlbpms.service.orbeon.Pega_dados_do_formularioPROCESSOR / /beans public class SOAPMessageConsumerPROCESSOR implements Processor { /** * just prepare to show response in the browser */ public void process(Exchange exchange) throws Exception { //SOAPMessage processSOAP = processSOAP(exchange); String soapMessageBodyContentAsString = SOAPMessageBodyContentAsString(exchange); exchange.getIn().setBody(soapMessageBodyContentAsString); } public String SOAPMessageBodyContentAsString(Exchange exchange){ SOAPMessage soapMessage = (SOAPMessage)exchange.getIn().getBody(List.class
Re: Enable disable routes at startup using Spring
Hi, How did you setup the property component? I think you can not use the Spring property placeholder inside route definition. But here is an example you can take a look. camelContext xmlns=http://camel.apache.org/schema/spring; propertyPlaceholder id=properties location=org/apache/camel/my.properties/ route autoStartup={{enableRoute}} …… -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 21, 2013 at 4:44 AM, javaCzar wrote: Is there a way to get something like this to work: route autoStartup=${enableRoute} The value of the attribute is set to a valid parsible string representation of a boolean (ie. true or false) yet I keep getting the following error: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route8: Route[[From[quickfix:quickfix.cfg]] - [Filter[s... because of Error parsing [${enableRoute}] from property ${enableRoute} as a Boolean. Any assistnace would be greatly appreciated. -- View this message in context: http://camel.465427.n5.nabble.com/Enable-disable-routes-at-startup-using-Spring-tp5732852.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: jetty:http dynamic uri in consumer (from)
You are sending the InOnly message to seda endpoint. Can you change it to InOut? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, May 17, 2013 at 8:38 AM, paramjyotsingh wrote: 1) I have a requirement to expose a REST service POST with uri like http://localhost:9080/boxes/{boxid} would it be possible to expose this using jetty:http like: from uri=jetty:http://localhost:9080/boxes/{boxid} / i know this doesn;t work it works with restlet 2) In above question i am trying to use jetty:http as it allows custom HttpBinding and I am using custom implementation to close connection and write response for service exposed via camel. from uri=restlet:http://localhost:9080/boxes/{boxid}/ to uri=quot;lt;test-validate-service/ inOnly uri=seda:background-processing/ in this example i am expecting response from validate-service as response for /boxes/{boxid} service and i don;t want it to wait for background processing to complete. But somehow my client connection is not getting closed and at client side and i am not able to process response send by this route. Please help.. -- View this message in context: http://camel.465427.n5.nabble.com/jetty-http-dynamic-uri-in-consumer-from-tp5732691.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: camel multicast
Did you set the stopOnException option to be true in your multicast? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, May 17, 2013 at 2:00 AM, Nibs wrote: Hi I am using camel 2.4 I know its a old version of camel but I need a help badly I am using multiacast to process same message differently. I wanted to replies from both the message ,so if one endpoint fails to process the message ,the 2nd endpoint also stop the processing and the message will go to the errorHandle block. for that i am using customAggregationStrategy so i can get a control of both the endpoints . But dont know what is wrong in my code because control never enters in customAggregationStrategy class So i cant check the replies from endpoints Please look the code below and help me out bean id=aggregatorStrategy1 class=com.E_AggregationStrategy / bean id=reslutData class=com.E_AggregationStrategy / - route id=xmlProcessing trace=false from uri=direct:xmlPrcessing / convertBodyTo type=java.lang.String / - doTry - choice - when simple${header.CamelFileNameOnly} contains ${properties:xml_prefix}/simple - setHeader headerName=org xpatheformular/forminfo/orgg/text()/xpath /setHeader - setHeader headerName=efname xpath resultType=Stringeformular/forminfo/ename/text()/xpath /setHeader process ref=testProcessor / - routingSlip headerxsdFile/header /routingSlip log loggingLevel=INFO message=Header Check My ::: ${header.checkMyc} / - choice - when simple${header.checkMyC} == 'YES'/simple convertBodyTo type=java.lang.String / - multicast stopOnException=true strategyRef=aggregatorStrategy1 parallelProcessing=true to uri=direct:outbox / to uri=direct:Commitprocessing / /multicast convertBodyTo type=java.lang.String / bean ref=resultData method=result_out / - choice - when simple${header.OUTBOX} == null/simple log loggingLevel=INFO message=After multicast body for outbox ${body}!! / /when - when simple${header.MEP} != null/simple log loggingLevel=INFO message=After multicast body for MEP ${body}!! / /when /choice log loggingLevel=INFO message=after multicast ::${header.CamelFileNameOnly} / /when - otherwise log loggingLevel=INFO message=do nothing !!! / /otherwise /choice /when - otherwise log loggingLevel=INFO message=!!not an xml file / to uri=seda:attachments / /otherwise /choice - doCatch exceptionjava.lang.Exception/exception - handled constanttrue/constant /handled log loggingLevel=ERROR message= ${exception} ${exception.message} / - /doCatch /doTry /route - - route id=outbox trace=false from uri=direct:outbox / convertBodyTo type=java.lang.String / - - routingSlip headerxsltFile/header /routingSlip log loggingLevel=INFO message=Aftere recipientList xslt: ${header.CamelFileNameOnly} / - routingSlip headerxsd_After_xslt/header /routingSlip - /route - route id=CommitEprocessing trace=false from uri=direct:Commitprocessing / convertBodyTo type=java.lang.String / - routingSlip headermyCommitxsltFile/header /routingSlip - routingSlip headerxsd_ME_afterXslt/header /routingSlip /route - route id=sucsess trace=false from uri=direct:success / convertBodyTo type=java.lang.String / - setHeader headerName=outbox simple${properties:outbox}/${header.org (http://header.org)}//simple /setHeader - routingSlip headeroutbox/header /routingSlip /route - /camelContext /beans Thank you -- View this message in context: http://camel.465427.n5.nabble.com/camel-multicast-tp5732682.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: camel-cxf intermittent error:
Hi, It is looks like CXF will have some trouble to access the wsdl when it is starting up. Can you just remove the wsdlURL option from the camel-cxf endpoint uri, as you are using MESSAGE dataFormat, you don't need to specify the it. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 16, 2013 at 10:01 PM, Daniel Bularzik wrote: Hello! New to Camel, new to this list. Please let me know if this is the wrong place to ask questions like this. I'm using Camel 2.11.0, and CXF 2.7.4; running Camel in Tomcat 7.0.25. I have a basic route to prove that I can hit a web service: camel:camelContext camel:endpoint id=bvgService uri=cxf://http://buzz.akc.org:8080/bvg-service/services/bvgServicePort?wsdlURL=http://buzz.akc.org:8080/bvg-service/services/bvgServicePort?wsdlamp;serviceName={http://services.akc.org/v_2_0/bvg}bvg-serviceamp;portName={http://services.akc.org/v_2_0/bvg}bvgServicePortamp;dataFormat=MESSAGE/ camel:route id=bvg-web-route camel:from uri=jetty:http://0.0.0.0:8380/bvg?matchOnUriPrefix=true/ camel:wireTap uri=file:/akcdata/bvg-tap-web/ camel:to ref=bvgService/ /camel:route /camel:camelContext ...and 95% of the time, it works. 5% of the time, however, the route fails, ultimately because of this: [qtp616904194-46] ERROR DefaultErrorHandler - Failed delivery for (MessageId: ID-buzz-34212-1368475333170-0-30731 on ExchangeId: ID-buzz-34212-1368475333170-0-30728). Exhausted after delivery attempt: 1 caught: java.lang.IllegalStateException: IllegalStateException invoking http://buzz.akc.org:8080/bvg-service/services/bvgServicePort: Already connected [snip] Caused by: java.lang.IllegalStateException: Already connected at java.net.HttpURLConnection.setFixedLengthStreamingMode(HttpURLConnection.java:143) at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setFixedLengthStreamingMode(URLConnectionHTTPConduit.java:272) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thresholdNotReached(HTTPConduit.java:1085) at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:99) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1301) I've spent a lot of time combing through my pom, so I'm reasonably sure that I'm not loading conflicting versions of any libraries. Anyone have any pointers? Daniel Bularzik, Lead Software Engineer 8051 Arco Corporate Drive, Suite 100, Raleigh, NC 27617 919-816-3818, d...@akc.org (mailto:d...@akc.org) www.akc.org (http://www.akc.org)
Re: Streaming a PDF from remote machine
I'm afraid you have to implement the timeout mechanism yourself. I don't aware camel provides this feature out of box. BTW, I think the solution2 that you have is a good one. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 14, 2013 at 4:46 PM, Chinababu Illa wrote: Thanks Willem. A bit more details on the problem. There are 3 applications involved in this issue. FrontEnd, Link and Host. Link sits between FrontEnd and Host. When FrontEnd sends a request (http post) to Link it in turn sends a request to Host and also creates two streams one to read from Host and other one to send the same data to FrontEnd. Due to slow streaming from Host, the FrontEnd to download the file is taking longer time. And we cannot afford user waiting for that longer. So, want to terminate downloading after certain period of time. Please find details below for your points. *Are you using FTP to download the file?* - /No./ *I'm not sure how the BufferedInputStream is involved. * - /FrontEnd reads response as Stream (InputStream) is how BufferedInputStream involved here. We are wrapping InputStream with BufferedInputStream./ *If the file is downloaded, the BufferedInputStream will never time out.* - /Consider a case where file is still downloading and read never gets timedout as it is getting data (a less data) for every read/ *If the BufferedInputStream has the timeout mechanism, I don't think you need to check if the File is download.* - /BufferedInputStream has the timeout mechanism but it will never timeout as it gets data within timeout period./ I have already got two solutions with me. 1) Implementing timeout manually (not a good idea, not elegant solution) 2) Create a message listener send a message to start downloading, send a message to terminate downloading after certain time. 3) Looking if Camel can solve this by auto imposing timeout. So, please let me know if Camel has a solution for this kind of problems. If so, point me what to look into. Thanks, Chinna -- View this message in context: http://camel.465427.n5.nabble.com/Streaming-a-PDF-from-remote-machine-tp5732401p5732474.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: How to create a generic SOAP consumer?
Hi, It looks like you are deploying the camel route into OSGi container? The warning means there are more than on javax.xml.ws.WebServiceProvider classes are loaded by deferent Classloader. Are you using Karaf or ServiceMix? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, May 11, 2013 at 6:21 PM, Smith-John wrote: Hi, my route now looks like this: from(cxf:http://localhost:8050/service?dataFormat=PAYLOAD;)... (PAYLOAD mode without wsdl and serviceClass). But with this I get a NullPointer exception where I add the route to the CamelContext (camelContext.addRoutes(new GenericSOAPRoute());). Don't know if it helps, but LOG says: 12:08:27.575 DEBUG o.a.c.core.osgi.OsgiDefaultCamelContext:1985 Warming up route id: route3 having autoStartup=true 12:08:27.575 TRACE org.apache.camel.support.ServiceSupport:54 Service already started 12:08:27.575 DEBUG org.apache.camel.impl.RouteService:129 Starting services on route: route3 12:08:27.591 DEBUG o.apache.camel.component.cxf.CxfEndpoint:279 Ignore DataFormat mode PAYLOAD since SEI class is annotated with WebServiceProvider 12:08:27.591 DEBUG o.apache.camel.component.cxf.CxfEndpoint:307 ServerFactoryBean: org.apache.cxf.jaxws.JaxWsServerFactoryBean@1a0283e added properties: {} 12:08:27.607 DEBUG o.apache.camel.component.cxf.CxfEndpoint:740 Using DefaultBus org.apache.cxf.bus.extension.ExtensionManagerBus@eeabe8 11.05.2013 12:08:27 org.apache.cxf.jaxws.support.JaxWsImplementorInfo getWebServiceProviderAnnotation WARNUNG: The javax.xml.ws.WebServiceProvider annotation was already loaded by another classloader. Please check if there are multiple versions of the web service annotation jar in your classpath. 12:08:27.622 INFO o.a.c.core.osgi.OsgiDefaultCamelContext:1590 Apache Camel 2.10.4 (CamelContext: 101-camel-6) is shutting down 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:111 Stopping service org.apache.camel.impl.RouteService@16c14c0 12:08:27.622 TRACE o.a.c.m.DefaultManagementLifecycleStrategy:541 The route is not managed: EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] 12:08:27.622 DEBUG org.apache.camel.impl.RouteService:197 Stopping services on route: route3 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:111 Stopping service EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:186 Shutting down service: EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] 12:08:27.622 TRACE org.apache.camel.support.ServiceSupport:82 Service already stopped 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:163 Shutting down service org.apache.camel.impl.RouteService@16c14c0 12:08:27.622 DEBUG org.apache.camel.impl.RouteService:240 Shutting down services on route: route3 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:106 Service already stopped: EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:186 Shutting down service: EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] 12:08:27.622 TRACE org.apache.camel.support.ServiceSupport:149 Service already shut down 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:111 Stopping service Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] 12:08:27.622 TRACE org.apache.camel.util.ServiceHelper:186 Shutting down service: Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] 12:08:27.622 TRACE org.apache.camel.support.ServiceSupport:82 Service already stopped 12:08:27.622 TRACE o.a.c.m.DefaultManagementLifecycleStrategy:541 The route is not managed: EventDrivenConsumerRoute[Endpoint[cxf://http://localhost:8050/service?dataFormat=PAYLOAD] - Instrumentation:route[DelegateAsync[UnitOfWork(Channel[sendTo(Endpoint[stream://out])])]]] -- View this message in context: http://camel.465427.n5.nabble.com/How-to-create-a-generic-SOAP-consumer-tp5731741p5732332.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Using camel-servlet with Multipart - unable to fetch the file
camel will try to digest the HttpServletRequest and setup the message headers and body. It's a common practice to consume the input stream from message body :) -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 15, 2013 at 4:47 AM, crmanoj wrote: This is resolved by using/parsing the input stream from camel body instead of using the HttpServletRequest from camel Headers. -- View this message in context: http://camel.465427.n5.nabble.com/Using-camel-servlet-with-Multipart-unable-to-fetch-the-file-tp5732204p5732534.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: JAXB Interface Issue
Hi, I just found you are using equinox container. You can either put the jar into JDK endorse directory, or hack the properties file to make sure the com.sun.xml.internal.bind packages are not exported. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 15, 2013 at 1:53 AM, Claus Ibsen wrote: Hi You can possible add jaxb-impl JAR to the classpath so you can control which JAXB impl is in use. The ones from the JDK is sometimes outdated and buggy. On Tue, May 14, 2013 at 5:04 PM, David Carver dcar...@intalio.com (mailto:dcar...@intalio.com) wrote: With Open JDK 7 we have been getting some odd issues lately when running camel in an equinox container. The following is the stack trace we get: org.springframework.beans.factory.config.BeanPostProcessor is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at org.springframework.beans.factory.config.BeanPostProcessor at public org.springframework.beans.factory.config.BeanPostProcessor org.apache.camel.spring.CamelContextFactoryBean.getBeanPostProcessor() at org.apache.camel.spring.CamelContextFactoryBean at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:212) ~[jaxb-api_2.2.7.jar:na] at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146) ~[jaxb-api_2.2.7.jar:na] ... 159 common frames omitted Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 39 counts of IllegalAnnotationExceptions at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:451) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.init(JAXBContextImpl.java:283) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.init(JAXBContextImpl.java:126) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1148) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:130) ~[na:1.7.0_21] at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:221) ~[na:1.7.0_21] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_21] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_21] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_21] at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_21] at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186) ~[jaxb-api_2.2.7.jar:na] ... 160 common frames omitted This is running with springframework 3.1.2. I'm running out of ideas as to what can cause this issue as the JAXB implementation is being brough in from the jdk. Anybody else seen this issue? Dave -- Claus Ibsen - www.camelone.org (http://www.camelone.org): The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com (mailto:cib...@redhat.com) Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Problem from Java DSL to Spring DSL
Hi, I think you cannot use the constant of Exchange.FILE_NAME directly in the Spring DSL. You should use the String directly like this camel:setHeader headerName=CamelFileName/ camel:constantrequest-${date:now:-MM-dd-HHmmssSSS}/camel:constant -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 15, 2013 at 10:40 AM, Gary Liu wrote: Hello, I am trying to translate the following Java DSL (This is the example from 2.10.4). The Java DSL works fine. But I after I translate to Spring DSL, several things are not working as expected. Would someone please help? Java DSL=== from(cxf:bean:reportIncident) .convertBodyTo(InputReportIncident.class) .setHeader(Exchange.FILE_NAME, constant(request-${date:now:-MM-dd-HHmmssSSS})) .wireTap(file://target/inbox/) .choice().when(simple(${body.givenName} == 'Claus')) .transform(constant(ok)) .otherwise() .bean(new ReportIncidentImpl(), doReportIncident) .transform(constant(accepted) ); ===SPRING DSL=== camel:camelContext id=camel camel:route camel:from uri=cxf:bean:reportIncident / camel:convertBodyTo type=org.apache.camel.example.reportincident.InputReportIncident / camel:setHeader headerName=${Exchange.FILE_NAME} camel:constantrequest-${date:now:-MM-dd-HHmmssSSS}/camel:constant /camel:setHeader camel:wireTap uri=file://target/inbox//camel:wireTap camel:choice camel:when camel:simple${body.givenName} == 'Claus'/camel:simple camel:transform camel:constantOK/camel:constant /camel:transform /camel:when camel:otherwise camel:transform camel:constantAccepted/camel:constant /camel:transform /camel:otherwise /camel:choice /camel:route /camel:camelContext === Here are the things I did not translate propertly: .choice().when(simple(${body.givenName} == 'Claus')) .transform(constant(ok)) NOT THE SAME AS: camel:choice camel:when camel:simple${body.givenName} == 'Claus'/camel:simple camel:transform camel:constantOK/camel:constant /camel:transform /camel:when .setHeader(Exchange.FILE_NAME, constant(request-${date:now:-MM-dd-HHmmssSSS})) NOT THE SAME AS: camel:setHeader headerName=${Exchange.FILE_NAME} camel:constantrequest-${date:now:-MM-dd-HHmmssSSS} Thanks, --Gary -- View this message in context: http://camel.465427.n5.nabble.com/Problem-from-Java-DSL-to-Spring-DSL-tp5732558.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Sharing a solution for discussion
Hi, I'm not sure why you chose camel-cxfrs component to accept the request. If you just want to process the form, you can use the camel-jetty or camel-servlet directly. It could be more easy to add the basic autentications supports out of box. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 15, 2013 at 11:03 AM, wagnermarques wrote: Hello camel riders, I would like to share a solution and ask if it was the best aproach. I think it can be util for some one in the future and because is a interesting example of integration using camel! The use case: I have a orbeon forms installed that was configured to: 1) save the form date to existdb and 2) after it, send metadata of the form to my camel route described below. With the camel route, with the metadate of the form submited (using camel-http) the route interact with existdb rest api to get the real date of the form. Ok, it is a simplification of the use case, because next step is improve it with business rules upon form metadata and start a business process deployed in apache ode. But start the process from the route is not implemented yet and not described here. That is the code (sorry for much comments) ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:cxf=http://camel.apache.org/schema/cxf; xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd; cxf:rsServer id=rsRestServices_OrbeonServer address=http://localhost:18181/orbeonservice; serviceClass=br.edu.fzlbpms.service.orbeon.ControllerService / camelContext xmlns=http://camel.apache.org/schema/spring; route id=FZLBPMS_CAMEL_ROUTE___cxfrs_bean_rsRestServices_OrbeonServer from uri=cxfrs:bean:rsRestServices_OrbeonServer / setBody constant/constant /setBody to uri=Handle_App_e_FormTitle_camming_from_orbeonformPROCESSOR/ setHeader headerName=CamelHttpUri simple http://localhost:8282/exist/rest/db/orbeon/fr/${header.fzlbpms_orbeon_app}/${header.fzlbpms_orbeon_form}/data/${header.fzlbpms_orbeon_dataId}/data.xml?bridgeEndpoint=true /simple /setHeader inOut uri=http://doesnt.matter.we/override/it/anyways; / /route /camelContext bean id=messageInspectProcessor class=br.edu.fzlbpms.service.orbeon.MessageInspectProcessor / bean id=Handle_App_e_FormTitle_camming_from_orbeonformPROCESSOR class=br.edu.fzlbpms.service.orbeon.Pega_dados_do_formularioPROCESSOR / bean id=BuildResponseProcessor class=br.edu.fzlbpms.service.orbeon.BuildResponseProcessor / /beans This processor is important to distinct what data is camming from witch form by filling the values of the headers: ${header.fzlbpms_orbeon_app} ${header.fzlbpms_orbeon_form} ${header.fzlbpms_orbeon_dataId} public class Pega_dados_do_formularioPROCESSOR implements Processor{ public void process(Exchange exchange) throws Exception { String camelHttpQuery = (String)exchange.getIn().getHeader(CamelHttpQuery); //app=existappform=existappform1document=c757e862848cf9cc2e170d9325a1fc94c282a8e4 String[] split = camelHttpQuery.split(); //app=existapp String[] appParam = split[0].split(=); String app = appParam[1]; String[] formParam = split[1].split(=); String form = formParam[1]; String[] dataParam = split[2].split(=); String dataId = dataParam[1]; System.out.println(\n\n); System.out.println(app); System.out.println(form); System.out.println(dataId); exchange.getIn().setHeader(fzlbpms_orbeon_app, app); exchange.getIn().setHeader(fzlbpms_orbeon_form, form); exchange.getIn().setHeader(fzlbpms_orbeon_dataId, dataId); } } I still have several problems and doubts, like basic autentications for example, but for now I just would like to share and to ask about if it was a good aproach of this kind of integration (if it is relevant in some sense). Thanks, -- View this message in context: http://camel.465427.n5.nabble.com/Sharing-a-solution-for-discussion-tp5732560.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Problem from Java DSL to Spring DSL
Hi, Can you check if you put the camel-jaxb jar into your class path? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 15, 2013 at 11:09 AM, Gary Liu wrote: Thanks William! That works. Now, my transform part is still not working. Any sugguestions? -- View this message in context: http://camel.465427.n5.nabble.com/Problem-from-Java-DSL-to-Spring-DSL-tp5732558p5732563.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Streaming a PDF from remote machine
Are you using FTP to download the file? I'm not sure how the BufferedInputStream is involved. If the file is downloaded, the BufferedInputStream will never time out. If the BufferedInputStream has the timeout mechanism, I don't think you need to check if the File is download. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, May 13, 2013 at 7:38 PM, Chinababu Illa wrote: Hi All, I have a requirement to read a pdf as binary stream from remote application within specified time. My application code is using BufferedInputStream to read from remote application, code is implemented in Java. While reading the data, I need to apply 2 different timeouts: 1) a timeout for individual bufferedInputStream.read() (if this waits longer, it will be timedout) 2) a timeout for entire file to be download (say 2 min, if the file is not completely downloaded within 2 min, then timeout) I have a solution using timeout calculation manually, but it is not elegant solution. So wanted to know if this can be done using camel. I looked into stream component but didn't quite understood. Please let me know if above 2 requirements can be implemented using camel. Note: None of the two applications are using Files here. My remote application gets the stream data from different application. Thanks, Chinna -- View this message in context: http://camel.465427.n5.nabble.com/Streaming-a-PDF-from-remote-machine-tp5732401.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Slow startup of routes
Hi, It looks like Camel takes lots of time to create a new Http endpoint, maybe you need to consider to do some caching work for it. BTW, whyou you need to se the soTimeout per endpoint. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, May 12, 2013 at 3:10 PM, hussainpirosha wrote: Hi, I am using camel to implement dispatcher EIP. There are thousands of messages in a queue which needs to be delivered at different URLs. Each message has its own delivery URL and delivery protocol (ftp,email,http etc). The way we are implementing in Camel is - Boot a single camel context, the context is disabled for JMX and the loadStatisticsEnabled is set to false on the ManagementStrategy. As mentioned in a jira issue, addressed in 2.11.0 version, for disabling the background management thread creation. - For each message a route is being constructed , the message is being pushed to the route for delivery. - After the message is processed route is shutdown and removed from context. We did a small perf test by having 200 threads of dispatcher component, each sharing the same context. Observed that the time to start a route increases upto a maximum of 60 seconds while the time to process is in milliseconds. Issue CAMEL-5675 mentions that this has been fixed but we are still observing significant time being taken in starting up routes. Pls suggest, what should we do to solve this. The route that we are creating for http is from(direct:+dispatchItem.getID()).toF(%s?httpClient.soTimeout=%sdisableStreamCache=true, dispatchItem.getEndPointURL(),timeOutInMillis); Each dispatchItem has a unique ID. Thanks, Hussain -- View this message in context: http://camel.465427.n5.nabble.com/Slow-startup-of-routes-tp5732356.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: impliedDecimalSeparator not working for numbers starting with 0
It looks we need to add a rounding mode when calling the divide method. The default value which is used in the divide method is RoundingMode.UNNECESSARY. You will get the exception when the divide method don't know how to round. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 14, 2013 at 5:50 AM, double_nill wrote: With Camel 2.11 the impliedDecimalSeparator appears to have a problem with numbers starting with 0. For example: @DataField(pos = 1, precision = 10, length = 11, impliedDecimalSeparator = true) private BigDecimal foobar; value: 0123567 Throws an error Non-terminating decimal expansion; no exact representable decimal result. caused by java.math.BigDecimal.divide(BigDecimal.java:1616) org.apache.camel.dataformat.bindy.format.BigDecimalFormat.parse(BigDecimalFormat.java:38) org.apache.camel.dataformat.bindy.format.BigDecimalFormat.parse(BigDecimalFormat.java:23) (...) From what I've been able to follow in the SVN updates for Camel 2.11.0 for this change it looks like perhaps the result.divide may be trying to divide by a zero multiplier, but I'm not 100% sure. -- View this message in context: http://camel.465427.n5.nabble.com/impliedDecimalSeparator-not-working-for-numbers-starting-with-0-tp5732448.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: impliedDecimalSeparator not working for numbers starting with 0
I just found there are some bugs in the code, so I fill a JIRA[1] for it. [1]https://issues.apache.org/jira/browse/CAMEL-6358 -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 14, 2013 at 10:24 AM, Willem jiang wrote: It looks we need to add a rounding mode when calling the divide method. The default value which is used in the divide method is RoundingMode.UNNECESSARY. You will get the exception when the divide method don't know how to round. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Tuesday, May 14, 2013 at 5:50 AM, double_nill wrote: With Camel 2.11 the impliedDecimalSeparator appears to have a problem with numbers starting with 0. For example: @DataField(pos = 1, precision = 10, length = 11, impliedDecimalSeparator = true) private BigDecimal foobar; value: 0123567 Throws an error Non-terminating decimal expansion; no exact representable decimal result. caused by java.math.BigDecimal.divide(BigDecimal.java:1616) org.apache.camel.dataformat.bindy.format.BigDecimalFormat.parse(BigDecimalFormat.java:38) org.apache.camel.dataformat.bindy.format.BigDecimalFormat.parse(BigDecimalFormat.java:23) (...) From what I've been able to follow in the SVN updates for Camel 2.11.0 for this change it looks like perhaps the result.divide may be trying to divide by a zero multiplier, but I'm not 100% sure. -- View this message in context: http://camel.465427.n5.nabble.com/impliedDecimalSeparator-not-working-for-numbers-starting-with-0-tp5732448.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Synchronous InOnly with new message
What you want to do with the initial message body? If you don't need that body object anymore , you can set it to be null. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, May 10, 2013 at 6:34 PM, nikagra wrote: Hello I'm looking for a way to implement synchronous InOnly with new message body (wich is empty in my case) My route makes some processing of some task and I want in some moments update status of this processing. Number of statuses is quite large. So I've decided to make updating synchronous to get rid of possible problems. Body of the message could be also quite big (greater then 1 mb of xml). Since message body is not used for updating status I'd like to set it to null to not to overload activemq First attempt: // Task processing route .setHeader(CamelConstants.TASK_STATUS, constant(NEW)) .inOnly(direct:updateStatus) // Status updating route from(direct:updateStatus).routeId(direct:updateStatus) .setBody(constant(null)) .inOnly(activemq:queue:updateStatus); Problem is that this changes initial exchange message Next attempt is to use WireTap. Problem is that it is asynchronous. Also wireTap could not be last expression in route (i.e. to set status DONE) I think I'm missing something. What are other options? -- View this message in context: http://camel.465427.n5.nabble.com/Synchronous-InOnly-with-new-message-tp5732258.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Using camel-servlet with Multipart - unable to fetch the file
Hi I suggest you remove the streamCaching() and to(log:servlet) from your route. Current streamCaching doesn't support to caching the Servlet request input stream. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 9, 2013 at 9:22 AM, crmanoj wrote: Hi, I am trying to upload a file to the server from client using multipart/form-data. The server endpoint is a camel-servlet endpoint. I am able to get the httprequestbody from the call using (in.headers), to parse the form data and uploaded file data i'm using commons-fileupload( streaming api http://commons.apache.org/proper/commons-fileupload/streaming.html ) library. Though the request is a multipart, I am unable to get the fileitems from the function call. Here is the codesnippet used to get the item (iter.hasNext() always returns false). HttpServletRequest request = (HttpServletRequest) headers.get(Exchange.HTTP_SERVLET_REQUEST); // Check if the request is actually a multipart/form-data request. LOG.info (http://LOG.info)(IS Mulipart: + ServletFileUpload.isMultipartContent(request)); if (!ServletFileUpload.isMultipartContent(request)) { return No Data found; } // Create a new file upload handler ServletFileUpload upload = new ServletFileUpload(); FileItemIterator iter = upload.getItemIterator(request); LOG.info (http://LOG.info)(iter has next: + iter.hasNext()); My Camel route looks like below: from(servlet:///addContent).streamCaching() .to(log:servlet).beanRef(sampleProcessor); My camel Servlet component definition goes as below: service ref=camelServlet interfaces valuejavax.servlet.Servlet/value valueorg.apache.camel.component.http.CamelServlet/value /interfaces service-properties entry key=alias value=/camel/services / entry key=matchOnUriPrefix value=true / entry key=servlet-name value=CamelServlet/ /service-properties /service osgi:reference id=servletref interface=org.apache.camel.component.http.CamelServlet osgi:listener bind-method=register unbind-method=unregister ref bean=httpRegistry / /osgi:listener /osgi:reference bean id=httpRegistry class=org.apache.camel.component.servlet.DefaultHttpRegistry /bean bean id=servlet class=org.apache.camel.component.servlet.ServletComponent property name=httpRegistry ref=httpRegistry / /bean This project is run in fuse-esb-7.1.0.fuse-047 using camel version: 2.9. JDK: 1.6. Could anyone guide me to separate the form parameters and file data using servlet endpoint? Thanks in Advance! -- View this message in context: http://camel.465427.n5.nabble.com/Using-camel-servlet-with-Multipart-unable-to-fetch-the-file-tp5732204.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Using camel-servlet with Multipart - unable to fetch the file
camel-jetty is using org.eclipse.jetty.servlets.MultiPartFilter to handle this multipart message. You may consider to configure the filter in your web.xml. -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 9, 2013 at 2:35 PM, crmanoj wrote: Thank you for replying! I have tried removing them but no difference. Am I using the component correctly? Is there any other way to get the form fields and data separetely? I have tried camel-jetty component and it separates the form fields and data, Is there anything similar to that in camel-servlet? Thank you! -- View this message in context: http://camel.465427.n5.nabble.com/Using-camel-servlet-with-Multipart-unable-to-fetch-the-file-tp5732204p5732211.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: file endpoint not reflecting the filename set in the header from smtp endpoint
Can you show us your Camel route? -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Wednesday, May 8, 2013 at 6:50 PM, Mohammad Shadab Ali wrote: Hi Claus, I tried with the CamelFileName header, but it doesn't work. It is still taking the first attachment name, also another strange thing is that the content of the attachment which I am setting in the exchange body is also not getting changed, it is also remaining same for the all next two message. I think camel is not flushing the contents of headers and body contents after message processing completed. I there a way in camel to flush out the headers and body once the processing of exchange completed. Regards, Shadab -Original Message- From: Claus Ibsen [mailto:claus.ib...@gmail.com] Sent: Wednesday, May 08, 2013 11:23 AM To: users@camel.apache.org (mailto:users@camel.apache.org) Subject: Re: file endpoint not reflecting the filename set in the header from smtp endpoint Hi The key for the header is CamelFileName eg Exchange.FILE_NAME On Tue, May 7, 2013 at 5:42 PM, Mohammad Shadab Ali mohammad.a...@genpact.com (mailto:mohammad.a...@genpact.com) wrote: Hi, I am using camel 2.9.0 version. I have a route SMTP--File. I am downloading the attachment from the mail setting the attachment content into the exchange body and setting the attachment filename in header CamelFileName. exchange.getIn().setHeader(CamelFileNameOnly, filename); I sent 3 mails with different attachment and it processed all successfully, in output directory I am getting only one file which is of the first mail attachment. The problem is that for 2nd and 3rd message camel file name is not getting reflected to the file endpoint and it takes the filename of the first message. I tried with not setting the filename in the SMTP endpoint then file endpoint is generating a unique filename for each message and I am getting the desired output(3 files). But I want to store the file with the name of the attachment but it is not getting reflected in file component. Any help would be appreciated. Regards, Shadab *** This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone delete it from their system without making any copies or disclosing it to a third person.*** This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone delete it from their system without making any copies or disclosing it to a third person. -- Claus Ibsen - Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com (mailto:cib...@redhat.com) Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen *** This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone delete it from their system without making any copies or disclosing it to a third person.*** This e-mail (and any attachments), is confidential and may be privileged. It may be read, copied and used only by intended recipients. Unauthorized access to this e-mail (or attachments) and disclosure or copying of its contents or any action taken in reliance on it is unlawful. Unintended recipients must notify the sender immediately by e-mail/phone delete it from their system without making any copies or disclosing it to a third person.
Re: when an exception happens, I want to shut down the routes..
Hi You can use ErrorHandler[1] with some codes here[2] [1]http://camel.apache.org/error-handler.html [2]http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, May 9, 2013 at 5:03 AM, Gvvenkat wrote: If an exception occurs while processing, I would like to invoke the process of shutting down the routes in the context. Can you please tell me, if this can be achieved in camel. If so, an example will be great help for me. Thanks gvvenkat -- View this message in context: http://camel.465427.n5.nabble.com/when-an-exception-happens-I-want-to-shut-down-the-routes-tp5732199.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: OT: Aggregation of billable data?
I'm not sure if the billing service needs the data from the business analysis. If it doesn't need those data, it could be more easy by using wire-tap[1] [1]http://camel.apache.org/wire-tap.html -- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, April 25, 2013 at 9:29 PM, James Green wrote: This isn't to do with Camel per se but I'm hopeful I'm asking this question of the the right audience! Basically we're going to be routing event messages into some storage component where some of those messages may be billable to customers. We have an existing service that charges customers based on a high level aggregate summary of activity. We are missing a component that takes these new event messages, performs business analysis on them, then sends them onwards into our existing billing service. BPM sounds almost like the thing we want, but it's rather broad given our somewhat narrow scope. Can any Camel users advise on what they use to aggregate events for billing purposes? Thanks, James