Apache Tika support for Camel
Hi, I'm relatively new to Camel and while learning how to use it created a DataFormat extension using Apache Tika. With this you can unmarshal file formats supported by Apache Tika into Camel messages and filter on the document's contenttype etc. The unmarshalled text will be in the body of the message and any properties will be set in the header of the message. Example: from(something).unmarshal(tika).choice().when( header(tikacontenttype).isEqualTo(application/zip)).to( somewhere) .when(header(tikacontenttype).startsWith(text/plain)).to( someshereelse).otherwise().to(nowhere); The code although not finished can already be useful for some is here: https://github.com/wheijke/camel-tika Another project is Twitter4j support that I hope to finish soon. Enjoy, Wouter
Re: Apache Tika support for Camel
Hi Welcome to the community. We love contributions and if you consider donating your work to Apache, then we can have the data format included in the kit out of the box. http://camel.apache.org/contributing.html I have added your project to the Camel users stories https://cwiki.apache.org/confluence/display/CAMEL/User+Stories On Wed, Nov 24, 2010 at 9:46 AM, Wouter Heijke whei...@gmail.com wrote: Hi, I'm relatively new to Camel and while learning how to use it created a DataFormat extension using Apache Tika. With this you can unmarshal file formats supported by Apache Tika into Camel messages and filter on the document's contenttype etc. The unmarshalled text will be in the body of the message and any properties will be set in the header of the message. Example: from(something).unmarshal(tika).choice().when( header(tikacontenttype).isEqualTo(application/zip)).to( somewhere) .when(header(tikacontenttype).startsWith(text/plain)).to( someshereelse).otherwise().to(nowhere); The code although not finished can already be useful for some is here: https://github.com/wheijke/camel-tika Another project is Twitter4j support that I hope to finish soon. Enjoy, Wouter -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Testing a bean with @Resource
On Tue, Nov 23, 2010 at 4:19 PM, John john.fans...@ateb.com wrote: I'm using Camel 2.2. I have a bean used in a route that is annotated with a couple of @Resource objects that are injected via Spring. The bean also calls the producer template to forward requests to different routes. I've tried to add mocks to the @Resource objects in a spring configuration file that is referenced via @ContextConfiguration in my test class. This seems to work ok, but I really want to create the camel route interceptors to check on what the producer is doing in the bean. Is there a way to load @Resource classes from the spring configuration file if I switch to CamelSpringTestSupport using createApplicationContext? Have you tried switching to CamelSpringTestSupport? Thanks, -john -- View this message in context: http://camel.465427.n5.nabble.com/Testing-a-bean-with-Resource-tp3276944p3276944.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Is it possible to cluster camel endpoint?
Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there isn't an example there. I have tried to connect from one node of a cluster to another using camel's nmr component, but without success. An exception has occured. org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch exchange. No matching endpoints. at org.apache.servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java:110)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.dispatch(ChannelImpl.java:286)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.send(ChannelImpl.java:117)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.camel.nmr.ServiceMixProducer.process(ServiceMixProducer.java:86)[191:org.apache.servicemix.camel.component:4.3.0.fuse-01-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] Is it possible to use clustered endpoints in camel? Best Regards, Sergey
Re: Type converter
Claus and Tim, thanks a lot. Its working now. I had placed a full name of the class together with the package (just like log4j) before, so it didn't work.. Remi On 11/24/2010 06:14 AM, Claus Ibsen wrote: Hi See for example camel-mina which has custom type converters as well: https://svn.apache.org/repos/asf/camel/trunk/components/camel-mina/src/main/resources/META-INF/services/org/apache/camel/TypeConverter And camel-core have 3 packages listed https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/resources/META-INF/services/org/apache/camel/TypeConverter On 11/23/2010 06:12 PM, Tim wrote: 1. I think you mean META-INF 2. Also you don't have to include org.apache.activemq.camel.converter 3. You should have uk.org.llgc.camel in the TypeConverter file as that is your package not your class. If you jar tvf your compiled jar (type_converter.jar in your case) you should see something like: 39 Mon Nov 22 18:30:58 CST 2010 META-INF/services/org/apache/camel/TypeConverter Lastly turn on debug logging and you will see messages that camel found your Converter
Re: Is it possible to cluster camel endpoint?
Hi Can you post more details FUSE ESB version used JDK used OS used And the Camel route you are using. And you can try using the latest release: v4.3.0-fuse-02-00 On Wed, Nov 24, 2010 at 10:06 AM, sergey_zhemzhit...@troika.ru wrote: Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there isn't an example there. I have tried to connect from one node of a cluster to another using camel's nmr component, but without success. An exception has occured. org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch exchange. No matching endpoints. at org.apache.servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java:110)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.dispatch(ChannelImpl.java:286)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.send(ChannelImpl.java:117)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.camel.nmr.ServiceMixProducer.process(ServiceMixProducer.java:86)[191:org.apache.servicemix.camel.component:4.3.0.fuse-01-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] Is it possible to use clustered endpoints in camel? Best Regards, Sergey -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: camel-ftp via proxy
Your configuration looks good at first sight. Have you looked at http://wiki.apache.org/commons/Net/FrequentlyAskedQuestions (scroll down to Does FTPClient support FTP connections through an FTP proxy server?). Camel's FTP component uses the FTPClient included in Apache Commons Net under the hood. By the way, you need to subscribe to the Camel mailing list, signing up to Nabble isn't sufficient. Your message is currently only visible to Nabble users. -- View this message in context: http://camel.465427.n5.nabble.com/camel-ftp-via-proxy-tp3278292p3278312.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Multicast() Behaviour with Exceptions
Hi The issue has now been fixed on trunk. On Mon, Nov 22, 2010 at 2:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi Thanks for raising this issue. It looks like a bug in the multicast logic when having exceptions handled by onException as well. If you dont have the onException it should work. A workaround is to fix the UseLatestAggregationStrategy to ensure the exception is propagated as well. I have raised a ticket https://issues.apache.org/activemq/browse/CAMEL-3352 On Thu, Nov 18, 2010 at 6:15 AM, Mark Borner mark.bor...@zurich.com.auwrote: Hello all: Can someone help me with the behaviour of multicast() when exceptions are thrown? I've attached a unit test Spring context to outline my question. What I'm expecting is that all unit tests pass. What I'm experiencing is that unit test end1FailureTest doesn't pass. And I don't understand why. Why would the behaviour be different if the first endpoint of a multicast() throws an exception versus the second? I've executed the unit test under Camel 2.4 and 2.5 with the same results. Any help is appreciated! Mark Mark Borner Java Developer - ZStream Xpress This email is intended for the named recipient only. It may contain information which is confidential, commercially sensitive, or copyright. If you are not the intended recipient you must not reproduce or distribute any part of the email, disclose its contents, or take any action in reliance. If you have received this email in error, please contact the sender and delete the message. It is your responsibility to scan this email and any attachments for viruses and other defects. To the extent permitted by law, Zurich and its associates will not be liable for any loss or damage arising in any way from this communication including any file attachments. We may monitor email you send to us, either as a reply to this email or any email you send to us, to confirm our systems are protected and for compliance with company policies. Although we take reasonable precautions to protect the confidentiality of our email systems, we do not warrant the confidentiality or security of email or attachments we receive. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: DefaultShutdownStrategy can't shutdown DefaultErrorHandler's retries?
Hi I created a ticket https://issues.apache.org/activemq/browse/CAMEL-3364 On Tue, Nov 23, 2010 at 11:55 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Tue, Nov 23, 2010 at 2:42 AM, Lorrin Nelson lhn_git...@nerdylorrin.net wrote: The interaction between DefaultErrorHandler retries and DefaultShutdownStrategy seems broken. What I want: * long running infrequent retries. This seems like what DefaultErrorHandler is built for, thanks to it's exponential back-off feature * shutdown as soon as no retry is in-flight Instead, I get: * DefaultShutdownStrategy wants to wait until all future retries have been attempted! I've configured this to be days! But at least there's a timeout on the DefaultShutdownStrategy, so after a while of waiting around (while no retries are actually occurring), it proceeds. * DefaultShutdownStrategry logs Timeout occurred. Now forcing the routes to be shutdown now., but actually does nothing. The route keeps retrying and Tomcat still can't shutdown. Is this broken or have I misconfigured somehow? This is the intended behavior. Its generally not a good idea to have redelivery lasting for days. The exchange then has to be stored in memory until it has to do redelivery the next day. Its generally better to try for a limited period, and then fail if still a problem. We could introduce some option to instruct the error handler to stop attempt redeliveries if a shutdown has been commenced and then indicate those exchanges failed by setting an exception on that. Fell free to create a JIRA for such an enhancement. -Lorrin -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Retrieving the exchange's processing time in onCompletion
I'm implementing a message history store. As suggested in Camel in Action, I plan to use the onCompletion interceptor to extract the information I need from the exchange and store it in a database. I would like to store the processing time of the exchange. I've seen that information in the JMX interface where the min, max and mean processing time is available. However, I can't see that information on the exchange (which is what is available in the onCompletion callback). Can I get the processing time from somewhere else? /Bengt
Re: Is it possible to cluster camel endpoint?
Hi I have attached sample application (SMX-CLUSTER.zip) and configuration of activemq in ServiceMix (SMX-CONFIG.zip) for clustering: To install the application please execute mvn install from command line. It is necessary to have two instances of ServiceMix for the cluster (configurations for activemq are in SMX-CONFIG.zip). Start both ServiceMix nodes and execute the following command in the console of the first one: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.subscriber Execute the following commands in the console of the second node: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.publisher I have expected that messages which were sent from the first node would reach the second node. I'm using: Fuse ESB: 4.3.0-fuse-01-00 JDK: 1.6.0_21-b07 (Sun) OS: Win XP Pro SP3 Regards, Sergey Claus Ibsen claus.ib...@gmail.com 24.11.2010 14:52 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi Can you post more details FUSE ESB version used JDK used OS used And the Camel route you are using. And you can try using the latest release: v4.3.0-fuse-02-00 On Wed, Nov 24, 2010 at 10:06 AM, sergey_zhemzhit...@troika.ru wrote: Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there isn't an example there. I have tried to connect from one node of a cluster to another using camel's nmr component, but without success. An exception has occured. org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch exchange. No matching endpoints. at org.apache.servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java:110)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.dispatch(ChannelImpl.java:286)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.nmr.core.ChannelImpl.send(ChannelImpl.java:117)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at org.apache.servicemix.camel.nmr.ServiceMixProducer.process(ServiceMixProducer.java:86)[191:org.apache.servicemix.camel.component:4.3.0.fuse-01-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:62)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[92:org.apache.camel.camel-core:2.4.0.fuse-00-00] Is it possible to use clustered endpoints in camel? Best Regards, Sergey -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Is it possible to cluster camel endpoint?
Well, it seems that my attachments have been dropped. Here are camel routes: route for cluster node 1: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.publisher xmlns= http://camel.apache.org/schema/spring; route id=publishRoute from uri=timer://events?fixedRate=trueamp;period=1000/ transform constantHello World!!!/constant /transform multicast to uri=log://smx.cluster.publisher?level=INFO/ to uri=nmr://smx.cluster/ /multicast /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean /beans route for cluster node 2: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.subscriber xmlns= http://camel.apache.org/schema/spring; route id=receiveRoute from uri=nmr://smx.cluster / to uri=log://smx.cluster.subscriber?level=INFO/ /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean bean class=org.apache.servicemix.common.osgi.EndpointExporter / /beans It is important to note that routes are not deployed are service units for servicemix-camel jbi component. Regards, Sergey sergey_zhemzhit...@troika.ru 24.11.2010 18:55 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi I have attached sample application (SMX-CLUSTER.zip) and configuration of activemq in ServiceMix (SMX-CONFIG.zip) for clustering: To install the application please execute mvn install from command line. It is necessary to have two instances of ServiceMix for the cluster (configurations for activemq are in SMX-CONFIG.zip). Start both ServiceMix nodes and execute the following command in the console of the first one: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.subscriber Execute the following commands in the console of the second node: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.publisher I have expected that messages which were sent from the first node would reach the second node. I'm using: Fuse ESB: 4.3.0-fuse-01-00 JDK: 1.6.0_21-b07 (Sun) OS: Win XP Pro SP3 Regards, Sergey Claus Ibsen claus.ib...@gmail.com 24.11.2010 14:52 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi Can you post more details FUSE ESB version used JDK used OS used And the Camel route you are using. And you can try using the latest release: v4.3.0-fuse-02-00 On Wed, Nov 24, 2010 at 10:06 AM, sergey_zhemzhit...@troika.ru wrote: Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there isn't an example there. I have tried to connect from one node of a cluster to another using camel's nmr component, but without success. An exception has occured. org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch exchange. No matching endpoints. at org.apache.servicemix.nmr.core.FlowRegistryImpl.dispatch(FlowRegistryImpl.java:110)[58:org.apache.servicemix.nmr.core:1.3.0.fuse-00-00] at
Re: Retrieving the exchange's processing time in onCompletion
On Wed, Nov 24, 2010 at 4:41 PM, Bengt Rodehav be...@rodehav.com wrote: I'm implementing a message history store. As suggested in Camel in Action, I plan to use the onCompletion interceptor to extract the information I need from the exchange and store it in a database. I would like to store the processing time of the exchange. I've seen that information in the JMX interface where the min, max and mean processing time is available. However, I can't see that information on the exchange (which is what is available in the onCompletion callback). Can I get the processing time from somewhere else? You can grab that data using regular JMX API (yes its a bit painful). We do have a ticket to add a property on the Exchange with the timestamp when it was created. Then in the future you can use that to compute the processing time. However for all the stats like mean/min/max etc. those are in JMX on the ManagedRoute mbean. We should most likely offer an easy to use API to access those mbeans without the pain of the JMX API. There is a ticket in JIRA to offer REST based API for statistics. That work is scheduled for Camel 3.x. /Bengt -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: Is it possible to cluster camel endpoint?
Hi Are you using JBI or not? The last statement was kinda confusing how I read it. If you use JBI I suggest to use jbi to pass messages between applications. On Wed, Nov 24, 2010 at 5:01 PM, sergey_zhemzhit...@troika.ru wrote: Well, it seems that my attachments have been dropped. Here are camel routes: route for cluster node 1: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.publisher xmlns= http://camel.apache.org/schema/spring; route id=publishRoute from uri=timer://events?fixedRate=trueamp;period=1000/ transform constantHello World!!!/constant /transform multicast to uri=log://smx.cluster.publisher?level=INFO/ to uri=nmr://smx.cluster/ /multicast /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean /beans route for cluster node 2: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.subscriber xmlns= http://camel.apache.org/schema/spring; route id=receiveRoute from uri=nmr://smx.cluster / to uri=log://smx.cluster.subscriber?level=INFO/ /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean bean class=org.apache.servicemix.common.osgi.EndpointExporter / /beans It is important to note that routes are not deployed are service units for servicemix-camel jbi component. Regards, Sergey sergey_zhemzhit...@troika.ru 24.11.2010 18:55 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi I have attached sample application (SMX-CLUSTER.zip) and configuration of activemq in ServiceMix (SMX-CONFIG.zip) for clustering: To install the application please execute mvn install from command line. It is necessary to have two instances of ServiceMix for the cluster (configurations for activemq are in SMX-CONFIG.zip). Start both ServiceMix nodes and execute the following command in the console of the first one: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.subscriber Execute the following commands in the console of the second node: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.publisher I have expected that messages which were sent from the first node would reach the second node. I'm using: Fuse ESB: 4.3.0-fuse-01-00 JDK: 1.6.0_21-b07 (Sun) OS: Win XP Pro SP3 Regards, Sergey Claus Ibsen claus.ib...@gmail.com 24.11.2010 14:52 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi Can you post more details FUSE ESB version used JDK used OS used And the Camel route you are using. And you can try using the latest release: v4.3.0-fuse-02-00 On Wed, Nov 24, 2010 at 10:06 AM, sergey_zhemzhit...@troika.ru wrote: Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there isn't an example there. I have tried to connect from one node of a cluster to another using camel's nmr component, but without success. An exception has occured. org.apache.servicemix.nmr.api.ServiceMixException: Could not dispatch exchange. No matching
JAXB causing Unit Test Failure without any actual marshalling active
Hi. We are planning to plug JAXB marshalling into our Camel routes. To start with I annotated DTOs for JAXB and create a schema for .NET clients. Next was to get Camel involved. However, simply adding the Maven dependency is causing the unit tests to throw execptions as below. Again - marshal/unmarshal (or in fact anything camel-jaxb besides the maven dependency) has not been added yet and the test runs fine without the camel-jaxb in the pom. It looks like Camel is autonomously deciding to marshal stuff once it recognizes JAXB annotations on payloads. Any idea? Thanks! dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version${apache.camel.version}/version (it's 2.4.0) /dependency 2010-11-24 12:40:06,647 | DEBUG | org.apache.camel.processor.SendProcessor | oInAsyncProducer | esb_status_topic | Endpoint[bean://statusListener?method=notify] Exchange[Message: EsbMessage[id=7f053c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] 2010-11-24 12:40:06,647 | DEBUG | ache.camel.processor.DefaultErrorHandler | log | esb_status_topic | Failed delivery for exchangeId: 3ac16771-4cac-43ea-9e98-3f9703e351b4. On delivery attempt: 0 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f053c56-f938-460 b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] 2010-11-24 12:40:06,647 | ERROR | ache.camel.processor.DefaultErrorHandler | log | esb_status_topic | Failed delivery for exchangeId: 3ac16771-4cac-43ea-9e98-3f9703e351b4. Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f05 3c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f053c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1142) at org.apache.camel.converter.jaxb.FallbackTypeConverter.convertTo(FallbackTypeConverter.java:93) at org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:176) at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:74) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:48) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:107) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:95) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:65) at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) -- View this message in context: http://camel.465427.n5.nabble.com/JAXB-causing-Unit-Test-Failure-without-any-actual-marshalling-active-tp3278807p3278807.html Sent from the Camel - Users mailing list archive at Nabble.com.
hibernate and spring with camel
I am looking to persist some data I receive in my processor to a database using Spring and Hibernate. Does anyone have experience setting this up and maybe providing some tips on how to do it? Right now I have everything defined as spring beans in an XML file that is imported from activemq.xml. Problem is that if this file is referenced from activemq.xml, how can I build a BeanFactory in order to get at some of the beans, which in my case are DAO classes. Thanks, Mark
Re: JAXB causing Unit Test Failure without any actual marshalling active
Looks like you didn't post the entire stacktrace (the first part is missing?). Can you post the entire stacktrace? Also can you post your route definition? -- View this message in context: http://camel.465427.n5.nabble.com/JAXB-causing-Unit-Test-Failure-without-any-actual-marshalling-active-tp3278807p3279000.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: hibernate and spring with camel
Is the XML file just a regular Spring XML file? I would assume you just do this as you would do using spring. On Wed, Nov 24, 2010 at 7:56 PM, Mark Webb elihusma...@gmail.com wrote: I am looking to persist some data I receive in my processor to a database using Spring and Hibernate. Does anyone have experience setting this up and maybe providing some tips on how to do it? Right now I have everything defined as spring beans in an XML file that is imported from activemq.xml. Problem is that if this file is referenced from activemq.xml, how can I build a BeanFactory in order to get at some of the beans, which in my case are DAO classes. Thanks, Mark -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: hibernate and spring with camel
Agree, but since ActiveMQ is importing the file from activemq.xml, I can never be sure of its location. On Wed, Nov 24, 2010 at 3:20 PM, Claus Ibsen claus.ib...@gmail.com wrote: Is the XML file just a regular Spring XML file? I would assume you just do this as you would do using spring. On Wed, Nov 24, 2010 at 7:56 PM, Mark Webb elihusma...@gmail.com wrote: I am looking to persist some data I receive in my processor to a database using Spring and Hibernate. Does anyone have experience setting this up and maybe providing some tips on how to do it? Right now I have everything defined as spring beans in an XML file that is imported from activemq.xml. Problem is that if this file is referenced from activemq.xml, how can I build a BeanFactory in order to get at some of the beans, which in my case are DAO classes. Thanks, Mark -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
Re: camel-ftp via proxy
Thanks Richard for your warning -- View this message in context: http://camel.465427.n5.nabble.com/camel-ftp-via-proxy-tp3278292p3279149.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JAXB causing Unit Test Failure without any actual marshalling active
Thanks for following up. In the meantime I have moved on and created a custom Processor chained into the route, which provides more flexibility for other processing. The rest of the stack trace just went further into the jaxb RI and didn't seem to provide additional clues why Camel is picking this up. The routes are simple from(bean).to(jms) and reverse. My theory is still that some Camel component is latching on to JAXB annotated payload without explicit configuration but we are too time constrained to dig into it. -- View this message in context: http://camel.465427.n5.nabble.com/JAXB-causing-Unit-Test-Failure-without-any-actual-marshalling-active-tp3278807p3279154.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JAXB causing Unit Test Failure without any actual marshalling active
Camel Jaxb has a FallbackTypeConverter which will check if the message body object class has the XmlRootElement annotation , then it decide to do the marshal/ unmarshal job or not. In this case , you don't need to specify data format or use the marshal/unmarshal DSL. If camel can't convert the object with the common converter, the fall back type converter will be use. So my question is what's the message body object are you using for routing. On 11/25/10 2:01 AM, enalposi wrote: Hi. We are planning to plug JAXB marshalling into our Camel routes. To start with I annotated DTOs for JAXB and create a schema for .NET clients. Next was to get Camel involved. However, simply adding the Maven dependency is causing the unit tests to throw execptions as below. Again - marshal/unmarshal (or in fact anything camel-jaxb besides the maven dependency) has not been added yet and the test runs fine without the camel-jaxb in the pom. It looks like Camel is autonomously deciding to marshal stuff once it recognizes JAXB annotations on payloads. Any idea? Thanks! dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version${apache.camel.version}/version (it's 2.4.0) /dependency 2010-11-24 12:40:06,647 | DEBUG | org.apache.camel.processor.SendProcessor | oInAsyncProducer | esb_status_topic | Endpoint[bean://statusListener?method=notify] Exchange[Message: EsbMessage[id=7f053c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] 2010-11-24 12:40:06,647 | DEBUG | ache.camel.processor.DefaultErrorHandler | log | esb_status_topic | Failed delivery for exchangeId: 3ac16771-4cac-43ea-9e98-3f9703e351b4. On delivery attempt: 0 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f053c56-f938-460 b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] 2010-11-24 12:40:06,647 | ERROR | ache.camel.processor.DefaultErrorHandler | log | esb_status_topic | Failed delivery for exchangeId: 3ac16771-4cac-43ea-9e98-3f9703e351b4. Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f05 3c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[Message: EsbMessage[id=7f053c56-f938-460b-b4d3-65e27764a32b,service=test_service,type=vm:esb_status_topic,version=1,timestamp=2010-11-24T12:40:06-0500,origin=10.0.2.15,payload=Status]] at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1142) at org.apache.camel.converter.jaxb.FallbackTypeConverter.convertTo(FallbackTypeConverter.java:93) at org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:176) at org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:74) at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:48) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:107) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:95) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:65) at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) -- Willem -- FuseSource Web: http://www.fusesource.com Blog:http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang
Re: Is it possible to cluster camel endpoint?
Hi there I'm not using JBI. Each route is deployed as OSGi bundle. Claus Ibsen claus.ib...@gmail.com 24.11.2010 20:15 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi Are you using JBI or not? The last statement was kinda confusing how I read it. If you use JBI I suggest to use jbi to pass messages between applications. On Wed, Nov 24, 2010 at 5:01 PM, sergey_zhemzhit...@troika.ru wrote: Well, it seems that my attachments have been dropped. Here are camel routes: route for cluster node 1: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.publisher xmlns= http://camel.apache.org/schema/spring; route id=publishRoute from uri=timer://events?fixedRate=trueamp;period=1000/ transform constantHello World!!!/constant /transform multicast to uri=log://smx.cluster.publisher?level=INFO/ to uri=nmr://smx.cluster/ /multicast /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean /beans route for cluster node 2: ?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:osgi=http://www.springframework.org/schema/osgi; xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd; camelContext id=smx.cluster.subscriber xmlns= http://camel.apache.org/schema/spring; route id=receiveRoute from uri=nmr://smx.cluster / to uri=log://smx.cluster.subscriber?level=INFO/ /route /camelContext bean id=nmr class=org.apache.servicemix.camel.nmr.ServiceMixComponent property name=nmr osgi:reference interface=org.apache.servicemix.nmr.api.NMR/ /property /bean bean class=org.apache.servicemix.common.osgi.EndpointExporter / /beans It is important to note that routes are not deployed are service units for servicemix-camel jbi component. Regards, Sergey sergey_zhemzhit...@troika.ru 24.11.2010 18:55 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi I have attached sample application (SMX-CLUSTER.zip) and configuration of activemq in ServiceMix (SMX-CONFIG.zip) for clustering: To install the application please execute mvn install from command line. It is necessary to have two instances of ServiceMix for the cluster (configurations for activemq are in SMX-CONFIG.zip). Start both ServiceMix nodes and execute the following command in the console of the first one: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.subscriber Execute the following commands in the console of the second node: features:addUrl mvn:org.sample.smx.cluster/smx.cluster.features/1.0.0-SNAPSHOT/xml features:refreshUrl features:install org.sample.smx.publisher I have expected that messages which were sent from the first node would reach the second node. I'm using: Fuse ESB: 4.3.0-fuse-01-00 JDK: 1.6.0_21-b07 (Sun) OS: Win XP Pro SP3 Regards, Sergey Claus Ibsen claus.ib...@gmail.com 24.11.2010 14:52 Please respond to users@camel.apache.org To users@camel.apache.org cc Subject Re: Is it possible to cluster camel endpoint? Hi Can you post more details FUSE ESB version used JDK used OS used And the Camel route you are using. And you can try using the latest release: v4.3.0-fuse-02-00 On Wed, Nov 24, 2010 at 10:06 AM, sergey_zhemzhit...@troika.ru wrote: Hello all. I'm trying to use camel on the ServiceMix 4 cluster. According to http://camel.apache.org/clustering-and-loadbalancing.html we can use NMR endpoint but there