Re: Limiting thread pool size for parallelProcessing?
Hi See also http://camel.apache.org/threading-model.html how you can setup thread pools / thread pool profiles etc, and assign those to the eips and components and whatnot. On Wed, Aug 13, 2014 at 7:41 PM, efenderbosch eric.fenderbo...@segmint.com wrote: Of course, I figure it out 30 minutes after posting. This route works as desired: from(stomp:request_queue). bean(new MyGenerator()). split(body(), new MyAggregationStrategy()). parallelProcessing().executorService(Executors.newFixedThreadPool(4)). bean(new MyRunner()). end(). recipientList(simple(stomp:${headers[reply-to]})); -- View this message in context: http://camel.465427.n5.nabble.com/Limiting-thread-pool-size-for-parallelProcessing-tp5755185p5755186.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/
BreadcrumbId is null after using transacted
Hi, I noticed the breadcrumbId is null after i use transacted. Is this by design? See example route below. from(step4)) .routeId(route-step4) .onCompletion().onCompleteOnly().bean(loggingProcessor, LoggingProcessor.AUDIT) .end() .onException(IllegalArgumentException.class) .bean(loggingProcessor, LoggingProcessor.GENERAL_FAILURE) .to(errorStep) .end() // HERE exchange.in.header.breadcrumbId == filled. OK .transacted(requiredJta) .to(toEndpoint) // HERE exchange.in.header.breadcrumbId == null .process(updateQueryBuilder) .to(dataSource) .bean(checkDatabaseUpdate); -- View this message in context: http://camel.465427.n5.nabble.com/BreadcrumbId-is-null-after-using-transacted-tp5755210.html Sent from the Camel - Users mailing list archive at Nabble.com.
RecepientList - Individual Target status
Hi Camel Riders I am using camel recepientList EIP for dynamic target system determination. Route as follows route from uri=direct:a / recipientList delimiter=# headerlistOfTargetSystems/header /recipientList /route Just wanted to know *if there is a way I can track the one which was successfull and the one which failed*. Is there a way to do that from this EIP? I would rather need this for reporting unavailable target systems or invokation failure and componse a re-try mechanisms. -- View this message in context: http://camel.465427.n5.nabble.com/RecepientList-Individual-Target-status-tp5755211.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieving EXEC_EXIT_VALUE from exec endpoint
Thanks Willem, I thought simplicity might have worked, but sadly no...switching from out to in to get the header doesn't give me any output either :( Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (RD) 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 El 13-08-2014, a las 21:46, Willem Jiang willem.ji...@gmail.com escribió: Hi, Did you try to check the EXEC_EXIT_VALUE from in message? camel:log message=Exit code: ${in.header.ExecBinding.EXEC_EXIT_VALUE} / You can find more information about in and out message here[1]. [1]http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html -- 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 August 14, 2014 at 2:52:07 AM, Gonzalo Vasquez (gvasq...@altiuz.cl) wrote: Extra, I'm using camel 2.13.2 In my pom.xml: org.apache.camel camel-spring-ws 2.13.2 Running both in Apache Tomcat 7 (JDK 1.7.0_04-b21 in OSX) and IBM WebSphere Application Server 8.5.5.2 (IBM JDK 1.7.0_45 in Debian Wheezy 7.2), with the same results. Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (RD) 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 El 13-08-2014, a las 14:09, gvasquez escribió: No exec headers are set after an invocation of this endpoint, so I'm not being able to decide what do upon process execution. I'm using Spring DSL like this: exec://{{cmod.arsLoad}}?useStderrOnEmptyStdout=trueargs=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id} I was trying to get the EXEC_EXIT_VALUE using something like: / But since I got no output I even tried: / But just got: [13/08/14 16:57:55:250 CLT] 0077 SystemOut O 2014-08-13 16:57:55,249 INFO [example ] - Exchange[ , Id: ID-thor-altiuz-cl-55058-1407963458446-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-thor-altiuz-cl-55058-1407963458446-0-7, CamelCreatedTimestamp=Wed Aug 13 16:57:44 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=recipientList3], DefaultMessageHistory[routeId=route4, node=to7]], CamelMulticastComplete=true, CamelMulticastIndex=0, CamelRecipientListEndpoint=exec:///opt/ibm/ondemand/V9.0/bin/arsload?args=-f+-g+CCMM+-h+192.168.10.77+-u+admin+-p+password+%2Ftmp%2FID-thor-altiuz-cl-55058-1407963458446-0-1useStderrOnEmptyStdout=true, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false} , Headers: {appGroup=CCMM, breadcrumbId=ID-thor-altiuz-cl-55058-1407963458446-0-1, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@4be1d2c4} , BodyType: String , Body: CCMM , Out: null: ] So nothing seems to be coming out as an exit valueany help would be appreciated -- View this message in context: http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Question: camel-sql out of memory error
Hi IMHO you should only set that fetch limit if getMaxMessagesPerPoll 0. So the user needs to set that option explicit if he/she want to limit it. On Wed, Aug 13, 2014 at 2:07 PM, Christian Müller christian.muel...@gmail.com wrote: At present, we do not limit the fetch size on the JDBC driver level which will fix this issue (e.g. preparedStatement.setFetchSize(getMaxMessagesPerPoll())). The drawback is, we don't know how many rows are in the database which will match our query. We only can assume if fetchSize is equal to maxMessagesPerPoll, there are more rows to read. From my point of view, we should go for this change. If nobody has objections, I will will do the needed changes later this week... Best, Christian - Software Integration Specialist Apache Member V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer Apache Incubator PMC Member https://www.linkedin.com/pub/christian-mueller/11/551/642 On Fri, Aug 8, 2014 at 10:34 PM, Matt Payne pa...@mattpayne.org wrote: I am getting an java.lang.OutOfMemoryError: Java heap space when using camel sql component with a query that returns a large number of rows. Using a small value for maxMessagesPerPoll=10 does not help[1]. When reading the source[2], I see: 255 protected ListMapString, Object queryForList(ResultSet rs) throws SQLException { 256 ColumnMapRowMapper rowMapper = new ColumnMapRowMapper(); 257 RowMapperResultSetExtractorMapString, Object mapper = new RowMapperResultSetExtractorMapString, Object(rowMapper); 258 ListMapString, Object data = mapper.extractData(rs); 259 return data; 260 } It seems that all of the result set, rs, is going to be read regardless of how large it is. When stepping through via eclipse's debugger this is what I see happening. It's unclear how to ask camel sql component to only take X rows at a time. Is there a way to do this please? Thanks! --Matt Payne [1] http://camel.465427.n5.nabble.com/Fetching-data-in-batches-td5718366.html [2] https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java#l255 -- 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: RecepientList - Individual Target status
The exchange contains a property with the failure endpoint http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#FAILURE_ENDPOINT And you can use an aggregation strategy on the recipient list to handle when the recipients are done. Some details at http://camel.apache.org/recipient-list.html On Thu, Aug 14, 2014 at 2:47 PM, contactreji contactr...@gmail.com wrote: Hi Camel Riders I am using camel recepientList EIP for dynamic target system determination. Route as follows route from uri=direct:a / recipientList delimiter=# headerlistOfTargetSystems/header /recipientList /route Just wanted to know *if there is a way I can track the one which was successfull and the one which failed*. Is there a way to do that from this EIP? I would rather need this for reporting unavailable target systems or invokation failure and componse a re-try mechanisms. -- View this message in context: http://camel.465427.n5.nabble.com/RecepientList-Individual-Target-status-tp5755211.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: BreadcrumbId is null after using transacted
What Camel version do you use? And what kind of component is from(step4) ? On Thu, Aug 14, 2014 at 2:26 PM, rwijngaa rino.van.wijngaar...@gmail.com wrote: Hi, I noticed the breadcrumbId is null after i use transacted. Is this by design? See example route below. from(step4)) .routeId(route-step4) .onCompletion().onCompleteOnly().bean(loggingProcessor, LoggingProcessor.AUDIT) .end() .onException(IllegalArgumentException.class) .bean(loggingProcessor, LoggingProcessor.GENERAL_FAILURE) .to(errorStep) .end() // HERE exchange.in.header.breadcrumbId == filled. OK .transacted(requiredJta) .to(toEndpoint) // HERE exchange.in.header.breadcrumbId == null .process(updateQueryBuilder) .to(dataSource) .bean(checkDatabaseUpdate); -- View this message in context: http://camel.465427.n5.nabble.com/BreadcrumbId-is-null-after-using-transacted-tp5755210.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: Overriding Properties
Hi I logged a ticket to not forget about this https://issues.apache.org/jira/browse/CAMEL-7699 On Mon, Aug 11, 2014 at 4:56 PM, Matt Raible m...@raibledesigns.com wrote: On Sat, Aug 9, 2014 at 2:47 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Yeah not sure if Spring Boot does stuff differently than regular spring framework in term of the property placeholder stuff. Yes, it does. From http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html : Spring Boot uses a very particular PropertySource order that is designed to allow sensible overriding of values, properties are considered in the the following order: Command line arguments. Java System properties (System.getProperties()). OS environment variables. JNDI attributes from java:comp/env A RandomValuePropertySource that only has properties in random.*. Application properties outside of your packaged jar (application.properties including YAML and profile variants). Application properties packaged inside your jar (application.properties including YAML and profile variants). @PropertySource annotations on your @Configuration classes. Default properties (specified using SpringApplication.setDefaultProperties). It's also smart enough to know that a ESB_ENV environment variable should override a esb.env property. Have you tried that spring - camel bridge, there is a note about it on the top of this page that points you to it http://camel.apache.org/using-propertyplaceholder.html Yep, I have this in my CamelConfig.java: @Override protected void setupCamelContext(CamelContext camelContext) throws Exception { PropertiesComponent pc = new PropertiesComponent(); pc.setLocation(classpath:application.properties); camelContext.addComponent(properties, pc); super.setupCamelContext(camelContext); } And yeah if some code is missing to make this easier, then maybe we can do something in camel-spring, or we could introduce a new camel-spring-boot module that integrates the spring boot with Camel. Maybe there is other spring boot stuff we need to take a look at. I have a workaround, so this isn't urgent. However, it would be pretty sweet if Camel was smart enough to know about these overrides. This seems to be one of the main classes for making this work in Spring Boot: https://github.com/spring-projects/spring-boot/blob/master/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java On Fri, Aug 8, 2014 at 4:15 AM, Matt Raible m...@raibledesigns.com wrote: Hello all, In my Camel app, I recently integrated Spring Boot to use its external configuration feature. Basically, I can put default properties in an src/main/resources/application.properties file. Then I can override them on different servers using various mechanisms, from using a config/application.properties on the classpath to using environment variables. It's really slick in that you can have a single WAR that can be configured for dev, test, staging and prod. To read these properties in my Camel routes, I'm using the following setupCamelContext() method to read this file in. Problem is, it doesn't hook into Spring Boot's external override mechanism. Is there anyway to make Camel aware of Spring Boot's override feature? @Configuration @ImportResource(classpath:META-INF/cxf/cxf.xml) @ComponentScan(com.company.app) public class CamelConfig extends CamelConfiguration { @Value(${logging.trace.enabled}) private Boolean tracingEnabled; @Override protected void setupCamelContext(CamelContext camelContext) throws Exception { PropertiesComponent pc = new PropertiesComponent(); pc.setLocation(classpath:application.properties); camelContext.addComponent(properties, pc); // see if trace logging is turned on if (tracingEnabled) { camelContext.setTracing(true); } super.setupCamelContext(camelContext); } @Bean public Tracer camelTracer() { Tracer tracer = new Tracer(); tracer.setTraceExceptions(false); tracer.setTraceInterceptors(true); tracer.setLogName(com.company.app.trace); return tracer; } } If not, I'm able to workaround this issue by changing the properties from being inlined to being separate Strings. For example, here's an onException handler that doesn't pick up overridden properties: public abstract class AbstractRouteBuilder extends RouteBuilder { /** * Default exception handling for all routes. * * @throws Exception */ @Override public void configure() throws Exception { onException(Exception.class)
Re: HTTP basic authorization with HTTP4?
Thanks Willem. I was having issues configuring the keystore and truststore. I tried implementing the HttpClientConfigurer below but I am not seeing the keystore and specified truststore loading up in the javax.net.debug during SSL handshake. I only see the default jre/lib/security/cacerts truststore loading up. Am I missing anything in MyHttpClientConfigurer or MyRouteBuilder. Or possible in MainApp? public class MyHttpClientConfigurer implements HttpClientConfigurer { public void configureHttpClient(HttpClientBuilder client) { try { KeyStore keystore = KeyStore.getInstance(PKCS12); keystore.load(new FileInputStream(new File(/etc/httpd/ssl/WS1909634885._.1.p12)), password.toCharArray()); KeyStore truststore = KeyStore.getInstance(JKS);; truststore.load(new FileInputStream(new File(/usr/java/jdk1.6.0_45/jre/lib/security/cacertbak)), changeit.toCharArray()); SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme(https, 443, new SSLSocketFactory(keystore, password, truststore))); } catch(Exception e) { System.out.println(In configureHttpClient + e); e.printStackTrace(); } } } public class MyRouteBuilder extends RouteBuilder { public void configure() { from(jetty:http://server:4443/fdggwsapi/services;).process(new MyProcessor()).to(https4://server:443/fdggwsapi/services?bridgeEndpoint=trueauthMethod=BasicauthUsername=WS1909634900._.1authPassword=passwordauthenticationPreemptive=true); } private void configureSslForHttp4() { HttpComponent httpComponent = getContext().getComponent(http4, HttpComponent.class); httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer()); } } public class MainApp { public static void main(String... args) throws Exception { Main main = new Main(); main.enableHangupSupport(); main.addRouteBuilder(new MyRouteBuilder()); main.run(args); System.out.println(MainApp started - Hello); } } -- View this message in context: http://camel.465427.n5.nabble.com/HTTP-basic-authorization-with-HTTP4-tp5755181p5755212.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP basic authorization with HTTP4?
public class MyRouteBuilder extends RouteBuilder { public void configure() { *//Missed this in previous post * *configureSslForHttp4();* from(jetty:http://server:4443/fdggwsapi/services;).process(new MyProcessor()).to(https4://server:443/fdggwsapi/services?bridgeEndpoint=trueauthMethod=BasicauthUsername=WS1909634900._.1authPassword=passwordauthenticationPreemptive=true); } private void configureSslForHttp4() { HttpComponent httpComponent = getContext().getComponent(http4, HttpComponent.class); httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer()); } } -- View this message in context: http://camel.465427.n5.nabble.com/HTTP-basic-authorization-with-HTTP4-tp5755181p5755213.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieving EXEC_EXIT_VALUE from exec endpoint
Debugging camel's java code I found out that the actual header name is CamelExecExitValue, the other was just the Java constant name for such header. Headers ARE in fact being correctly set in java code, but the just don't appear in next spring DSL instruction. Could anyone help me please? El 13-08-2014, a las 21:53, Willem.Jiang [via Camel] ml-node+s465427n5755196...@n5.nabble.com escribió: Hi, Did you try to check the EXEC_EXIT_VALUE from in message? camel:log message=Exit code: ${in.header.ExecBinding.EXEC_EXIT_VALUE} / You can find more information about in and out message here[1]. [1]http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html -- 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 August 14, 2014 at 2:52:07 AM, Gonzalo Vasquez ([hidden email]) wrote: Extra, I'm using camel 2.13.2 In my pom.xml: org.apache.camel camel-spring-ws 2.13.2 Running both in Apache Tomcat 7 (JDK 1.7.0_04-b21 in OSX) and IBM WebSphere Application Server 8.5.5.2 (IBM JDK 1.7.0_45 in Debian Wheezy 7.2), with the same results. Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (RD) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 +56 2 335 2461 [hidden email] http://www.altiuz.cl http://www.altiuzreports.com El 13-08-2014, a las 14:09, gvasquez escribió: No exec headers are set after an invocation of this endpoint, so I'm not being able to decide what do upon process execution. I'm using Spring DSL like this: exec://{{cmod.arsLoad}}?useStderrOnEmptyStdout=trueargs=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id} I was trying to get the EXEC_EXIT_VALUE using something like: / But since I got no output I even tried: / But just got: [13/08/14 16:57:55:250 CLT] 0077 SystemOut O 2014-08-13 16:57:55,249 INFO [example ] - Exchange[ , Id: ID-thor-altiuz-cl-55058-1407963458446-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-thor-altiuz-cl-55058-1407963458446-0-7, CamelCreatedTimestamp=Wed Aug 13 16:57:44 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=recipientList3], DefaultMessageHistory[routeId=route4, node=to7]], CamelMulticastComplete=true, CamelMulticastIndex=0, CamelRecipientListEndpoint=exec:///opt/ibm/ondemand/V9.0/bin/arsload?args=-f+-g+CCMM+-h+192.168.10.77+-u+admin+-p+password+%2Ftmp%2FID-thor-altiuz-cl-55058-1407963458446-0-1useStderrOnEmptyStdout=true, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false} , Headers: {appGroup=CCMM, breadcrumbId=ID-thor-altiuz-cl-55058-1407963458446-0-1, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@4be1d2c4} , BodyType: String , Body: CCMM , Out: null: ] So nothing seems to be coming out as an exit valueany help would be appreciated -- View this message in context: http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188.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/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188p5755196.html To unsubscribe from Retrieving EXEC_EXIT_VALUE from exec endpoint, click here. NAML -- View this message in context: http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188p5755224.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: HTTP basic authorization with HTTP4?
Please disregard this thread. The JSSE Configuration Utility worked for me(instead of HttpClientConfigurer). -- View this message in context: http://camel.465427.n5.nabble.com/HTTP-basic-authorization-with-HTTP4-tp5755181p5755228.html Sent from the Camel - Users mailing list archive at Nabble.com.
Exec endpoint not working correctly with recipientList
Hi there! Experimenting with the exec endpoint I found out that it works perfectly (setting CamelExecExitValue header) when invoked with hardcoded args, such as: camel:to uri=exec:///opt/ibm/ondemand/V9.0/bin/arsload?args=-f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1 / But fails silently on setting headers (CamelExecExitValue not set, and blank body )when invoked as a receipientList endpoint, with variable parameters such as: camel:recipientList camel:simple exec://{{cmod.arsLoad}}?args=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id}/camel:simple /camel:recipientList I actually need to use the second approach as the arguments to my command are determined in runtime. Am I doing something wrong or the recipientList actually removed the expected headers? PS: This is derived from my previous post at http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-td5755188.html Regards, Gonzalo Vasquez
Re: Question: camel-sql out of memory error
Yes, of course... I have opened a JIRA [1] and start working on it. [1] https://issues.apache.org/jira/browse/CAMEL-7700 Best, Christian - Software Integration Specialist Apache Member V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer Apache Incubator PMC Member https://www.linkedin.com/pub/christian-mueller/11/551/642 On Thu, Aug 14, 2014 at 3:22 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi IMHO you should only set that fetch limit if getMaxMessagesPerPoll 0. So the user needs to set that option explicit if he/she want to limit it. On Wed, Aug 13, 2014 at 2:07 PM, Christian Müller christian.muel...@gmail.com wrote: At present, we do not limit the fetch size on the JDBC driver level which will fix this issue (e.g. preparedStatement.setFetchSize(getMaxMessagesPerPoll())). The drawback is, we don't know how many rows are in the database which will match our query. We only can assume if fetchSize is equal to maxMessagesPerPoll, there are more rows to read. From my point of view, we should go for this change. If nobody has objections, I will will do the needed changes later this week... Best, Christian - Software Integration Specialist Apache Member V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer Apache Incubator PMC Member https://www.linkedin.com/pub/christian-mueller/11/551/642 On Fri, Aug 8, 2014 at 10:34 PM, Matt Payne pa...@mattpayne.org wrote: I am getting an java.lang.OutOfMemoryError: Java heap space when using camel sql component with a query that returns a large number of rows. Using a small value for maxMessagesPerPoll=10 does not help[1]. When reading the source[2], I see: 255 protected ListMapString, Object queryForList(ResultSet rs) throws SQLException { 256 ColumnMapRowMapper rowMapper = new ColumnMapRowMapper(); 257 RowMapperResultSetExtractorMapString, Object mapper = new RowMapperResultSetExtractorMapString, Object(rowMapper); 258 ListMapString, Object data = mapper.extractData(rs); 259 return data; 260 } It seems that all of the result set, rs, is going to be read regardless of how large it is. When stepping through via eclipse's debugger this is what I see happening. It's unclear how to ask camel sql component to only take X rows at a time. Is there a way to do this please? Thanks! --Matt Payne [1] http://camel.465427.n5.nabble.com/Fetching-data-in-batches-td5718366.html [2] https://git-wip-us.apache.org/repos/asf?p=camel.git;a=blob;f=components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlEndpoint.java#l255 -- 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 Mybatis 2.13.1 multiple statementTypes in a batch or Transaction?
Hello Mueller, I used the DB transaction, but I see that the transaction is not rolled back on an exception. I tried with transacted() in route instead of policy() but it behaved the same way. E.g. Exception case:The first two updates were not rolled back on failure of the third one below: .to(mybatis:userMapper.updatePerson?statementType=Update) --- Passed .to(mybatis:userMapper.updateCertificate8?statementType=Update) Passed .to(mybatis:userMapper.updateApplicationGroup?statementType=Update) Failed *Am I missing anything?* *Camel Registry* SimpleRegistry registry = new SimpleRegistry(); DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager( sqlSessionFactory.getConfiguration().getEnvironment() .getDataSource()); registry.put(transactionManager,dataSourceTransactionManager); SpringTransactionPolicy springTransactionPolicy = new SpringTransactionPolicy(); springTransactionPolicy.setTransactionManager(dataSourceTransactionManager); springTransactionPolicy.setPropagationBehaviorName(PROPAGATION_REQUIRED); registry.put(PROPAGATION_REQUIRED,springTransactionPolicy); camelContext = new DefaultCamelContext(registry); camelContext.setTracing(true); camelContext.start(); * Camel Route:* onException(JMSException.class) .handled(true).maximumRedeliveries(0).end(); onException(IllegalArgumentException.class) .handled(true).maximumRedeliveries(0).rollback(Rolling back the IllegalArgumentException) .end(); onException(PersistenceException.class) .handled(true).maximumRedeliveries(0).rollback(Rolling back the transaction) .end(); onException(RollbackExchangeException.class) .handled(false).maximumRedeliveries(0).process(new CamelTibcoMessageProcessor()) .end(); from(tibjms:ISONE.CTS.CUSTOMER_SERVICES.CUSTOMER.UPDATE.V01?transacted=false) .choice() .when(simple(${in.body?.getTRANSACTION?.getEVENT} in ${properties:cts.bridge.person.action.transaction.event} + ${in.body?.getPERSON?.getAPPLICATIONGROUPS?.getAPPLICATIONGROUP[last]?.getAPPLICATIONSHORTNAME} + in ${properties:cts.bridge.person.action.application.short.name})) .policy(PROPAGATION_REQUIRED).id(PersonBridgeTx) .*to(mybatis:userMapper.updatePerson?statementType=Update) .to(mybatis:userMapper.updateCertificate8?statementType=Update) .to(mybatis:userMapper.updateApplicationGroup?statementType=Update) .to(mybatis:userMapper.insertPersonFromCAMSCTSBridge?statementType=InsertListexecutorType=batch)* .endChoice() .otherwise() .log(The Event and or Application Name is not valid. ) .end(); -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Mybatis-2-13-1-multiple-statementTypes-in-a-batch-or-Transaction-tp5755122p5755231.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Exec endpoint not working correctly with recipientList
Hi What camel version do you use? And can you try add something after recipient list, such as to uri=log:foo?showAll=true/ And see if you have the header now, On Thu, Aug 14, 2014 at 6:18 PM, Gonzalo Vasquez gvasq...@altiuz.cl wrote: Hi there! Experimenting with the exec endpoint I found out that it works perfectly (setting CamelExecExitValue header) when invoked with hardcoded args, such as: camel:to uri=exec:///opt/ibm/ondemand/V9.0/bin/arsload?args=-f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1 / But fails silently on setting headers (CamelExecExitValue not set, and blank body )when invoked as a receipientList endpoint, with variable parameters such as: camel:recipientList camel:simple exec://{{cmod.arsLoad}}?args=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id}/camel:simple /camel:recipientList I actually need to use the second approach as the arguments to my command are determined in runtime. Am I doing something wrong or the recipientList actually removed the expected headers? PS: This is derived from my previous post at http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-td5755188.html Regards, Gonzalo Vasquez -- 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: Exec endpoint not working correctly with recipientList
Dear Claus, I'm using the latest camel version: dependency groupIdorg.apache.camel/groupId artifactIdcamel-spring-ws/artifactId version2.13.2/version /dependency I have already tried using that log line this way: camel:recipientList camel:constantexec://echo?args=-f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1/camel:constant !-- camel:simple exec://{{cmod.arsLoad}}?args=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id}/camel:simple -- /camel:recipientList camel:to uri=log:org.apache.camel.example?showAll=trueamp;multiline=true / and the output is like this: And the output is like this: 2014-08-14 13:02:04,789 INFO [example ] - Exchange[ , Id: ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-7, CamelCreatedTimestamp=Thu Aug 14 13:02:04 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=doTry1], DefaultMessageHistory[routeId=route4, node=recipientList3], DefaultMessageHistory[routeId=route4, node=to7]], CamelMulticastComplete=true, CamelMulticastIndex=0, CamelRecipientListEndpoint=exec://echo?args=-f+-g+FONDO+-h+192.168.10.77+-u+admin+-p+password+%2Ftmp%2FID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-1, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false, TryRouteBlock=true} , Headers: {appGroup=FONDO, breadcrumbId=ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-1, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@5393973d} , BodyType: String , Body: FONDO , Out: null: ] But when it is after the to / exec (no receipientList): camel:to uri=exec://echo?args=-f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1 / camel:to uri=log:org.apache.camel.example?showAll=trueamp;multiline=true / I do get the correct headers: 2014-08-14 13:02:04,808 INFO [example ] - Exchange[ , Id: ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-7, CamelCreatedTimestamp=Thu Aug 14 13:02:04 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=doTry1], DefaultMessageHistory[routeId=route4, node=recipientList3], DefaultMessageHistory[routeId=route4, node=to7], DefaultMessageHistory[routeId=route4, node=to8], DefaultMessageHistory[routeId=route4, node=to9]], CamelMulticastComplete=true, CamelMulticastIndex=0, CamelRecipientListEndpoint=exec://echo?args=-f+-g+FONDO+-h+192.168.10.77+-u+admin+-p+password+%2Ftmp%2FID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-1, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false, TryRouteBlock=true} , Headers: {appGroup=FONDO, breadcrumbId=ID-MacBook-Pro-de-Gonzalo-Vasquez-local-49167-1408035712756-0-1, CamelExecExitValue=0, CamelExecStderr=null, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@5393973d} , BodyType: org.apache.camel.component.exec.ExecResult , Body: -f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1 , Out: null: ] Just also tried switiching the endpoint from simple language to a plain constant, to check, but same problem: camel:constantexec://echo?args=-f -g FONDO -h 192.168.10.77 -u admin -p password /tmp/ID-MacBook-Pro-de-Gonzalo-Vasquez-local-64241-1408030173940-0-1/camel:constant Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (RD) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
Re: Exec endpoint not working correctly with recipientList
Just built a workaround...using a dummy exec with no args, but setting both the executable and the args via de proper header prior to endpoint invocation, that way I finally DO GET the correct output headers, with the flexibility of a dynamic URL. Spring DSL: camel:setHeader headerName=CamelExecCommandExecutable camel:simple{{cmod.arsLoad}}/camel:simple /camel:setHeader camel:setHeader headerName=CamelExecCommandArgs camel:simple-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id}/camel:simple /camel:setHeader camel:to uri=exec://dummy / camel:to uri=log:org.apache.camel.example?showAll=trueamp;multiline=true / camel:log message=Error code: ${in.header.CamelExecExitValue} / Output / log example: [14/08/14 18:35:06:177 CLT] 007d SystemOut O 2014-08-14 18:35:06,177 ERROR [ExecProducer ] - The command ExecCommand [args=[-f, -g, FONDO, -h, 192.168.10.245, -u, admin, -p, password, /tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1], executable=/opt/ibm/ondemand/V9.0/bin/arsload, timeout=9223372036854775807, outFile=null, workingDir=null, useStderrOnEmptyStdout=false] returned exit value 11 [14/08/14 18:35:06:179 CLT] 007d SystemOut O 2014-08-14 18:35:06,179 INFO [example ] - Exchange[ , Id: ID-thor-altiuz-cl-51959-1408055697500-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-thor-altiuz-cl-51959-1408055697500-0-2, CamelCreatedTimestamp=Thu Aug 14 18:35:05 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=doTry1], DefaultMessageHistory[routeId=route4, node=setHeader4], DefaultMessageHistory[routeId=route4, node=setHeader5], DefaultMessageHistory[routeId=route4, node=to7], DefaultMessageHistory[routeId=route4, node=to8]], CamelMulticastComplete=true, CamelMulticastIndex=2, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false, TryRouteBlock=true} , Headers: {appGroup=FONDO, breadcrumbId=ID-thor-altiuz-cl-51959-1408055697500-0-1, CamelExecExitValue=11, CamelExecStderr=null, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@492082f4} , BodyType: org.apache.camel.component.exec.ExecResult , Body: ARS1609W Specifying passwords on the command line is insecure due to the text being visible. See the Installation and Configuration Guide for your platform for information about the arsstash command or using Unified Login.ARS4315I Processing file /tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1ARS1110E The application group FONDO does not exist or user admin does not have permission to access the application groupARS4318E Processing failed for file /tmp/ID-thor-altiuz-cl-51959-1408055697500-0-1Processing has stopped. The remaining files will NOT be processed. , Out: null: ] [14/08/14 18:35:06:179 CLT] 007d SystemOut O 2014-08-14 18:35:06,179 INFO [route4 ] - Error code: 11 -- View this message in context: http://camel.465427.n5.nabble.com/Exec-endpoint-not-working-correctly-with-recipientList-tp5755229p5755236.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retrieving EXEC_EXIT_VALUE from exec endpoint
OH, you should use ${in.header.CamelExecExitValue} to look up the exit value. The simple expression doesn’t support to look up the Java constant string value as you thought :) -- 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 August 14, 2014 at 11:25:46 PM, gvasquez (gvasq...@altiuz.cl) wrote: Debugging camel's java code I found out that the actual header name is CamelExecExitValue, the other was just the Java constant name for such header. Headers ARE in fact being correctly set in java code, but the just don't appear in next spring DSL instruction. Could anyone help me please? El 13-08-2014, a las 21:53, Willem.Jiang [via Camel] escribió: Hi, Did you try to check the EXEC_EXIT_VALUE from in message? You can find more information about in and out message here[1]. [1]http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html -- 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 August 14, 2014 at 2:52:07 AM, Gonzalo Vasquez ([hidden email]) wrote: Extra, I'm using camel 2.13.2 In my pom.xml: org.apache.camel camel-spring-ws 2.13.2 Running both in Apache Tomcat 7 (JDK 1.7.0_04-b21 in OSX) and IBM WebSphere Application Server 8.5.5.2 (IBM JDK 1.7.0_45 in Debian Wheezy 7.2), with the same results. Regards, Gonzalo Vásquez Sáez Gerente Investigación y Desarrollo (RD) Altiuz Soluciones Tecnológicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 +56 2 335 2461 [hidden email] http://www.altiuz.cl http://www.altiuzreports.com El 13-08-2014, a las 14:09, gvasquez escribió: No exec headers are set after an invocation of this endpoint, so I'm not being able to decide what do upon process execution. I'm using Spring DSL like this: exec://{{cmod.arsLoad}}?useStderrOnEmptyStdout=trueargs=-f -g ${in.header.appGroup} -h {{cmod.host}} -u {{cmod.username}} -p {{cmod.password}} {{tmp.path}}/${id} I was trying to get the EXEC_EXIT_VALUE using something like: / But since I got no output I even tried: / But just got: [13/08/14 16:57:55:250 CLT] 0077 SystemOut O 2014-08-13 16:57:55,249 INFO [example ] - Exchange[ , Id: ID-thor-altiuz-cl-55058-1407963458446-0-7 , ExchangePattern: InOptionalOut , Properties: {CamelCorrelationId=ID-thor-altiuz-cl-55058-1407963458446-0-7, CamelCreatedTimestamp=Wed Aug 13 16:57:44 CLT 2014, CamelMessageHistory=[DefaultMessageHistory[routeId=route1, node=multicast1], DefaultMessageHistory[routeId=route1, node=to3], DefaultMessageHistory[routeId=route4, node=to6], DefaultMessageHistory[routeId=route4, node=setHeader3], DefaultMessageHistory[routeId=route4, node=recipientList3], DefaultMessageHistory[routeId=route4, node=to7]], CamelMulticastComplete=true, CamelMulticastIndex=0, CamelRecipientListEndpoint=exec:///opt/ibm/ondemand/V9.0/bin/arsload?args=-f+-g+CCMM+-h+192.168.10.77+-u+admin+-p+password+%2Ftmp%2FID-thor-altiuz-cl-55058-1407963458446-0-1useStderrOnEmptyStdout=true, CamelToEndpoint=log://org.apache.camel.example?multiline=trueshowAll=true, isXalanTransformer=false} , Headers: {appGroup=CCMM, breadcrumbId=ID-thor-altiuz-cl-55058-1407963458446-0-1, CamelSpringWebserviceSoapHeader=javax.xml.transform.dom.DOMSource@4be1d2c4} , BodyType: String , Body: CCMM , Out: null: ] So nothing seems to be coming out as an exit valueany help would be appreciated -- View this message in context: http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188.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/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188p5755196.html To unsubscribe from Retrieving EXEC_EXIT_VALUE from exec endpoint, click here. NAML -- View this message in context: http://camel.465427.n5.nabble.com/Retrieving-EXEC-EXIT-VALUE-from-exec-endpoint-tp5755188p5755224.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Inflight message gone when CamelContext shutdown
I checked all queues available... the message simply gone without going to DLQ... any other idea? -- View this message in context: http://camel.465427.n5.nabble.com/Inflight-message-gone-when-CamelContext-shutdown-tp5755017p5755238.html Sent from the Camel - Users mailing list archive at Nabble.com.