Re: Error while deploying camel proxy in tomcat
?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: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; context:property-placeholder location=classpath:incident.properties,file:target/custom.properties ignore-resource-not-found=true/ cxf:cxfEndpoint id=versionService address=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/ camelContext xmlns=http://camel.apache.org/schema/spring; propertyPlaceholder id=properties location=classpath:incident.properties,file:target/custom.properties/ endpoint id=callRealWebService uri=http://localhost:${real.port}/axis2/services/Version?throwExceptionOnFailure=false/ route from uri=cxf:bean:versionService?dataFormat=MESSAGE/ to uri=log:input/ removeHeaders pattern=CamelHttp* / to ref=callRealWebService/ to uri=log:output/ /route /camelContext /beans Above is my camel-config.xml. Now my question is how can i shutdown camel context from here -- View this message in context: http://camel.465427.n5.nabble.com/Error-while-deploying-camel-proxy-in-tomcat-tp5758987p5759029.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel JMS consumer route start / stop issues
Guys, any thoughts on this -- View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-consumer-route-start-stop-issues-tp5758893p5759030.html Sent from the Camel - Users mailing list archive at Nabble.com.
When clause not working with header element with namespace
Hi! I'm following the Message Router pattern explained in https://camel.apache.org/message-router.html However, I'm having problems with conditions on headers with namespaces. The XML message I'm receiving is like this: SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; SOAP-ENV:Header DF xmlns=http://mycompany/smth;myElement/DF /SOAP-ENV:Header SOAP-ENV:Body ns2:processIncomingMessage xmlns:ns2=http://ws.eta.ea.efca.europa.eu/; arg0something/arg0 /ns2:processIncomingMessage /SOAP-ENV:Body/SOAP-ENV:Envelope And this is my route: from(switchyard://CamelInterfaceService) .log(Header: ${headers}) .log(Received message for 'CamelInterfaceService' : ${body}) .choice() .when(header(DF).isEqualTo(myElement)) .to(switchyard://OtherService) .log(SENT.) .end(); However, OtherService is not called. If I change DF xmlns=http://mycompany/smth;myElement/DF to: DFmyElement/DF it works...but it is something I cannot really change...so, how can I modify my camel route to make it work? Thank you! -- View this message in context: http://camel.465427.n5.nabble.com/When-clause-not-working-with-header-element-with-namespace-tp5759046.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel JMS consumer route start / stop issues
Try only use suspend/resume or stop/start and not mix and match them On Thu, Nov 13, 2014 at 10:16 AM, sushil_vsk5 sushil_v...@yahoo.co.in wrote: Guys, any thoughts on this -- View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-consumer-route-start-stop-issues-tp5758893p5759030.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: Ack by the end of WS chain (client WS - [WS - Camel - client WS] - WS) *image inside
For reference: It looks like they call it: blinkspotlightmulticolorflashing* Camel CXF Proxy */multicolorflashing/spotlight/blink/spotlight You can use CXF to proxy a real web service. I found some related threads: http://camel.apache.org/cxf-proxy-example.html https://cwiki.apache.org/confluence/display/CAMEL/CXF+Proxy+Example https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Security_Guide/files/CamelCXF-ProxyDemo.html https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html-single/Security_Guide/#CamelCXF-ProxyDemo http://stackoverflow.com/questions/9644346/how-to-proxy-a-web-service-using-camel https://developer.jboss.org/thread/246290 -- View this message in context: http://camel.465427.n5.nabble.com/Ack-by-the-end-of-WS-chain-client-WS-WS-Camel-client-WS-WS-image-inside-tp5758561p5759062.html Sent from the Camel - Users mailing list archive at Nabble.com.
New to Camel, adding smtp completion notification using XML DSL
Hi I'm new to camel (so forgive me for asking dumb question). Having worked a few examples and successfully created some test routes - I'd like to email recipient(s) on completion. Ultimately the intent would be to email success / failure...but taking baby steps, just an email at the end of processing would be enough for me to expand my understanding. In my real code (not the pseudo below) I've successfully received an email *but* I cannot understand how to override the email body (currently it's the content of the message processed by direct:start - in my instance a zip file). I've experimented with transform (to transform the message/body before emailing) but that didn't appear to work. Any suggestions?! Kind regards -- View this message in context: http://camel.465427.n5.nabble.com/New-to-Camel-adding-smtp-completion-notification-using-XML-DSL-tp5759060.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel xmljson add @ signs to the json output. how to remove the @ signs
Hi Claus, I am using Camel version 2.14.0. As far as xmljson goes I have used the follwoing parameter tor turn that off without a luck xmljson id=xmljson removeNamespacePrefixes=true skipNamespaces=true trimSpaces=true/ Do you know how turn off the @ sign for xml attributes? Thanks, Ali - Alireza Salemi -- View this message in context: http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013p5759063.html Sent from the Camel - Users mailing list archive at Nabble.com.
.toUpperCase() doesn't work in the simple expression below.
simple'{{mainframe.filename}}.$simple{$simple{file:onlyname.noext}.toUpperCase()}.$simple{date:now:'D'yyMMdd}.$simple{date:now:'T'HHmmsss}'/simple I need to send a upper cased file name to mainframe and the expression above throws the following error. Is there a work around for this issue ? org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Unknown function: mediacashpaid.toUpperCase() at location 26 'DDSTEST.SAP.ZBTO.SAPFILE.$simple{$simple{file:onlyname.noext}.toUpperCase()}.$simple{date:now:'D'yyMMdd}.$simple{date:now:'T'HHmmsss}' -- View this message in context: http://camel.465427.n5.nabble.com/toUpperCase-doesn-t-work-in-the-simple-expression-below-tp5759065.html Sent from the Camel - Users mailing list archive at Nabble.com.
XPATH woes
Hi All, I'm trying to filter via xpath using the spring config. I'm running camel 2.12.3. An example msg Envelope xmlns=http://removed xmlns:bem=http:/removed xmlns:price=http://removed; messageId=xx schemaVersion=1.0 instanceId=xx publishMessageDtm=2014-11-13T22:27:07+00:00 publishMessageDtInMs=2014-11-13T22:27:07.835+00:00 publishingSystemCd=xx This below filter always evaluates to false. Any ideas? filter xpath/Envelope/@schemaVersion='1.0'/xpath camel:log message=${body}/ /filter Thanks Geoffrey A Gershaw CREDIT SUISSE Information Technology | Credit eTrading Development, KFVB 525 7033 Louis Stephens Drive | 27560 Research Triangle Park | United States Phone +1 919 994 6412 geoffrey.gers...@credit-suisse.commailto:geoffrey.gers...@credit-suisse.com | www.credit-suisse.comhttp://www.credit-suisse.com/ === Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===
Re: Camel JPA - Parameterized Queries?
Hi, Can u plz tell me how to use consumer.parameters to send parameters to a named query in a jpa component. Thanks, Anwesh
Re: XPATH woes
Your Envelope element is declared in a default namespace. Your XPath expression must use the namespace when referring to the element. Cheers. On 13 Nov 2014 22:32, Gershaw, Geoffrey A. geoffrey.gers...@credit-suisse.com wrote: Hi All, I'm trying to filter via xpath using the spring config. I'm running camel 2.12.3. An example msg Envelope xmlns=http://removed xmlns:bem=http:/removed xmlns:price= http://removed; messageId=xx schemaVersion=1.0 instanceId=xx publishMessageDtm=2014-11-13T22:27:07+00:00 publishMessageDtInMs=2014-11-13T22:27:07.835+00:00 publishingSystemCd=xx This below filter always evaluates to false. Any ideas? filter xpath/Envelope/@schemaVersion='1.0'/xpath camel:log message=${body}/ /filter Thanks Geoffrey A Gershaw CREDIT SUISSE Information Technology | Credit eTrading Development, KFVB 525 7033 Louis Stephens Drive | 27560 Research Triangle Park | United States Phone +1 919 994 6412 geoffrey.gers...@credit-suisse.commailto: geoffrey.gers...@credit-suisse.com | www.credit-suisse.com http://www.credit-suisse.com/ === Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===
Re: Multipart form data and servlet/restlet endpoint
I’m not sure what kind of web container that you use. Here is a link[1] about how to do it with tomcat 7. [1]http://stackoverflow.com/questions/8047173/how-to-enable-multipart-form-data-in-tomcat-7-0-8-server -- 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 13, 2014 at 12:06:06 PM, navaltiger (vijay.ra...@gmail.com) wrote: Any pointer towards how to apply such filter? On Thu, Nov 13, 2014 at 9:30 AM, Willem.Jiang [via Camel] ml-node+s465427n5759023...@n5.nabble.com wrote: We apply the multipart handler to jetty endpoint by default. If you use camel-servlet, it’s your job to setup that kind of filter in the web.xml to parser the Multipart form data for you. -- 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 12, 2014 at 6:35:59 PM, navaltiger ([hidden email] ) wrote: Hi, With Jetty based consumer it worked but no luck with servlet. I am executing this package as jetty:run public void configure() throws Exception { // getContext().getProperties().put(CamelJettyTempDir, target); // Jetty://http works file // from(jetty://http://0.0.0.0:9090/test;).process(new Processor() { .// servlet:// does not work from(servlet:///test).process(new Processor() { public void process(Exchange exchange) throws Exception { Message in = exchange.getIn(); StringBuffer v = new StringBuffer(); v.append(\n + in.getAttachmentNames().size() + \n); Set names = in.getAttachmentNames(); for (String n : names) { DataHandler h = in.getAttachment(n); v.append(\n + h + \n); if (h != null) { try { int read = 0; byte[] bytes = new byte[1024]; // Object o = h.getContent(); InputStream inputStream = h.getInputStream(); FileOutputStream fout = new FileOutputStream( new File( /Users/navaltiger/workspace/vr.bin)); while ((read = inputStream.read(bytes)) != -1) { fout.write(bytes, 0, read); } v.append(\n done \n); } catch (Exception e) { e.printStackTrace(); } } } exchange.getOut().setBody(v); } }); } -- View this message in context: http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5758976.html Sent from the Camel - Users mailing list archive at Nabble.com. -- If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759023.html To unsubscribe from Multipart form data and servlet/restlet endpoint, click here . NAML -- *Vijay Rathi | T: +91 93734 33545 | vijay.ra...@gmail.com | *http://gadgetnfun.blogspot.com/ -- View this message in context: http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759024.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Error while deploying camel proxy in tomcat
I guest you are using Spring Web Application context listener to watch the change of camel-config.xml. I think you need to make sure the Spring Application close rightly before redeploy the war again. -- 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 13, 2014 at 4:22:29 PM, Royamit (amitroy...@gmail.com) wrote: 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; location=classpath:incident.properties,file:target/custom.properties ignore-resource-not-found=true/ address=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/ location=classpath:incident.properties,file:target/custom.properties/ uri=http://localhost:${real.port}/axis2/services/Version?throwExceptionOnFailure=false/ Above is my camel-config.xml. Now my question is how can i shutdown camel context from here -- View this message in context: http://camel.465427.n5.nabble.com/Error-while-deploying-camel-proxy-in-tomcat-tp5758987p5759029.html Sent from the Camel - Users mailing list archive at Nabble.com.
Camel SQL component - Insert Operation
Hi I am trying to insert a record into the camel database. I have no errors when I hard code the value like *to uri=sql:INSERT INTO testtable VALUES ('Samson') /* I was wondering why I get following error when I have following camel Spring DSL line *setHeader headerName=data constantSamson/constant /setHeader to uri=sql:INSERT INTO testtable VALUES (#:data) /* * org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is java.sql.SQLException: No value specified for parameter 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at
Re: .toUpperCase() doesn't work in the simple expression below.
I think you can consider to set exchange property by using some other script which supports toUpperCase(). Then reference it in the simple expression. -- 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 14, 2014 at 3:04:04 AM, rajivgup...@gmail.com (rajivgup...@gmail.com) wrote: '{{mainframe.filename}}.$simple{$simple{file:onlyname.noext}.toUpperCase()}.$simple{date:now:'D'yyMMdd}.$simple{date:now:'T'HHmmsss}' I need to send a upper cased file name to mainframe and the expression above throws the following error. Is there a work around for this issue ? org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Unknown function: mediacashpaid.toUpperCase() at location 26 'DDSTEST.SAP.ZBTO.SAPFILE.$simple{$simple{file:onlyname.noext}.toUpperCase()}.$simple{date:now:'D'yyMMdd}.$simple{date:now:'T'HHmmsss}' -- View this message in context: http://camel.465427.n5.nabble.com/toUpperCase-doesn-t-work-in-the-simple-expression-below-tp5759065.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Multipart form data and servlet/restlet endpoint
Hi, Could do it following way. Will upload whole project at GitHub following way. -- web.xml -- web-app display-nameArchetype Created Web Application/display-name listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext.xml/param-value /context-param servlet servlet-nameCamelServlet/servlet-name servlet-classorg.apache.camel.component.servlet.CamelHttpTransportServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameCamelServlet/servlet-name url-pattern/*/url-pattern /servlet-mapping filter filter-nameMultipartFilter/filter-name filter-classorg.eclipse.jetty.servlets.MultiPartFilter/filter-class /filter filter-mapping filter-nameMultipartFilter/filter-name servlet-nameCamelServlet/servlet-name /filter-mapping /web-app -- View this message in context: http://camel.465427.n5.nabble.com/Multipart-form-data-and-servlet-restlet-endpoint-tp5758948p5759081.html Sent from the Camel - Users mailing list archive at Nabble.com.
redis project does not work for me
HI, We are trying to use Camel redis component when I found this following article: http://stackoverflow.com/questions/16428371/camel-redis-component-subscribe-to-a-channel-not-working I tried to run this project (https://github.com/soumyasd/camelredisdemo) and not able to see any results. I ran the .sh file and not able to see any thing on the console. (have redis server running in the background) How do I make it work? I have also added some other route and that did not work either.. from(spring-redis://127.0.0.1:6379?command=SUBSCRIBEchannels=mychannelserializer=#redisserializer) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { String res = exchange.getIn().getBody().toString(); System.out.println( + res); exchange.getOut().setBody(res); } }) .to(log:foo); from(direct:input) .setHeader (CamelRedis.Key,constant(testkey2)) .setHeader (CamelRedis.Value,constant(100)) .to(spring-redis://127.0.0.1:6379?command=SET); Has anyone tried it? Anyone who has gotten camel redis component to work? Can anyone share their code/project? Thanks, Gordon -- View this message in context: http://camel.465427.n5.nabble.com/redis-project-does-not-work-for-me-tp5759067.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel SQL component - Insert Operation
Hi You need Camel 2.11 or better to use named parameters as said here http://camel.apache.org/sql-component On Fri, Nov 14, 2014 at 3:49 AM, contactreji contactr...@gmail.com wrote: Hi I am trying to insert a record into the camel database. I have no errors when I hard code the value like *to uri=sql:INSERT INTO testtable VALUES ('Samson') /* I was wondering why I get following error when I have following camel Spring DSL line *setHeader headerName=data constantSamson/constant /setHeader to uri=sql:INSERT INTO testtable VALUES (#:data) /* * org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is java.sql.SQLException: No value specified for parameter 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at
Re: Camel SQL component - Insert Operation
According to the documentation the syntax should be :#data so it looks like you have switched places on the : and # On Fri, Nov 14, 2014 at 3:49 AM, contactreji contactr...@gmail.com wrote: Hi I am trying to insert a record into the camel database. I have no errors when I hard code the value like *to uri=sql:INSERT INTO testtable VALUES ('Samson') /* I was wondering why I get following error when I have following camel Spring DSL line *setHeader headerName=data constantSamson/constant /setHeader to uri=sql:INSERT INTO testtable VALUES (#:data) /* * org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO testtable VALUES (?:data)]; nested exception is java.sql.SQLException: No value specified for parameter 1 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:98)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615)[spring-jdbc-3.1.3.RELEASE.jar:3.1.3.RELEASE] at org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:48)[camel-sql-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024] at
Wiretap adds exchanges to MockEndpoint used in NotifyBuilder expression.
My understanding is that normally you can test a route by using the NotifyBuilder and a MockEndpoint and if you send one message into the route, you should be able to satisfy the mock.expectedMessageCount(1). However, it appears that the use of the wiretap component in a route adds extra exchanges - see attached java test and xml. TestWiretapNotifySpring.java http://camel.465427.n5.nabble.com/file/n5759085/TestWiretapNotifySpring.java WiretapNotifySpring.xml http://camel.465427.n5.nabble.com/file/n5759085/WiretapNotifySpring.xml WiretapNotifyTestResults.txt http://camel.465427.n5.nabble.com/file/n5759085/WiretapNotifyTestResults.txt Is this working as designed or a bug? Is there a way to filter the extra ones out? How would I test such a route that includes various wiretap elements? I'd also like to test attributes (like MyHeader) on just the expected route, not the extra exchanges. -- View this message in context: http://camel.465427.n5.nabble.com/Wiretap-adds-exchanges-to-MockEndpoint-used-in-NotifyBuilder-expression-tp5759085.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Wiretap adds exchanges to MockEndpoint used in NotifyBuilder expression.
WireTap creates a new exchange that is the purpose of it http://camel.apache.org/wire-tap On Fri, Nov 14, 2014 at 8:21 AM, wjmcdonald william.mcdon...@transcentra.com wrote: My understanding is that normally you can test a route by using the NotifyBuilder and a MockEndpoint and if you send one message into the route, you should be able to satisfy the mock.expectedMessageCount(1). However, it appears that the use of the wiretap component in a route adds extra exchanges - see attached java test and xml. TestWiretapNotifySpring.java http://camel.465427.n5.nabble.com/file/n5759085/TestWiretapNotifySpring.java WiretapNotifySpring.xml http://camel.465427.n5.nabble.com/file/n5759085/WiretapNotifySpring.xml WiretapNotifyTestResults.txt http://camel.465427.n5.nabble.com/file/n5759085/WiretapNotifyTestResults.txt Is this working as designed or a bug? Is there a way to filter the extra ones out? How would I test such a route that includes various wiretap elements? I'd also like to test attributes (like MyHeader) on just the expected route, not the extra exchanges. -- View this message in context: http://camel.465427.n5.nabble.com/Wiretap-adds-exchanges-to-MockEndpoint-used-in-NotifyBuilder-expression-tp5759085.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: camel xmljson add @ signs to the json output. how to remove the @ signs
Hi No sorry I dont know how to remove those. You are welcome to dive into the source code and see if there is something we can add. Sounds like we should add some option to remove the @. I wonder if they are there so the component can reverse from json, and then know that if its a @foo then that is an attribute. And thus why they are included. On Thu, Nov 13, 2014 at 5:46 PM, salemi sal...@avaya.com wrote: Hi Claus, I am using Camel version 2.14.0. As far as xmljson goes I have used the follwoing parameter tor turn that off without a luck xmljson id=xmljson removeNamespacePrefixes=true skipNamespaces=true trimSpaces=true/ Do you know how turn off the @ sign for xml attributes? Thanks, Ali - Alireza Salemi -- View this message in context: http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013p5759063.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/