Re: spring-ws does not marshal response message without @XmlRootElement
Never mind. An explicit step at the end of the route fixed the issue for the JAXBElement in the message body. -- View this message in context: http://camel.465427.n5.nabble.com/spring-ws-does-not-marshal-response-message-without-XmlRootElement-tp5759215p5759234.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Servlet Component with REST DSL: problem in URI query string construction?
It’s a bug of Camel[1] which has been fixed few weeks ago. [1]https://issues.apache.org/jira/browse/CAMEL-7971 -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On November 18, 2014 at 11:32:30 AM, rvanluinen (rvanlui...@gmail.com) wrote: > I have been experimenting with Camel 2.14.0 and the REST DSL using the > servlet component. > I have followed the code in the example, however for reasons of my own I'd > like to use a different servlet name than the default of CamelServlet. This > works fine with vanilla servlet:/// URIs - add ?servletName=my-servlet and > all is good. > > To do this with the REST DSL I use the following: > > restConfiguration().component("servlet").endpointProperty("servletName", > "my-servlet"); > rest("/rest").post().otherDSLStatements; > > Contrary to what I thought, endpointProperty and not componentProperty sees > this property added to the URI. > > The problem is, it doesn't work. > I stepped through the code and it appears the problem is that the URI that > gets constructed for my post prior to being turned into a rest:// URI looks > something like: > servlet:///rest?httpMethodRestrict=POST?servletName=my-servlet. > > Which doesn't get correctly parsed by URISupport.parseQuery() since it > doesn't separate the second key/value pair using an ampersand ('&') as you > might expect. > > The code from ServletComponent looks like this (lines 194-197): > > String url = "servlet:///%s?httpMethodRestrict=%s"; > if (!query.isEmpty()) { > url = url + "?" + query; > } > > I can also confirm that using the debugger and changing the second '?' to > '&' results in the behaviour that I'd expect to see, which is that > my-servlet actually handles the request. > > I don't think I'm doing anything screwy here, can anyone else confirm > they've had similar problems or not? I think it's a bug but following > etiquette I'm posting here first and not raising issues in Jira immediately. > > Regards, > Rod > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Servlet-Component-with-REST-DSL-problem-in-URI-query-string-construction-tp5759228.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >
Re: Caused by: java.net.MalformedURLException: no protocol: ${systemurl}
You can use message header to override the address setting of CXF just like this from(routerEndpointURI).to("log:org.apache.camel?level=DEBUG") .setHeader(Exchange.DESTINATION_OVERRIDE_URL, constant(getServiceAddress())) .to(serviceEndpointURI); -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On November 18, 2014 at 2:36:49 PM, bharadwaj (bharadwaj2...@gmail.com) wrote: > When we use recipient List , could not handle exception bypassing to global > exception camel 2.10, > I know this has been fixed in camel 2.12. we cant migrate it now because > it's already in production. > Could you please give me any other alternative use it in camel:to? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Caused-by-java-net-MalformedURLException-no-protocol-systemurl-tp5759188p5759230.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >
Re: Caused by: java.net.MalformedURLException: no protocol: ${systemurl}
When we use recipient List , could not handle exception bypassing to global exception camel 2.10, I know this has been fixed in camel 2.12. we cant migrate it now because it's already in production. Could you please give me any other alternative use it in camel:to? -- View this message in context: http://camel.465427.n5.nabble.com/Caused-by-java-net-MalformedURLException-no-protocol-systemurl-tp5759188p5759230.html Sent from the Camel - Users mailing list archive at Nabble.com.
Camel hdfs2 consumer stop route when route is idle
I want to stop route when all files consumed by hdfs2 consumer or you can say when it become idle. Like we have simple route from("hdfs2"in") .to("file:out") As we know hdfs2 is not a Batch Consumer and Pooling Consumer, so we cannot use CamelBatchSize and sendEmptyMessageWhenIdle here. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-hdfs2-consumer-stop-route-when-route-is-idle-tp5759229.html Sent from the Camel - Users mailing list archive at Nabble.com.
Servlet Component with REST DSL: problem in URI query string construction?
I have been experimenting with Camel 2.14.0 and the REST DSL using the servlet component. I have followed the code in the example, however for reasons of my own I'd like to use a different servlet name than the default of CamelServlet. This works fine with vanilla servlet:/// URIs - add ?servletName=my-servlet and all is good. To do this with the REST DSL I use the following: restConfiguration().component("servlet").endpointProperty("servletName", "my-servlet"); rest("/rest").post().otherDSLStatements; Contrary to what I thought, endpointProperty and not componentProperty sees this property added to the URI. The problem is, it doesn't work. I stepped through the code and it appears the problem is that the URI that gets constructed for my post prior to being turned into a rest:// URI looks something like: servlet:///rest?httpMethodRestrict=POST?servletName=my-servlet. Which doesn't get correctly parsed by URISupport.parseQuery() since it doesn't separate the second key/value pair using an ampersand ('&') as you might expect. The code from ServletComponent looks like this (lines 194-197): String url = "servlet:///%s?httpMethodRestrict=%s"; if (!query.isEmpty()) { url = url + "?" + query; } I can also confirm that using the debugger and changing the second '?' to '&' results in the behaviour that I'd expect to see, which is that my-servlet actually handles the request. I don't think I'm doing anything screwy here, can anyone else confirm they've had similar problems or not? I think it's a bug but following etiquette I'm posting here first and not raising issues in Jira immediately. Regards, Rod -- View this message in context: http://camel.465427.n5.nabble.com/Servlet-Component-with-REST-DSL-problem-in-URI-query-string-construction-tp5759228.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Tail like File component?
You can try the stream component: http://camel.apache.org/stream.html 2014-11-17 21:32 GMT+01:00 Gonzalo Vasquez : > Hi everybody. > > Is it possible to use the File component (or other component) as a > consumer to mimic unix 'tai'l command? What I mean is: monitor a folder / > file and do something on each new line added to such fileI guess the > streaming option would help, but not sure on how to keep the File always > open and not to end on the last available line, also I'm wondering on how > to signal a file end or something like that. > > Regards, > Gonzalo Vásquez Sáez > Gerente Investigación y Desarrollo (R&D) > Altiuz Soluciones Tecnológicas de Negocios Ltda. > Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 > +56 2 335 2461 > gvasq...@altiuz.cl > http://www.altiuz.cl > http://www.altiuzreports.com > > > > -- -- David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Tail like File component?
Hi everybody. Is it possible to use the File component (or other component) as a consumer to mimic unix 'tai'l command? What I mean is: monitor a folder / file and do something on each new line added to such fileI guess the streaming option would help, but not sure on how to keep the File always open and not to end on the last available line, also I'm wondering on how to signal a file end or something like that. Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (R&D) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 +56 2 335 2461 gvasq...@altiuz.cl http://www.altiuz.cl http://www.altiuzreports.com
Re: How to remove camel framework text in my soap fault ?
Good to know that your problem is solved. On Mon, Nov 17, 2014 at 2:34 PM, Frankiboy wrote: > Thanks a lot the handled(true) , and don´t throw my own soapfault, makes it > ... > >exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); > exchange.getOut().setFault(true); > SoapFault sf = new SoapFault(message + " Unique log number: " + > errorUuid, SoapFault.FAULT_CODE_SERVER); > exchange.getOut().setBody(sf); > > > > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-remove-camel-framework-text-in-my-soap-fault-tp5759195p5759209.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
spring-ws does not marshal response message without @XmlRootElement
Dear all, I am trying to get a spring-ws route (Camel 2.14.0) to populate the SOAP body of the response without annotating the response class with @XmlRootElement. I was hoping that by placing an instance of JAXBElement as the message body this could be done, but no luck. Unless the @XmlRootElement annotation is present the type conversion in org.apache.camel.component.spring.ws.SpringWebserviceConsumer::invoke(MessageContext) fails and returns null. Line 66 ff: Message responseMessage = exchange.getOut(Message.class); .. // responseBody is null unless @XmlRootElement is present; // Source is javax.xml.transform.Source. Source responseBody = responseMessage.getBody(Source.class); I am looking for a way to return "raw values" and generic list types where I do not even have a class that I could annotate with @XmlRootElement. A sample ObjectFactory method generated by xjc looks like this: @XmlElementDecl(namespace = "http://some.org/my/namespace";, name = "addDelegationResponse") public JAXBElement createAddDelegationResponse(Integer value) { return new JAXBElement(_AddDelegationResponse_QNAME, Integer.class, null, value); } My route looks like this: http://some.org/my/namespace/addDelegation?endpointMapping=#endpointMapping"; /> Is there another way to do this with spring-ws? Changing the WSDL is not really an option for me at this point. Thanks! Ralf -- View this message in context: http://camel.465427.n5.nabble.com/spring-ws-does-not-marshal-response-message-without-XmlRootElement-tp5759215.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: .toUpperCase() doesn't work in the simple expression below.
I use toUpperCase within a simple expression: ${in.header.flutype.toString().toUpperCase().charAt(0)} Try calling toString before toUpperCase. Regards, Scott -- View this message in context: http://camel.465427.n5.nabble.com/toUpperCase-doesn-t-work-in-the-simple-expression-below-tp5759065p5759212.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to remove camel framework text in my soap fault ?
Thanks a lot the handled(true) , and don´t throw my own soapfault, makes it ... exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); exchange.getOut().setFault(true); SoapFault sf = new SoapFault(message + " Unique log number: " + errorUuid, SoapFault.FAULT_CODE_SERVER); exchange.getOut().setBody(sf); -- View this message in context: http://camel.465427.n5.nabble.com/How-to-remove-camel-framework-text-in-my-soap-fault-tp5759195p5759209.html Sent from the Camel - Users mailing list archive at Nabble.com.
How to aggregate many marshalled (json) objects to one file
I created a route to buffer/store marshaled objects (json) into files. This route (and the other route to read the buffer) work fine. storing in buffer: from(DIRECT_IN).marshal().json().marshal().gzip().to(fileTarget()); reading from buffer: from(fileTarget()).unmarshal().gzip().unmarshal().json().to("mock:a") To reduce i/o i want to aggregate many exchanges in one file. I tried to just aggregate after json and before it so i added this after json() or from(...): .aggregate(constant(true)).completionSize(20).completionTimeout(1000).groupExchanges() In both cases i get conversion exceptions. How to do it correctly? I would prefer a way without custom aggregator. And it would be nice if just many exchanges/object are aggregated in one json (as list of objects). Thanks in advance. -- View this message in context: http://camel.465427.n5.nabble.com/How-to-aggregate-many-marshalled-json-objects-to-one-file-tp5759204.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Caused by: java.net.MalformedURLException: no protocol: ${systemurl}
Hi See this FAQ http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html On Mon, Nov 17, 2014 at 7:26 AM, bharadwaj wrote: > For example , i am reading the camel property as below "systemurl" > > /test/text() > > > > is it right to define? or is there any other way to read the camel property? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Caused-by-java-net-MalformedURLException-no-protocol-systemurl-tp5759188.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Re: MongoDB: Persistent tail tracking with concurrent tailable consumers
Hi, It's me again. I think I found the problem: It's in the method "initialize" in "MongoDbTailTrackingManager.java": If no tail tracking object exists in the database, a new one will be inserted (that's okay), but the query "dbCol.findOne()" fetches ANY tail tracking object from the database (and not the one we've just inserted). In my oppinition, this is a bug and should be corrected like this: For now, I work around this by putting every persistent tail tracker in it's own collection so I make sure that even a findOne() always gives me the right tracker. Best regards, Joerg -- View this message in context: http://camel.465427.n5.nabble.com/MongoDB-Persistent-tail-tracking-with-concurrent-tailable-consumers-tp5759131p5759202.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to remove camel framework text in my soap fault ?
Hi Frank, The SoapFault object should be passed to the Apache Camel Body object as defined into the camel-cxf documentation : http://camel.apache.org/cxf.html#CXF-HowtothrowaSOAPFaultfromCamel --> How to throw a SOAP Fault from Camel Example : from("direct:start").onException(SoapFault.class).maximumRedeliveries(0).handled(true) .process(new Processor() { public void process(Exchange exchange) throws Exception { SoapFault fault = exchange .getProperty(Exchange.EXCEPTION_CAUGHT, SoapFault.class); exchange.getOut().setFault(true); exchange.getOut().setBody(fault); } }).end().to(serviceURI); Regards, On Mon, Nov 17, 2014 at 8:59 AM, Frankiboy wrote: > I want to give this back in my soap fault: > Endpoint don't exist in property files Unique log number: > 1c291263-a2a1-4505-bcc3-efbc260b29a5 > > I get this: > Sequential processing failed for number 1. Exchange[Message: [Body is > null]]. Caused by: [org.apache.cxf.binding.soap.SoapFault - Endpoint > don't exist in property files Unique log number: > 1c291263-a2a1-4505-bcc3-efbc260b29a5 > > seems like camels framework gives me: > Sequential processing failed for number 1. Exchange[Message: [Body is > null]]. Caused by: [org.apache.cxf.binding.soap.SoapFault - > >I dont want this camel message, how to remove it ? > > >Here is my code: > >exchange.removeProperty(Exchange.EXCEPTION_CAUGHT); > exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); > exchange.getOut().setFault(true); > SoapFault sf = new SoapFault(message,SoapFault.FAULT_CODE_SERVER); > throw sf; > >Frank > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-remove-camel-framework-text-in-my-soap-fault-tp5759195.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
Re: Camel-Hive
Hi Srinivas, As there is no camel-hive component available for the moment, you should encapsulate your HiveQL queries in an Bean Component ( http://camel.apache.org/bean.html). Regards, On Mon, Nov 17, 2014 at 7:50 AM, smilevasu6 wrote: > Hi, > > I am trying for camel-hive connection to fetch data from Hive table. > > Please any one help for the same. > > I am not able to fetch the information. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-Hive-tp5759189.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
question about database querying design pattern
Hi all, I have a requirement where we would leverage redis as cache and Mongodb as our backend. So we would first do a query against redis cache, if no result can be found we would then query against Mongodb for data. Assuming redis and Mongodb components are working, what type of integration pattern can I use for this? And how would I implement it? Thanks, Gordon -- View this message in context: http://camel.465427.n5.nabble.com/question-about-database-querying-design-pattern-tp5759159.html Sent from the Camel - Users mailing list archive at Nabble.com.
Camel-Hive
Hi, I am trying for camel-hive connection to fetch data from Hive table. Please any one help for the same. I am not able to fetch the information. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Hive-tp5759189.html Sent from the Camel - Users mailing list archive at Nabble.com.
Caused by: java.net.MalformedURLException: no protocol: ${systemurl}
For example , i am reading the camel property as below "systemurl" /test/text() is it right to define? or is there any other way to read the camel property? -- View this message in context: http://camel.465427.n5.nabble.com/Caused-by-java-net-MalformedURLException-no-protocol-systemurl-tp5759188.html Sent from the Camel - Users mailing list archive at Nabble.com.
How to remove camel framework text in my soap fault ?
I want to give this back in my soap fault: Endpoint don't exist in property files Unique log number: 1c291263-a2a1-4505-bcc3-efbc260b29a5 I get this: Sequential processing failed for number 1. Exchange[Message: [Body is null]]. Caused by: [org.apache.cxf.binding.soap.SoapFault - Endpoint don't exist in property files Unique log number: 1c291263-a2a1-4505-bcc3-efbc260b29a5 seems like camels framework gives me: Sequential processing failed for number 1. Exchange[Message: [Body is null]]. Caused by: [org.apache.cxf.binding.soap.SoapFault - I dont want this camel message, how to remove it ? Here is my code: exchange.removeProperty(Exchange.EXCEPTION_CAUGHT); exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 500); exchange.getOut().setFault(true); SoapFault sf = new SoapFault(message,SoapFault.FAULT_CODE_SERVER); throw sf; Frank -- View this message in context: http://camel.465427.n5.nabble.com/How-to-remove-camel-framework-text-in-my-soap-fault-tp5759195.html Sent from the Camel - Users mailing list archive at Nabble.com.
How to remove soap header before sending the request to realweb service
Hi all, I have created a proxy service upon axis2's version service. In this proxy service i have implemented basic authentication using wss4jInInterceptor. Here is my camel-context.xml : http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:camel="http://camel.apache.org/schema/spring"; xmlns:cxf="http://camel.apache.org/schema/cxf"; xmlns:context="http://www.springframework.org/schema/context"; xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.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";> http://localhost:${proxy.port}/camel-example-cxf-proxy/webservices/versionAdapter"; endpointName="s:VersionHttpSoap11Endpoint" serviceName="s:Version" wsdlURL="etc/versionAdapter.wsdl" xmlns:s="http://axisversion.sample";> http://camel.apache.org/schema/spring";> http://localhost:${real.port}/axis2/services/Version?throwExceptionOnFailure=false"/> Now the proxy service's basic authentication is working good. *The only problem is from camel proxy, when the request which invokes the axis service has Header information on the request payload which my axis service is unable to understand * Here is the request that axis service is getting: POST /axis2/services/Version HTTP/1.1 accept-encoding: gzip,deflate SOAPAction: "urn:getVersion" Authorization: Basic b3BwOm9wcFBhc3N3b3Jk breadcrumbId: ID-localhost-1749-1416221247796-2-1 User-Agent: Apache-HttpClient/4.1.1 (java 1.5) Host: localhost:8080 Content-Length: 1078 Content-Type: text/xml;charset=UTF-8 http://axisversion.sample"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>2014-11-17T10:51:24Z2014-11-17T11:24:44Zopphttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText";>oppPasswordhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary";>jIgJSain2vn2QbwORyShTA==2014-11-17T10:51:24.851Z *So my question is how can i remove the soap header through camel-config.xml before invoking the axis2 version service.* Looking forward to your answers. Thanks in advance -- View this message in context: http://camel.465427.n5.nabble.com/How-to-remove-soap-header-before-sending-the-request-to-realweb-service-tp5759196.html Sent from the Camel - Users mailing list archive at Nabble.com.
Consuming AMQ messages concurrently
Hi , I have a case where thousands of message queued at specific time in AMQ queue have to be executed within limited time box , only the last message tagged with special header (isLast=true) my camel route consumes those messages sequentially and if isLast=true flagged a special processors executed . everything run as expected since I'm consuming the messages using single consumer (sequential). to utilize execution environment and achieve time box constrain, I increase concurrent consumer to 10(concurrentConsumers=10) . it's boost the exaction time , my problem with concurrent executing camel threads of last 10 messages as I assume , is there a way to guarantee that the last message ( tagged one ) will be executed only when there is no inflight messages still running in background back ground . Please advise - Othman Darwish ProgressSoft Corp. -- View this message in context: http://camel.465427.n5.nabble.com/Consuming-AMQ-messages-concurrently-tp5759197.html Sent from the Camel - Users mailing list archive at Nabble.com.