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
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.
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).
split an InputStream?
hello, is it possible to use a splitter on an InputStream? I receive a big XML-file via an HttpResponse.getEntity().getContent() and I have used SAX to parse that stream and split it into smaller units. It works fairly well, but since Camel has a split() which is designed to solve exactly that problem, I was looking into using that instead. I can not load the complete XML into memory beforehand, as the memory footprint would be huge. any thoughts? /pj -- View this message in context: http://camel.465427.n5.nabble.com/split-an-InputStream-tp5732219.html Sent from the Camel - Users mailing list archive at Nabble.com.
RE: How to create a generic SOAP consumer?
Hi, I have no problem with cxf and SOAP in general. But the consumer I need has to be generic. It should be able to consume all incoming SOAP messages however they look like. Therefore I either need a generic wsdl (if this is possible) or I need a way to realise this without a wsdl. I would appreciate if anyone could provide me a Java DSL snippet how to create a generic SOAP consumer (with cxf and headers support). Regards. -- View this message in context: http://camel.465427.n5.nabble.com/How-to-create-a-generic-SOAP-consumer-tp5731741p5732223.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to set DataField locale for Double records in camel bindy
Hi, I have defined these fields as a String so I am using the DecimalFormat class to set the right locale. This is not the best solution but temporarily i can work with it. Regards. -- View this message in context: http://camel.465427.n5.nabble.com/How-to-set-DataField-locale-for-Double-records-in-camel-bindy-tp5732150p5732225.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: sftp not throwing exception
I upgrade my camel to 2.10.4 and enable the consumer.bridgeErrorHandler=true also made throwExceptionOnConnectFailed=true. Now I can see camel error handler trigger in from tag too. But what I see the retry option not worked in this case. *Is it intentional ?* redeliveryPolicy maximumRedeliveries=3 redeliveryDelay=6 retryAttemptedLogLevel=INFO / -- View this message in context: http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470p5732218.html Sent from the Camel - Users mailing list archive at Nabble.com.
Issue in redeliveryPolicy for SFTP component
I have used redeliveryPolicy mechanism, in case of error while coping files to SFTP location. for that I have added below line in onException redeliveryPolicy maximumRedeliveries=3 redeliveryDelay=1 retryAttemptedLogLevel=INFO / So ideally redelivery should happen 3 times with delay 10 sec. *But what I observed here it tries 3 times but took more than 10 sec why so ? is it limitation or bug ?* -- View this message in context: http://camel.465427.n5.nabble.com/Issue-in-redeliveryPolicy-for-SFTP-component-tp5732220.html Sent from the Camel - Users mailing list archive at Nabble.com.
camel producer ftp bug
Hello, I'm using camel-2.11.0 with camel ftp for a route and I'm hitting the Change directory bug, but only when I'm writing to FTP. I'm using vsftpd_3.0.2-3_amd64.deb on Debian Wheezy. The route is: from(ftp://localhost/in?username=source-of-filespassword=passstepwise=falsebinary=trueidempotent=true;) .to(ftp://localhost/out?username=target-of-filespassword=pass;); I've enabled logging on the FTP server and it seems it has a strange behavior: it does an extra Change Working Directory. I tried with using stepwise but with no success. Using stepwise=false; Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, TYPE A Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 200 Switching to ASCII mode. Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, PWD Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 257 /home/target-of-files Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, CWD out Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 250 Directory successfully changed. Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, CWD /home/target-of-files Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 550 Failed to change directory. Thu May 9 14:21:02 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, QUIT Using stepwise=true; Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 230 Login successful. Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, TYPE A Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 200 Switching to ASCII mode. Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, PWD Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 257 /home/target-of-files Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, CWD out Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 250 Directory successfully changed. Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, CWD Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP response: Client 127.0.0.1, 550 Failed to change directory. Thu May 9 14:21:18 2013 [pid 3] [target-of-files] FTP command: Client 127.0.0.1, QUIT I also attached the log file, I hope it doesn't get filtered out. Can anybody confirm this and suggest a solution? Thanks, -- Ioan Eugen Stan 0720 898 747
CXFRS producer deployed in Fuse ESB
Hello everybody, I'm using Apache Fuse ESB 5.4.0-fuse-00-00 with Apache Camel 2.4.0-fuse-00-00. I need to expose a REST service that can be called by a consumer located on another machine. I read about Camel CXFRS but I'm not sure if it is what I need. After reading here http://camel.apache.org/cxfrs.html and here http://blog.nanthrax.net/2011/08/use-camel-cxf-and-karaf-to-implement-batches/ I could use an opinion on the following: can I create a REST web service, deploy it as a JBI service assembly and call it? Please give me some links where I can get more detailed explanations. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-deployed-in-Fuse-ESB-tp5732227.html Sent from the Camel - Users mailing list archive at Nabble.com.
Issue with Camel-aws (SQS) and aws-java-sdk-1.4.3
Hi there, I'm getting an odd error trying to use Amazon SQS with Camel: java.lang.NoSuchFieldError: timeOffset at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:857) at com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:617) at com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:785) at org.apache.camel.component.aws.sqs.SqsEndpoint.doStart(SqsEndpoint.java:82) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60) at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1763) at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:931) at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:892) at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:475) I'm using the latest aws-java-sdk-1.4.3 and have tried both camel-aws-2.10.4 and camel-aws-2.11.1-SNAPSHOT Any help appreciated! Here is my test code: public class SQSIntegrationTest extends CamelTestSupport { protected MockEndpoint resultEndpoint; private CamelContext camelContext; @Before public void setUp() throws Exception { super.setUp(); resultEndpoint = (MockEndpoint) context.getEndpoint(mock:result); } @After public void tearDown() throws Exception { if (camelContext != null) camelContext.stop(); super.tearDown(); } @Override protected CamelContext createCamelContext() throws Exception { super.createCamelContext(); camelContext = super.createCamelContext(); return camelContext; } @Override protected RouteBuilder createRouteBuilder() throws Exception { final String sqsUri = String.format(aws-sqs://integ-test-1?amazonSQSEndpoint=%saccessKey=%ssecretKey=%s, http://sqs.eu-west-1.amazonaws.com/;, somethingValid, somethingValid); return new RouteBuilder() { @Override public void configure() throws Exception { from(direct:start) .to(sqsUri); from(sqsUri).to(mock:result); } }; } @Test public void sendAndReceiveMessageFromQueue() throws Exception { String expectedBody = Message; resultEndpoint.expectedBodiesReceived(expectedBody); template.sendBody(direct:start, expectedBody); Thread.sleep(1000); resultEndpoint.assertIsSatisfied(); } } -- View this message in context: http://camel.465427.n5.nabble.com/Issue-with-Camel-aws-SQS-and-aws-java-sdk-1-4-3-tp5732228.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue with using onException()
Here is more research done on my route. I am presenting you with different ways Camel is behaving based on the end() or endChoice() statements placement. I am adding my questions here. Can the Camel experts help me to understand how camel works under the covers? This is getting really frustrating. Any help would be appreciated. CASE 1 : .split(body()).stopOnException() .log(Inside SPlit. Record under Processs : ${body}) .choice() .when(transactionRecord) .choice() .when(UNDERNOTICE_OR_RESCISSION) .log(Record of interested type) .bean(PolicyStatusRequestHelper.class,getPolicyStatusRequest) .log(Marshalling to JSON) .marshal().json() .log(Sending to JMS Queue) .inOut(getJmsEndPoint()) .log(JMS Reply - Transaction Status : ${body} ) //.endChoice() //Actually ends when(UNDERNOTICE_OR_RESCISSION) .endChoice() //Actually ends when(transactionRecord) .end() //Ends split() .log(Done with record : ${body}) .end() // May be ends PollEnrich .log(Completed Processing of File. Sending to Success Route) .to(getDirectSuccess()); Result : Success Status returned : 0 Times Success Route called : Once Input file moved : No Lock File Deleted : No Questions: Does one endChoice() end 2 choice()/When definitions in case of nested choice() CASE 2: .split(body()).stopOnException() .log(Inside SPlit. Record under Processs : ${body}) .choice() .when(transactionRecord) .choice() .when(UNDERNOTICE_OR_RESCISSION) .log(Record of interested type) .bean(PolicyStatusRequestHelper.class,getPolicyStatusRequest) .log(Marshalling to JSON) .marshal().json() .log(Sending to JMS Queue) .inOut(getJmsEndPoint()) .log(JMS Reply - Transaction Status : ${body} ) //.endChoice() //Actually ends when(UNDERNOTICE_OR_RESCISSION) .endChoice() //Actually ends when(transactionRecord) .end() //Ends split() .log(Done with record : ${body}) //.end() // May be ends PollEnrich .log(Completed Processing of File. Sending to Success Route) .to(getDirectSuccess()); Result : Success Status returned : FILE ARRAY LIST Times Success Route called : More than Once Input file moved : No Lock File Deleted : YES Questions: What does the second end() close in this case? The whole route runs to the end after SPLIT() in this case. Where does scope of split actually end? CASE 3 : .split(body()).stopOnException() .log(Inside SPlit. Record under Processs : ${body}) .choice() .when(transactionRecord) .choice() .when(UNDERNOTICE_OR_RESCISSION) .log(Record of interested type)
Re: Issue with using onException()
FILE ARRAY LIST refers to the array list of all records in the file. Success Route refers to a separate direct route that just returns a 0 to the caller. The whole cases are sub parts of the main route presented in post 1. Log statements are changed for simplicity. Please let me know if you need any more clarifications on what we are trying to do. Thanks ! -- View this message in context: http://camel.465427.n5.nabble.com/Issue-with-using-onException-tp5732200p5732230.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using camel-servlet with Multipart - unable to fetch the file
I'm using the OSGI service for camel servlet and I do not want to use camel-jetty as it takes its own port instead of existing jetty server port. What strange is I can see the contents of the multipart data from request if I parse them manually, But I am unable to separate the form fields and file data. Could you give some suggestions for this scenario? Thanks! -- View this message in context: http://camel.465427.n5.nabble.com/Using-camel-servlet-with-Multipart-unable-to-fetch-the-file-tp5732204p5732232.html Sent from the Camel - Users mailing list archive at Nabble.com.
GenericFileConsumer - Idempotent and InProgress repositories
The implementations of the GenericFileConsumer (FileConsumer, SftpConsumer,...) method, pollDirectory(), make calls to isValidFile() and if that returns true, calls isInProgress(). This process fails when there are multiple processes polling. For example when process P0 calls isValidFile() and the idempotent repository does not have the file entry, it then calls isInProgress(). But, if process P1, who is in progress for the file, commits to the idempotent repository and subsequently releases its entry in the in progress repository, then P0 may obtain an in progress status and process a file that is now in the idempotent repository. Should the isInProgress() call be made before the isValidFile() call? This may have additional overhead of checking the in progress repository, but the chance for duplicate processing would be removed. -- View this message in context: http://camel.465427.n5.nabble.com/GenericFileConsumer-Idempotent-and-InProgress-repositories-tp5732237.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: using or operator in twitter keywords search
Twitter has its own operators. Just use them in your keywords parameter: https://support.twitter.com/articles/71577-using-advanced-search The documentation might be misleading you to believe that you can only use comma-separated keywords. Actually, the keyword parameter value is passed directly to the Query object of Twitter4J: public ListTweet pollConsume() throws TwitterException { String keywords = te.getProperties().getKeywords(); Query query = new Query(keywords); if (te.getProperties().isFilterOld()) { query.setSinceId(lastId); } LOG.debug(Searching twitter with keywords: {}, keywords); return search(query); } Let me know if it helps. *Bruno Borges* (11) 99564-9058 *www.brunoborges.com* On Thu, May 2, 2013 at 3:59 AM, Preben.Asmussen p...@dr.dk wrote: Created https://issues.apache.org/jira/browse/CAMEL-6332 so we don't forget. -- View this message in context: http://camel.465427.n5.nabble.com/using-or-operator-in-twitter-keywords-search-tp5731873p5731887.html Sent from the Camel - Users mailing list archive at Nabble.com.
Appending/Not Appending paths
Hi, If I send a request to myservices/path1/path2, how do I control whether or not the path1/path2 is appended? Thanks, Al. F -- View this message in context: http://camel.465427.n5.nabble.com/Appending-Not-Appending-paths-tp5732231.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Appending/Not Appending paths
Hi, If you don't want the path1/path2 to be added, you can set the bridgeEndpoint option to be false, otherwise you should et the option to be true. Willem -- View this message in context: http://camel.465427.n5.nabble.com/Appending-Not-Appending-paths-tp5732231p5732241.html Sent from the Camel - Users mailing list archive at Nabble.com.
RE: Issues with camel context
Please see my response inline -Original Message- From: Christian Müller [mailto:christian.muel...@gmail.com] Sent: Thursday, May 09, 2013 3:52 AM To: users@camel.apache.org Subject: Re: Issues with camel context Which version do you use?[Vashisth, Sunil] 2.10.2 Which component do you use?[Vashisth, Sunil]spring-ws Which OS/runtime do you use?[Vashisth, Sunil] Windows 7, JRE 1.6 How looks your route?[Vashisth, Sunil] Route has some pre and processing around spring-ws component [Vashisth, Sunil] to uri=spring-ws:{{769: MESSAGE_URL}}?webServiceTemplate=#baseCamelMarshallerWSTemplate / bean id=httpParams class=org.apache.commons.httpclient.params.HttpClientParams !-- Timeout in milliseconds: in this case 4 minutes -- property name=soTimeout value=24 / /bean bean id=httpClient class=org.apache.commons.httpclient.HttpClient property name=params ref=httpParams / /bean bean id=httpSender class=org.springframework.ws.transport.http.HttpComponentsMessageSender /bean bean id=baseCamelMarshallerWSTemplate class=org.springframework.ws.client.core.WebServiceTemplate scope=prototype constructor-arg ref=messageFactory / property name=messageSender ref bean=httpSender/ /property property name=checkConnectionForError value=true/ property name=transformerFactoryClass value=org.apache.xalan.processor.TransformerFactoryImpl/ /bean bean id=messageFactory class=org.springframework.ws.soap.saaj.SaajSoapMessageFactory property name=soapVersion util:constant static-field=org.springframework.ws.soap.SoapVersion.SOAP_12/ /property property name=messageFactory ref=soapMessageFactoryImpl/ /bean Sent from a mobile device Am 08.05.2013 05:57 schrieb Goel1, Vipin vipin.go...@xerox.com: Hi, Sometime we get the following errors in logs while calling one web service sometimes we get the error on console. This is an intermittent issue and only work around as of now working to restart the camel context or server. We need this issue to be resolved at priority. Please help. .transform.stax.StAXSource; nested exception is javax.xml.transform.TransformerException: Can't transform a Source of type javax.xml.transform.stax.StAXSource ERROR DefaultErrorHandler - Failed delivery for (MessageId: ID-NODHCMSLTP1427-61837-1361879946102-0-158 on ExchangeId: ID-NODHCMSLTP1427-61837-1361879946102-0-1 57). Exhausted after delivery attempt: 1 caught: org.springframework.ws.client.WebServiceTransformerException: Transformation error: Can't transform a Source of type javax.xml.transform.stax.StAXSource; nested exception is javax.xml.transform.TransformerException: Can't transform a Source of type javax.xml.transform.st ax.StAXSource org.springframework.ws.client.WebServiceTransformerException: Transformation error: Can't transform a Source of type javax.xml.transform.stax.StAXSource; nested exception is javax.xml.transform.TransformerException: Can't transform a Source of type javax.xml.transform.stax.StAXSource at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive (WebServiceTemplate.java:608) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(W ebServiceTemplate.java:537) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive (WebServiceTemplate.java:492) for contact Us webservice