Camel File Cluster
Hi! I'm developing app using camel and stuck with problem. I'm trying to build cluster with file consumer. They lokk the same directory on NAS and I want achieve the result when if one server fails, other continue processing files. From here: http://stackoverflow.com/questions/26066012/clustering-in-apache-camel-multiple-jvms-same-camelcontext I've read that File consumer can lock file and no other consumer can get this file. But on practice my 2 file consumers on different servers don't let each other delete files. And for all my files .camelLock are created. What is the best approach in my case? Should i write some balansing app or it's possible to make things work out of the box? my route: from(*file:V:**\\folder1* *?exclusiveReadLockStrategy=#myReadLockStrategyreadLockCheckInterval=3000* ).threads(10) .to(*sftp://user@server:22/camel/outCLUSTER?password=pwd*);
Re: Oracle Procedure Calls with Camel
Hi Take a look at camel-mybatis which can call stored procedures. You can find examples on their project site, and also in SO such as http://stackoverflow.com/questions/15666856/calling-oracle-stored-procedures-with-mybatis On Thu, Jul 9, 2015 at 4:19 PM, deekayzain deekayz...@gmail.com wrote: Thanks Jacek. your post is using Spring-jpa. we dont have any way to call stored procedures in camel-jdbc or camel-sql of latest release. Please confirm. regds, deekayzain -- View this message in context: http://camel.465427.n5.nabble.com/Oracle-Procedure-Calls-with-Camel-tp5745115p5769053.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/
Throttling and custom exception handling
Greetings! Given: ServiceA that is used by multiple applications and has rate limits on certain endpoints. In cases when global rate limiting exceeded, ServiceA throws exception with X seconds delay. Throttled Camel route with concurrent consumers that submits a request to that certain endpoint Initial thoughts: Every time we get SleepWithDelayException, stop the route by having separate route with custom processor that stops, sleeps and starts the route. Though, it may result in a deadlock. It may look like control bus. Secondary thoughts: use delay from exception to recalculate next slot in Throttler, though it's not possible in 2.14 version So the question is: Am i moving the correct direction? Any other ideas? - Serge
Re: Camel Execution Exception
Thanks Claus. Please see the attached screenshot. http://camel.465427.n5.nabble.com/file/n5769064/Screen_Shot_2015-07-09_at_12.png -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Execution-Exception-Hiding-message-payload-details-tp5769004p5769064.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: readSize option JDBC component not working for split
okay , it worked . Thanks -- View this message in context: http://camel.465427.n5.nabble.com/readSize-option-JDBC-component-not-working-for-split-tp5769042p5769060.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Execution Exception
Hi You can turn off logging the message history with errorHandler(defaultErrorHandler().logExhaustedMessageHistory(false)); See bottom of http://camel.apache.org/message-history.html But we could likely add some easy configuration to keep part of the message history with the route stack-trace etc but avoid logging the message body. You can also set the max body length to a low value, its 1 by default. See more here http://camel.apache.org/how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html On Thu, Jul 9, 2015 at 6:26 PM, MC 2320...@gmail.com wrote: Thanks Claus. Please see the attached screenshot. http://camel.465427.n5.nabble.com/file/n5769064/Screen_Shot_2015-07-09_at_12.png -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Execution-Exception-Hiding-message-payload-details-tp5769004p5769064.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: Problem from Java DSL to Spring DSL
Hi Claus, I replied to this question a couple of days ago with a similar question, but I am not sure why it is not showing up. Thats why I posting it again. I apologize if it is duplicate. Is it possible to use a random Java Constant or enum in headerName of setHeader in spring dsl. I tied with simple and spel expressions with no success. Below are the things I tried with. setHeader headerName=#{T(org.apache.camel.component.cxf.common.message.CxfConstants).OPERATION_NAME} simple${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}/simple /setHeader setHeader headerName=$simple{type:org.apache.camel.component.cxf.common.message.CxfConstants.OPERATION_NAME} simple${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}/simple /setHeader setHeader headerName=${type:org.apache.camel.component.cxf.common.message.CxfConstants.OPERATION_NAME} simple${enum:org.apache.camel.component.cxf.common.message.CxfConstants.DISPATCH_DEFAULT_OPERATION_NAMESPACE}/simple /setHeader Value is resolved, but expressions in headerName are not. Thanks in advance. MC -- View this message in context: http://camel.465427.n5.nabble.com/Problem-from-Java-DSL-to-Spring-DSL-tp5732558p5769067.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel Execution Exception
Thank you very much Claus, this really helps. -- View this message in context: http://camel.465427.n5.nabble.com/Camel-Execution-Exception-Hiding-message-payload-details-tp5769004p5769066.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel 2.14/Netty: How to add ByteArrayDecoder to ServerChannelPipeline?
There are quit different change between the Netty3.x and Netty4.x. That is why we create a new camel component camel-netty4[1] for it. So I think you can just need to change the camel-netty to camel-netty4 and use the scheme netty4 in your camel route. -- 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 July 1, 2015 at 9:54:43 PM, SteveR (srichard...@vonage.com) wrote: Hi Willem: Actually, I'm currently using Camel 2.14 and Netty 3.x (org.jboss.netty). I'm wondering if there is a sensible way to migrate from netty3 to netty4 (i.e. other than just brute-force trying it) and what it would do with respect to my existing pipeline factory code, etc? Here's what I currently have in my pom.xml file: org.apache.camel camel-netty 2.14.0 io.netty netty-all 4.0.2.Final compile Thanks, Steve -- View this message in context: http://camel.465427.n5.nabble.com/Camel-2-14-Netty-How-to-add-ByteArrayDecoder-to-ServerChannelPipeline-tp5768638p5768749.html Sent from the Camel - Users mailing list archive at Nabble.com.
readSize option JDBC component not working for split
hello, I tried using the readSize option in the JDBC , but does not work. Is it that it won't work because I am using split with StreamList . I just want to get row By row from a DB , but i want only the first 10 rows. Currently it gets all the rows . Me code as below. from(timer://getData?period=2h).setBody(constant(from)).to(jdbc:DS?readSize=10outputType=StreamList).split(body()).process(new CustomProcessor(CustomConstants.DB)).to(to); regards, Felix T -- View this message in context: http://camel.465427.n5.nabble.com/readSize-option-JDBC-component-not-working-for-split-tp5769042.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Dynamic Routes aadition in Standalone application
okay, so if you say if i can add using the camelcontext i need not restart the application again ? -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-Routes-aadition-in-Standalone-application-tp5769018p5769041.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: MDC logging does not work with camel.routeId anymore
Hi I had a deep look inside camel-core to see if we can improve this, and found a possible way. However its a core change so will only do this in next release .. if possible https://issues.apache.org/jira/browse/CAMEL-8944 On Thu, Jul 9, 2015 at 8:37 AM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Thanks I have just had a look from the support case from RH. I can see that you do it a bit wrong, when you add onCompletion to the exchange, from the onCompletion - eg kinda like 2 times. This causes the problem as when you do that the onCompletion, as your processor is called from on completion, you should just do your logic in the process method without adding a 2nd onCompletion. On Tue, Jul 7, 2015 at 11:41 AM, rwijngaa rino.van.wijngaar...@gmail.com wrote: Hi Claus, The problem has to do with the onCompletion processor we use (and indeed, maybe also with the osgi pax logging) In the logging i see one line with the routeid and one line without the routeid. I can reproduce it with the blueprint route, logging config and java class @ fuse 6.2 included in the zip file. mdc-logging-problem.zip http://camel.465427.n5.nabble.com/file/n5768939/mdc-logging-problem.zip -- View this message in context: http://camel.465427.n5.nabble.com/MDC-logging-does-not-work-with-camel-routeId-anymore-tp5768851p5768939.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/ -- 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: MDC logging does not work with camel.routeId anymore
Hi Thanks I have just had a look from the support case from RH. I can see that you do it a bit wrong, when you add onCompletion to the exchange, from the onCompletion - eg kinda like 2 times. This causes the problem as when you do that the onCompletion, as your processor is called from on completion, you should just do your logic in the process method without adding a 2nd onCompletion. On Tue, Jul 7, 2015 at 11:41 AM, rwijngaa rino.van.wijngaar...@gmail.com wrote: Hi Claus, The problem has to do with the onCompletion processor we use (and indeed, maybe also with the osgi pax logging) In the logging i see one line with the routeid and one line without the routeid. I can reproduce it with the blueprint route, logging config and java class @ fuse 6.2 included in the zip file. mdc-logging-problem.zip http://camel.465427.n5.nabble.com/file/n5768939/mdc-logging-problem.zip -- View this message in context: http://camel.465427.n5.nabble.com/MDC-logging-does-not-work-with-camel-routeId-anymore-tp5768851p5768939.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: MDC logging does not work with camel.routeId anymore
Yes, i messed the example up a bit. The original route had no onCompletion tag and the routeId also was not printed. Luckilly i can work around it by doing a normal processor like: and in the route : -- View this message in context: http://camel.465427.n5.nabble.com/MDC-logging-does-not-work-with-camel-routeId-anymore-tp5768851p5769015.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: MDC logging does not work with camel.routeId anymore
Hi Yes from within a onCompletion it would work. On Thu, Jul 9, 2015 at 10:05 AM, rwijngaa rino.van.wijngaar...@gmail.com wrote: Yes, i messed the example up a bit. The original route had no onCompletion tag and the routeId also was not printed. Luckilly i can work around it by doing a normal processor like: and in the route : -- View this message in context: http://camel.465427.n5.nabble.com/MDC-logging-does-not-work-with-camel-routeId-anymore-tp5768851p5769015.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/
Dynamic Routes aadition in Standalone application
hello, I have write some code to start camel in Standalone mode , with some routes . But how do I make the roue addition dynamic without restarting the camel instance. I will be updating the route dynamically based on some triggers in my application. Looking at the standalone approach I dont see it possible without restarting the camel instance. Below is my code // create a Main instance main = new Main(); main.enableHangupSupport(); // add routes main.addRouteBuilder(new CustomDynamicRouteBuilderWithoutContext(rabbitmq://localhost/+EXCHANGE_NAME+?autoDelete=falsequeue=+QUEUE_NAME+username=guestpassword=guestroutingKey=+ROUTING_KEY,stream:out,XML)); main.addRouteBuilder(new CustomDynamicRouteBuilderWithoutContext(select * from TBL_DB,stream:out,DB)); // incase of DB need to provide Datasource Object main.bind(DS,setupDataSource1(jdbc:oracle:thin:@nero2:15521:FYR)); // enable hangup support so you can press ctrl + c to terminate the JVM // run until you terminate the JVM System.out.println(Starting Camel. Use ctrl + c to terminate the JVM.\n); main.run(); How do I add new routes without restarting the camel application, is there any way or other approach I could try. regards, Felix T -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-Routes-aadition-in-Standalone-application-tp5769018.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Dynamic Routes aadition in Standalone application
Hi Yes you can add/remove routes when Camel is running using the api on camel context. To remove a route you must stop it first. On Thu, Jul 9, 2015 at 1:09 PM, fxthomas felix.tho...@gmail.com wrote: okay, so if you say if i can add using the camelcontext i need not restart the application again ? -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-Routes-aadition-in-Standalone-application-tp5769018p5769041.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/
missing requirement org.apache.cxf.bundle
we are migrating to latest jboss fuse .when i try to deploy existing service to latest jboss fuse then getting below exception,.what is the bundle i need to install? Error executing command: Error installing bundles: Unresolved constraint in bundle idemployeeService [323]: Unable to resolve 323.0: missing requirement [323.0] osgi.wiring.bundle; (osgi.wiring.bundle=org.apache.cxf.bundle) pom.xml important contents * camel.version2.15.1.redhat-620133/camel.version activemq.version5.5.1.fuse-7-061/activemq.version cxf-version3.0.4.redhat-620133/cxf-version plugin groupIdorg.apache.felix/groupId artifactIdmaven-bundle-plugin/artifactId extensionstrue/extensions configuration instructions Bundle-SymbolicName${project.artifactId}/Bundle-SymbolicName Require-Bundleorg.apache.cxf.bundle/Require-Bundle Import-Package META-INF.cxf, javax.jws, javax.wsdl, javax.xml.bind, javax.xml.bind.annotation, javax.xml.namespace, javax.xml.ws, org.w3c.dom, * /Import-Package DynamicImport-Package org.apache.cxf.*, org.springframework.beans.* /DynamicImport-Package /instructions /configuration /plugin beans.xml * 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:ctx=http://www.springframework.org/schema/context; xmlns:cxf=http://camel.apache.org/schema/cxf; xmlns:http=http://cxf.apache.org/transports/http/configuration; 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://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd; import resource=classpath:META-INF/cxf/cxf.xml/ ctx:property-placeholder location=classpath:idemployee-service.properties/ camel:camelContext xmlns=http://camel.apache.org/schema/spring; route id=route1 from uri=cxf:bean:idemployeeRouterEndpoint/ to uri=cxf:bean:idemployeeServiceEndpoint/ /route /camel:camelContext bean id=loggingInInterceptor class=org.apache.cxf.interceptor.LoggingInInterceptor/ cxf:cxfEndpoint id=idemployeeServiceEndpoint wsdlURL=${idemployee-host}/idemployee-webservice/idemployeeService?wsdl address=${idemployee-host}/idemployee-webservice/idemployeeService endpointName=idemployeeService serviceName=idemployeeService xmlns:s=http://service.idemployee.com; cxf:properties entry key=dataFormat value=MESSAGE/ entry key=defaultOperationNamespace value=http://service.idemployee.com// /cxf:properties /cxf:cxfEndpoint cxf:cxfEndpoint id=idemployeeRouterEndpoint address=http://0.0.0.0:9199/idemployee/soap; wsdlURL=${idemployee-host}/idemployee-webservice/idemployeeService?wsdl endpointName=idemployeeService serviceName=idemployeeService xmlns:s=http://service.idemployee.com; cxf:inInterceptors ref bean=loggingInInterceptor/ /cxf:inInterceptors cxf:properties entry key=dataFormat value=MESSAGE/ /cxf:properties /cxf:cxfEndpoint /beans -- View this message in context: http://camel.465427.n5.nabble.com/missing-requirement-org-apache-cxf-bundle-tp5769048.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Dynamic Routes aadition in Standalone application
See the api on CamelContext where you can add routes. On Thu, Jul 9, 2015 at 10:42 AM, fxthomas felix.tho...@gmail.com wrote: hello, I have write some code to start camel in Standalone mode , with some routes . But how do I make the roue addition dynamic without restarting the camel instance. I will be updating the route dynamically based on some triggers in my application. Looking at the standalone approach I dont see it possible without restarting the camel instance. Below is my code // create a Main instance main = new Main(); main.enableHangupSupport(); // add routes main.addRouteBuilder(new CustomDynamicRouteBuilderWithoutContext(rabbitmq://localhost/+EXCHANGE_NAME+?autoDelete=falsequeue=+QUEUE_NAME+username=guestpassword=guestroutingKey=+ROUTING_KEY,stream:out,XML)); main.addRouteBuilder(new CustomDynamicRouteBuilderWithoutContext(select * from TBL_DB,stream:out,DB)); // incase of DB need to provide Datasource Object main.bind(DS,setupDataSource1(jdbc:oracle:thin:@nero2:15521:FYR)); // enable hangup support so you can press ctrl + c to terminate the JVM // run until you terminate the JVM System.out.println(Starting Camel. Use ctrl + c to terminate the JVM.\n); main.run(); How do I add new routes without restarting the camel application, is there any way or other approach I could try. regards, Felix T -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-Routes-aadition-in-Standalone-application-tp5769018.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/
Accessing HttpClient from JettyHttpComponent
Hi - I'm migrating some legacy code from Camel 2.8.3 up to 2.15.2. Previously I was able to access a Jetty HttpClient like so: JettyHttpComponent jettyComponent = (JettyHttpComponent) this.context.getComponent( CamelHttpProxy.JETTY_COMPONENT_NAME); HttpClient = jettyComponent.getHttpClient(); That'd let me set various keystore and truststore parameters for the target side of the proxy route I'm building. That method doesn't seem to exist anymore. Is there another way to access the jetty HttpClient? Or, is there another way to set up my target TLS parameters? Thanx, Stephen W. Chappell
Re: Camel File Cluster
Hi Andrey, You should create a route policy that would listen for cluster join/leave requests OR use special components that allow running a route on single node in cluster. For route policy option, you can use either ZooKeeper - http://camel.apache.org/zookeeper.html#Zookeeper-ZooKeeperenabledRoutepolicy. or write your own with Hazelcast in case you want simpler deployment. For special components, you can use JGroups - http://camel.apache.org/jgroups.html or Master Endpoint from Fabric8 - http://fabric8.io/gitbook/camelEndpointMaster.html Hope that helps -- View this message in context: http://camel.465427.n5.nabble.com/Camel-File-Cluster-tp5769056p5769068.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: readSize option JDBC component not working for split
Hi Try with statement.maxRows=10 On Thu, Jul 9, 2015 at 1:15 PM, fxthomas felix.tho...@gmail.com wrote: hello, I tried using the readSize option in the JDBC , but does not work. Is it that it won't work because I am using split with StreamList . I just want to get row By row from a DB , but i want only the first 10 rows. Currently it gets all the rows . Me code as below. from(timer://getData?period=2h).setBody(constant(from)).to(jdbc:DS?readSize=10outputType=StreamList).split(body()).process(new CustomProcessor(CustomConstants.DB)).to(to); regards, Felix T -- View this message in context: http://camel.465427.n5.nabble.com/readSize-option-JDBC-component-not-working-for-split-tp5769042.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: Oracle Procedure Calls with Camel
Thanks Jacek. your post is using Spring-jpa. we dont have any way to call stored procedures in camel-jdbc or camel-sql of latest release. Please confirm. regds, deekayzain -- View this message in context: http://camel.465427.n5.nabble.com/Oracle-Procedure-Calls-with-Camel-tp5745115p5769053.html Sent from the Camel - Users mailing list archive at Nabble.com.