Re: Are sources not published for snapshot builds by design?
On Wed, Nov 25, 2009 at 1:53 PM, Jon Anstey wrote: > So I enabled javadoc too yesterday, which does take a long time to > generate... The build should now only be deploying source jars. > Ah it appears as it only generates one big -src.zip file https://repository.apache.org/content/repositories/snapshots/org/apache/camel/apache-camel/2.1-SNAPSHOT/ I think it should generate -sources.jar for each of the bundles. Then its easy for others to debug and learn Camel. https://repository.apache.org/content/repositories/snapshots/org/apache/camel/camel-core/2.1-SNAPSHOT/ So is it possible to generate -sources.jar for all the fine grained .jars instead? > On Tue, Nov 24, 2009 at 9:19 PM, Jon Anstey wrote: > >> Oh, and it *shouldn't* add too much to the build time... famous last words >> ;) >> >> >> On Tue, Nov 24, 2009 at 9:19 PM, Jon Anstey wrote: >> >>> Hey guys, >>> >>> I just updated Hudson to deploy source jars and kicked off a new build. >>> Lemme know if it doesn't work. >>> >>> >>> On Tue, Nov 24, 2009 at 4:40 PM, Claus Ibsen wrote: >>> On Tue, Nov 24, 2009 at 8:05 PM, Barry Kaplan wrote: > > Its a bit painful to have to generate and install the source jars everyday. > Would it be possible to publish them to the repository? Its Apache Hudson doing the builds and deploys. http://hudson.zones.apache.org/hudson/ I dont know if that is possible to do as it takes longer time then and its a general server for many of the other Apache projects. Try to get in touch with Gert V. he knows more about this server and what it can do. > -- > View this message in context: http://old.nabble.com/Are-sources-not-published-for-snapshot-builds-by-design--tp26499928p26499928.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus >>> >>> >>> >>> -- >>> Cheers, >>> Jon >>> >>> Camel in Action: http://manning.com/ibsen >>> Blog: http://janstey.blogspot.com >>> >> >> >> >> -- >> Cheers, >> Jon >> >> Camel in Action: http://manning.com/ibsen >> Blog: http://janstey.blogspot.com >> > > > > -- > Cheers, > Jon > > Camel in Action: http://manning.com/ibsen > Blog: http://janstey.blogspot.com > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Lifecycle of a Camel Component
Thanks very much for your answers, I also found an excellent programming guide at the FUSEsource site. That helped a lot as well. I understand what you wrote below, but it raises some concerns in my mind with the reliability of Camel when dealing with unreliable external entities. I'm guessing that just stems from a lack of understanding on my part. If it helps, I come from an EDI background where systems are designed to gaurantee delivery of millions of messages a day to thousands of different endpoints. I'll try and illustrate my concern. I have two routes, the input, from a custom component, is a graphic image that is analyized (which can take 30-90 seconds) and them placed on a queue. The second route takes items off the queue and emails them to a destination AND puts the modified image back on the server. Something like: from("mycomp:host") .to(new MyImageProcessor()) .to("amq:input_queue"); from("amq:"input_queue") multicast().to("smtp:t...@test.com", "mycomp:host"); Here what I need to account for: 1. Most importantly, I cannot lose any messages. So let's say that a message is taken off the queue and passed to the smtp component, but the mail server is not up, so it throws an exception. - What happens to the message? Does it get placed back on the queue? Is there a concept of transactions around routes so that only after BOTH endpoints confirm a sucessful delivery does the message get removed from the queue? - What if the smtp server sucessfully delivers and "mycomp" throws an exception? I am aware of the exceptionHandler() idea, but it seems exceptionHandlers are placed on a RouteCollection, not a single route. Each instance of RouteBuilder could have one route in it. But that creates a lot of extra classes. 2. After ensuring that i did not lose the message pending at the smtp component, I need to shut down the routes since the smtp service is dead (for the moment). This would seem to be a job for exceptionHandler(), however that handler would need to know which object threw the exception (in this case the smtp Producer) and what route it belongs to. then, it would need to scan all other route that use the same endpoint, and stop them too. I see no way of doing this from within the handler, since it is not notified which Producer threw the exception. Also, I see no way of consistently getting from a Producer to it's owner endpoint. - How do you gracefully and without data loss bring down a route? - Does bringing down a route destroy the consumer/producer objects? or just stop() them? 3. Assuming I could figure out which routes to shut down. I can execute route.stop(). But what happens to messages that are "in process" take for example a message from mycomp that is currently being analyzed, when the analyzer finishes (say 20-30 seconds after the route.stop() was called: - Is the queue Producer still available? - Will route.stop() block until all parts of the route are shut down? - Will route.stop() stop ONLY the consumer that is part of it's route, or the entire route? - Really, I would not need to bring down the route, just stop() the consumer at the beginning. Do the Producers/Consumers/Endpoint have any knowledge about the route they are on? Or can they get it some how? - Can a Consumer/Producer be shared amongst several routes? It could be that I have the wrong idea of what Camel is meant to do. All of the examples I've seen deal with short routes from some system to some other system where it seems the assumption is made that everything is up all the time. That is the nature of examples. When dealing with Enterprise Integrations (well at least the integration I deal with), the biggest issue is always data integrity during connection failures. It could be that all this transactional nature and data integrity is in Camel, I just don't see it. It is also a valid answer to say that I need to "roll my own" system, but that lessens the usefulness of Camel as an "Enterprise" tool. BTW, if we can figure all this out with Camel, then I'll be happy to add an example to the collection that shows how to setup message "integrity". -p Claus Ibsen-2 wrote: > > Hi > > A lot of questions. Let me give a start and try answering a couple of > those. > > > > On Thu, Nov 26, 2009 at 1:42 AM, Pete Mueller wrote: >> >> Does any one have any documentation on the lifecycle of a camel component >> and >> it's associated entities (Endpoint, >> Consumer, Producer). I am attempting to write a component for a >> event-driving wireline protocol. I understand the basics of: >> 0. Component is created. >> 1. URI in DSL gets passed to to component. >> 2. Component creates Endpoint for each unique URI (if using a singleton) >> 3. Endpoint creates Consumers and Producers. >> >> But I'm looking for a little more detail as to what triggers the creation >> and removal of say Consumers. Specifically, >> - Is a single Consumer around for the life of the CamelContext? > > Cons
Re: TransformerException: Source object passed to ''{0}'' has no contents.
I have been able to resolve this. Just convert the soap to a streamsource and that shld do. See code below lekkie wrote: > > I am trying to send a soap request from a JMS queue to service engine (JBI > in OSGI) and I encountered the ffg errors: > > 23:49:22,484 | ERROR | Service-thread-1 | NMRDestination > | nmr.core.InternalEndpointWrapper 86 | error preparing message > javax.xml.transform.TransformerException: > javax.xml.transform.TransformerException: Source object passed to ''{0}'' > has no contents. > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:756) > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:349) > at > org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51) > at > org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113) > at > org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86) > at > org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255) > at > org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) > at java.lang.Thread.run(Thread.java:595) > Caused by: javax.xml.transform.TransformerException: Source object passed > to ''{0}'' has no contents. > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:704) > at > com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:744) > ... 9 more > 23:49:22,484 | WARN | Service-thread-1 | NMR > | .servicemix.nmr.core.ChannelImpl 293 | Error processing exchange [ > id:92aaefb2-525d-4297-ab09-b0145b5cc8d0 > mep: InOnly > status:Active > role: Provider > target:PropertyMatchingReference[{NAME=nauCollegeService}] > In: [ > content: > http://services.colleges.com";> > 91283123 > 20082734 > dgf322343 > asdasd asds > 900 > sdfsdfd > sdfdsf > asdsdfs > safsdfd > asfdsad > asdasd > asdas > > properties: [ > operationName = > ] > ] > ] > > > Here is the content of my soap message: > > > http://services.colleges.com";> >91283123 >20082734 >dgf322343 >asdasd asds >900 >sdfsdfd >sdfdsf >asdsdfs >safsdfd >asfdsad >asdasd >asdas > > > > Here is my camelContext xml: > > http://camel.apache.org/schema/spring";> > > > > > > > Am I missing something? Do I have to transform the message? > -- View this message in context: http://old.nabble.com/TransformerException%3A-Source-object-passed-to-%27%27%7B0%7D%27%27-has-no-contents.-tp26504770p26532642.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using Guice with Camel
So to make things simple, let's base it on the existing Guice/Camel example. So in SomeBean.java, let's say I want to include an injected component and add: public class SomeBean { @Inject private OtherBean ob; public void someMethod(String body) { System.out.println("Received: " + body); System.out.println("OtherBean: " + ob); } Define OtherBean as you wish. I'd expect(hope) without any other configuration that I'd get a non-null result for OtherBean, just using default binding values. It seems that it should be able to autowire (or whatever the Guicey version of that term is) ob. But though the configuration seems to be done via Guice, I don't think once "inside the routing context" that Guice is used to build/instantiate the bean from: from("file://target/routeOutput?noop=true"). bean(new SomeBean()); I can see that it seems to have been created by new and not via Guice. What I'm wondering is if there is some way that I can tell it to grab a via built up via Guice instead of passing a specific instance. Does that make sense? As I mentioned, I'm still new with both Guice and Camel, so I could be way off the mark here. --Tim willem.jiang wrote: > > What kind of Object you want to inject into the bean component? > Did you add that bind in your module ? > > Please let me have a look at your module class. > > Willem > > mumbly wrote: >> I've been taking a look at using Camel with Guice for DI, but I'm having >> a >> little trouble understanding exactly what the integration provides. I've >> got >> the configuration aspect and that seems to work fine. But it is unclear >> to >> me if/how to work with Guice enhanced components. Specifically, if I am >> using a bean component which uses @Inject, it doesn't appear that the >> bean >> is being pulled from the Guice context (in other words, the other >> components >> aren't being injected). >> >> I'm new to both Camel and Guice, so I could be missing something obvious >> here or there may be another pattern for DI using Guice with Camel that I >> missed. So I guess my basic question is does the Camel/Guice integration >> provide the ability to inject components within the routing chain? with >> the >> bean component? >> >> I see in the Guice example included in the dist, but it only seems to >> deal >> with using Guice for configuration of the routes. >> >> --Tim > > > -- View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26532640.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using Guice with Camel
That would be great. Expanding the example a bit to include some injected components would be nice, assuming that is possible (or making it possible if not). --Tim Claus Ibsen-2 wrote: > > Hi > > I think James Strachan can shed lights on the camel-guice as he build it. > I am sure there are some features missing in this component so we can > use help to improve it. > > > On Wed, Nov 25, 2009 at 6:50 PM, mumbly wrote: >> >> I've been taking a look at using Camel with Guice for DI, but I'm having >> a >> little trouble understanding exactly what the integration provides. I've >> got >> the configuration aspect and that seems to work fine. But it is unclear >> to >> me if/how to work with Guice enhanced components. Specifically, if I am >> using a bean component which uses @Inject, it doesn't appear that the >> bean >> is being pulled from the Guice context (in other words, the other >> components >> aren't being injected). >> >> I'm new to both Camel and Guice, so I could be missing something obvious >> here or there may be another pattern for DI using Guice with Camel that I >> missed. So I guess my basic question is does the Camel/Guice integration >> provide the ability to inject components within the routing chain? with >> the >> bean component? >> >> I see in the Guice example included in the dist, but it only seems to >> deal >> with using Guice for configuration of the routes. >> >> --Tim >> -- >> View this message in context: >> http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26517323.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > > -- View this message in context: http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26532525.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
Charles, Kevin.Zhang wrote: > > I found some info here http://issues.apache.org/activemq/browse/SMX4-389 . > Is it the same issue I got here? > > And is it possible for me to start the features manually? > > > Kevin.Zhang wrote: >> >> >> In the file etc\org.apache.felix.karaf.features.cfg, if I set >> featuresRepositories to >> >> featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features >> >> I can use the "features:list" command. >> >> But if I set it to >> >> featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features,mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features,jar:mvn:org.apache.camel.example/reportincident.features/1.0-SNAPSHOT!/reportincident.features-1.0-SNAPSHOT-features.xml >> >> I can not even use the "feateures:list" command. >> >> >> >> Thanks >> Kevin >> >> >> >> >> >> C:\temp\tutorial-osgi-camel-part2\reportincident.features\target>dir >> "\Documents and >> Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.fea >> tures\1.0-SNAPSHOT\" >> Volume in drive C has no label. >> Volume Serial Number is D051-6A60 >> >> Directory of C:\Documents and >> Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.features\1.0-SNAPSHOT >> >> 11/25/2009 07:21 AM . >> 11/25/2009 07:21 AM .. >> 11/25/2009 09:20 AM 333 maven-metadata-local.xml >> 11/25/2009 09:20 AM 3,822 >> reportincident.features-1.0-SNAPSHOT.jar >> 11/25/2009 09:20 AM 1,777 >> reportincident.features-1.0-SNAPSHOT.pom >> >> Kevin.Zhang wrote: >>> >>> forgot to mention that the carriage return is the copy-paste error. >>> >>> >>> Kevin.Zhang wrote: I can use Maven mvn command from the command line so I guess maven might be fine. Otherwise I would not be able to build the incident reports. Any other suggestions? cmoulliard wrote: > > Do you have maven issue to connect to resources on the web because I > see this error in the log that you provide me : > > mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could > not be > resolved > > ? > > It seems also that they are carriage return in your etc/feature file > config > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > * > blog : http://cmoulliard.blogspot.com > twitter : http://twitter.com/cmoulliard > Linkedlin : http://www.linkedin.com/in/charlesmoulliard > > Apache Camel Group : > http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm > > > > >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/tutorial-osgi-camel-part2deployment-problem-tp26531488p26532425.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
Found some info here http://issues.apache.org/activemq/browse/SMX4-389 . Seems that it's a known issue. Kevin.Zhang wrote: > > Charles, > > In the file etc\org.apache.felix.karaf.features.cfg, if I set > featuresRepositories to > > featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features > > I can use the "features:list" command. > > But if I set it to > > featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features,mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features,jar:mvn:org.apache.camel.example/reportincident.features/1.0-SNAPSHOT!/reportincident.features-1.0-SNAPSHOT-features.xml > > I can not even use the "feateures:list" command. > > Am I using the right format to separate the repositories? > > Thanks > Kevin > > > > > > C:\temp\tutorial-osgi-camel-part2\reportincident.features\target>dir > "\Documents and > Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.fea > tures\1.0-SNAPSHOT\" > Volume in drive C has no label. > Volume Serial Number is D051-6A60 > > Directory of C:\Documents and > Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.features\1.0-SNAPSHOT > > 11/25/2009 07:21 AM . > 11/25/2009 07:21 AM .. > 11/25/2009 09:20 AM 333 maven-metadata-local.xml > 11/25/2009 09:20 AM 3,822 > reportincident.features-1.0-SNAPSHOT.jar > 11/25/2009 09:20 AM 1,777 > reportincident.features-1.0-SNAPSHOT.pom > > Kevin.Zhang wrote: >> >> forgot to mention that the carriage return is the copy-paste error. >> >> >> Kevin.Zhang wrote: >>> >>> I can use Maven mvn command from the command line so I guess maven might >>> be fine. Otherwise I would not be able to build the incident reports. >>> >>> Any other suggestions? >>> >>> >>> cmoulliard wrote: Do you have maven issue to connect to resources on the web because I see this error in the log that you provide me : mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could not be resolved ? It seems also that they are carriage return in your etc/feature file config Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/tutorial-osgi-camel-part2deployment-problem-tp26531488p26532253.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
Charles, In the file etc\org.apache.felix.karaf.features.cfg, if I set featuresRepositories to featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features I can use the "features:list" command. But if I set it to featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.0.0/xml/features,mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features,jar:mvn:org.apache.camel.example/reportincident.features/1.0-SNAPSHOT!/reportincident.features-1.0-SNAPSHOT-features.xml I can not even use the "feateures:list" command. Am I using the right format to separate the repositories? Thanks Kevin C:\temp\tutorial-osgi-camel-part2\reportincident.features\target>dir "\Documents and Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.fea tures\1.0-SNAPSHOT\" Volume in drive C has no label. Volume Serial Number is D051-6A60 Directory of C:\Documents and Settings\chzhang\.m2\repository\org\apache\camel\example\reportincident.features\1.0-SNAPSHOT 11/25/2009 07:21 AM . 11/25/2009 07:21 AM .. 11/25/2009 09:20 AM 333 maven-metadata-local.xml 11/25/2009 09:20 AM 3,822 reportincident.features-1.0-SNAPSHOT.jar 11/25/2009 09:20 AM 1,777 reportincident.features-1.0-SNAPSHOT.pom Kevin.Zhang wrote: > > forgot to mention that the carriage return is the copy-paste error. > > > Kevin.Zhang wrote: >> >> I can use Maven mvn command from the command line so I guess maven might >> be fine. Otherwise I would not be able to build the incident reports. >> >> Any other suggestions? >> >> >> cmoulliard wrote: >>> >>> Do you have maven issue to connect to resources on the web because I >>> see this error in the log that you provide me : >>> >>> mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could not >>> be >>> resolved >>> >>> ? >>> >>> It seems also that they are carriage return in your etc/feature file >>> config >>> >>> Regards, >>> >>> Charles Moulliard >>> Senior Enterprise Architect >>> Apache Camel Committer >>> >>> * >>> blog : http://cmoulliard.blogspot.com >>> twitter : http://twitter.com/cmoulliard >>> Linkedlin : http://www.linkedin.com/in/charlesmoulliard >>> >>> Apache Camel Group : >>> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm >>> >>> >>> >>> >> >> > > -- View this message in context: http://old.nabble.com/tutorial-osgi-camel-part2deployment-problem-tp26531488p26532142.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
forgot to mention that the carriage return is the copy-paste error. Kevin.Zhang wrote: > > I can use Maven mvn command from the command line so I guess maven might > be fine. Otherwise I would not be able to build the incident reports. > > Any other suggestions? > > > cmoulliard wrote: >> >> Do you have maven issue to connect to resources on the web because I >> see this error in the log that you provide me : >> >> mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could not >> be >> resolved >> >> ? >> >> It seems also that they are carriage return in your etc/feature file >> config >> >> Regards, >> >> Charles Moulliard >> Senior Enterprise Architect >> Apache Camel Committer >> >> * >> blog : http://cmoulliard.blogspot.com >> twitter : http://twitter.com/cmoulliard >> Linkedlin : http://www.linkedin.com/in/charlesmoulliard >> >> Apache Camel Group : >> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm >> >> >> >> > > -- View this message in context: http://old.nabble.com/tutorial-osgi-camel-part2deployment-problem-tp26531488p26531848.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
I can use Maven mvn command from the command line so I guess maven might be fine. Otherwise I would not be able to build the incident reports. Any other suggestions? cmoulliard wrote: > > Do you have maven issue to connect to resources on the web because I > see this error in the log that you provide me : > > mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could not > be > resolved > > ? > > It seems also that they are carriage return in your etc/feature file > config > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > * > blog : http://cmoulliard.blogspot.com > twitter : http://twitter.com/cmoulliard > Linkedlin : http://www.linkedin.com/in/charlesmoulliard > > Apache Camel Group : > http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm > > > > -- View this message in context: http://old.nabble.com/tutorial-osgi-camel-part2deployment-problem-tp26531488p26531815.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: tutorial-osgi-camel-part2 -- deployment problem
Do you have maven issue to connect to resources on the web because I see this error in the log that you provide me : mvn:org.apache.camel.karaf/features/2.1-SNAPSHOT/xml/features] could not be resolved ? It seems also that they are carriage return in your etc/feature file config Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Thu, Nov 26, 2009 at 5:02 PM, Kevin.Zhang wrote: > > Hello Charles, > > This time I got deployment problem. After I started karaf, I cannot see the > reportinsident bundles with osgi:list command. > > ka...@root osgi:list > START LEVEL 100 > ID State Blueprint Level Name > [ 0] [Active ] [ ] [ 0] System Bundle (2.0.0) > [ 1] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell > Various Commands (1.0.0) > [ 2] [Active ] [ ] [ 30] Apache MINA Core (2.0.0.M6) > [ 3] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell > PackageAdmin Commands (1.0.0) > [ 4] [Active ] [Created ] [ 30] Apache Felix Karaf :: JAAS > Modules (1.0.0) > [ 5] [Active ] [Created ] [ 30] Apache Felix Karaf :: JAAS > Config (1.0.0) > [ 6] [Active ] [Created ] [ 30] Apache Felix Karaf :: Blueprint > Deployer (1.0.0) > [ 7] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell > Admin (1.0.0) > [ 8] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell Log > Commands (1.0.0) > [ 9] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features > Command (1.0.0) > [ 10] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell SSH > (1.0.0) > [ 11] [Active ] [ ] [ 30] Apache Mina SSHD :: Core (0.2.0) > [ 12] [Active ] [ ] [ 30] Apache Felix Gogo Shell Runtime > (0.2.0) > [ 13] [Active ] [Failure ] [ 30] Apache Felix Karaf :: Features > Core (1.0.0) > [ 14] [Active ] [Created ] [ 30] Apache Felix Karaf :: Management > (1.0.0) > [ 15] [Active ] [ ] [ 30] org.osgi.impl.bundle.jmx > (4.2.0.200907080519) > [ 16] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell > Console (1.0.0) > [ 17] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell OSGi > Commands (1.0.0) > [ 18] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features > Management (1.0.0) > [ 19] [Active ] [Created ] [ 30] Apache Felix Karaf :: Spring > Deployer (1.0.0) > [ 20] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features > Deployer (1.0.0) > [ 21] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell > ConfigAdmin Commands (1.0.0) > [ 22] [Active ] [ ] [ 10] Apache Felix File Install > (2.0.0) > [ 23] [Active ] [ ] [ 10] Apache Felix Prefrences Service > (1.0.2) > [ 24] [Active ] [ ] [ 10] Apache Felix Configuration Admin > Service (1.2.4) > [ 25] [Active ] [ ] [ 8] OPS4J Pax Logging - API (1.4) > [ 26] [Active ] [ ] [ 8] OPS4J Pax Logging - Service > (1.4) > [ 27] [Active ] [ ] [ 5] OPS4J Pax Url - mvn: (1.0.0) > [ 28] [Active ] [ ] [ 5] OPS4J Pax Url - wrap: (1.0.0) > [ 29] [Active ] [Created ] [ 20] Apache Geronimo Blueprint Bundle > (1.0.0) > > ka...@root> features:list > java.lang.IllegalArgumentException: Command not found: features:list > at > org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:208) > at > org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146) > at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91) > at > org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75) > at > org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71) > at > org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:115) > at java.lang.Thread.run(Thread.java:619) > > The karaf.log says: > > C:\temp\apache-felix-karaf-1.0.0\apache-felix-karaf-1.0.0>type > data\log\karaf.log > Nov 26, 2009 7:42:04 AM org.apache.felix.karaf.main.SimpleFileLock lock > INFO: locking > 07:42:05,953 | INFO | karaf-1.0.0/etc} | fileinstall | > ? ? | Updating configuration from > org.apache.feli > x.karaf.shell.cfg > 07:42:05,953 | INFO | Thread-1 | fileinstall | > ? ? | Updating configuration from > org.ops4j.pax.u > rl.mvn.cfg > 07:42:06,093 | INFO | karaf-1.0.0/etc} | fileinstall | > ? ? | Installed > C:\temp\apache-felix-kar
tutorial-osgi-camel-part2 -- deployment problem
Hello Charles, This time I got deployment problem. After I started karaf, I cannot see the reportinsident bundles with osgi:list command. ka...@root osgi:list START LEVEL 100 ID State Blueprint Level Name [ 0] [Active ] [] [0] System Bundle (2.0.0) [ 1] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell Various Commands (1.0.0) [ 2] [Active ] [] [ 30] Apache MINA Core (2.0.0.M6) [ 3] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell PackageAdmin Commands (1.0.0) [ 4] [Active ] [Created ] [ 30] Apache Felix Karaf :: JAAS Modules (1.0.0) [ 5] [Active ] [Created ] [ 30] Apache Felix Karaf :: JAAS Config (1.0.0) [ 6] [Active ] [Created ] [ 30] Apache Felix Karaf :: Blueprint Deployer (1.0.0) [ 7] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell Admin (1.0.0) [ 8] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell Log Commands (1.0.0) [ 9] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features Command (1.0.0) [ 10] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell SSH (1.0.0) [ 11] [Active ] [] [ 30] Apache Mina SSHD :: Core (0.2.0) [ 12] [Active ] [] [ 30] Apache Felix Gogo Shell Runtime (0.2.0) [ 13] [Active ] [Failure ] [ 30] Apache Felix Karaf :: Features Core (1.0.0) [ 14] [Active ] [Created ] [ 30] Apache Felix Karaf :: Management (1.0.0) [ 15] [Active ] [] [ 30] org.osgi.impl.bundle.jmx (4.2.0.200907080519) [ 16] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell Console (1.0.0) [ 17] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell OSGi Commands (1.0.0) [ 18] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features Management (1.0.0) [ 19] [Active ] [Created ] [ 30] Apache Felix Karaf :: Spring Deployer (1.0.0) [ 20] [Active ] [GracePeriod ] [ 30] Apache Felix Karaf :: Features Deployer (1.0.0) [ 21] [Active ] [Created ] [ 30] Apache Felix Karaf :: Shell ConfigAdmin Commands (1.0.0) [ 22] [Active ] [] [ 10] Apache Felix File Install (2.0.0) [ 23] [Active ] [] [ 10] Apache Felix Prefrences Service (1.0.2) [ 24] [Active ] [] [ 10] Apache Felix Configuration Admin Service (1.2.4) [ 25] [Active ] [] [8] OPS4J Pax Logging - API (1.4) [ 26] [Active ] [] [8] OPS4J Pax Logging - Service (1.4) [ 27] [Active ] [] [5] OPS4J Pax Url - mvn: (1.0.0) [ 28] [Active ] [] [5] OPS4J Pax Url - wrap: (1.0.0) [ 29] [Active ] [Created ] [ 20] Apache Geronimo Blueprint Bundle (1.0.0) ka...@root> features:list java.lang.IllegalArgumentException: Command not found: features:list at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:208) at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:146) at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:91) at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:75) at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71) at org.apache.felix.karaf.shell.console.jline.Console.run(Console.java:115) at java.lang.Thread.run(Thread.java:619) The karaf.log says: C:\temp\apache-felix-karaf-1.0.0\apache-felix-karaf-1.0.0>type data\log\karaf.log Nov 26, 2009 7:42:04 AM org.apache.felix.karaf.main.SimpleFileLock lock INFO: locking 07:42:05,953 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Updating configuration from org.apache.feli x.karaf.shell.cfg 07:42:05,953 | INFO | Thread-1 | fileinstall | ? ? | Updating configuration from org.ops4j.pax.u rl.mvn.cfg 07:42:06,093 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Installed C:\temp\apache-felix-karaf-1.0.0\ apache-felix-karaf-1.0.0\etc\org.apache.felix.karaf.shell.cfg 07:42:06,125 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Updating configuration from org.ops4j.pax.l ogging.cfg 07:42:06,156 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Installed C:\temp\apache-felix-karaf-1.0.0\ apache-felix-karaf-1.0.0\etc\org.ops4j.pax.logging.cfg 07:42:06,203 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Updating configuration from org.apache.feli x.karaf.log.cfg 07:42:06,203 | INFO | karaf-1.0.0/etc} | fileinstall | ? ? | Installed C:\temp\apache-felix-karaf-1.0.0\ apache-felix-karaf-1.0.0\etc\org.apache.felix.kar
Re: Using Camel with Felix (Karaf) without Spring
Charles, Peter, Given that you can also create a CamelContext from within a simple main() method and run routes that way, it should be possible to build a solution that does not require spring-dm. I think we should be able to build a simple Activator that is capable of tracking all RoutesBuilder implementations in the service registry and start those routes in a shared CamelContext. This would only require the standard OSGi Activator and ServiceTracker. For the dynamic disabling of routes, we can probably reuse the same mechanism for stopping the route if the RoutesBuilder implementation gets unregistered. Not sure how we could deal with services that are in other bundles, but perhaps the bundle that registers the builder can itself track the requirements and unregister the routesbuilder as soon as the requirements are no longer met. Anyway, I think it's a very interesting use case -- I think it would be kind of cool if we can also deploy Camel in this kind of embedded environment. Regards, Gert Vanthienen Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/11/26 Charles Moulliard : > Hi Peter, > > Interesting design that you propose here. > >> - How do I create the camel content and export it to be picked up by the >> routing bundle. Is this done automatically? > > The camel-spring-osgi component allow to automatically register the > camelContext and made it available for other bunldes. > > The existing implementation of camel top of an OSGI server (Apache > Felix Karaf, Apache ServiceMix 4) depends on Spring Dynamic Module > (spring DM). Why : This project initiated some months ago by Spring > offer the advantage to register objects dynamically in the OSGI > service registry. In consequence, those objects (including the > camelContext) are available by other bundles of the OSGI platform. > > This is why when you deploy camel on osgi platform, the following > bundles must be deployed : > > > mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 > spring > spring-dm // Spring Dynamic Module > mvn:org.springframework/spring-tx/2.5.6.SEC01 > camel-core > mvn:org.apache.camel/camel-spring-osgi/2.1-SNAPSHOT > > > This situation will change in the future. The last OSGI specification > R4.2 includes a Blueprint Container Specification (based on Spring DM > work) (see page 121 of OSGI R4.2 specification) and a blueprint > implementation is already available > (http://svn.apache.org/repos/asf/incubator/aries/trunk/blueprint). A > camel-blueprint component is currently developed > (https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint). > > In consequence, it will be possible in a near future to use blueprint > as "Dynamic Service layer" for Camel > >> - Do I need Spring DM to use the elements? > > Yes > >> - Do I need Spring DM to use the .beanRef() camel routing? > > No > >> - If I have OSGi services defined with iPOJO, how do I access them from a >> camel route? > > You don't need to use iPOJO. You can create your POJOs, package them > in one or several bundles and use them in your camel route like this : > > In your Spring config file > > > > > > > > > Remark : Don't forget to import the packages names of your POJOS in > the manifest file of your camel bundle > >> If there is a better way to accomplish the goal, I'm open to suggestions. > > The question is : How a service which is down will inform the camel > routes where it is used that the route must be stopped ? What is a > down service (a bundle, a web application, a database, ...) ? > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > * > blog : http://cmoulliard.blogspot.com > twitter : http://twitter.com/cmoulliard > Linkedlin : http://www.linkedin.com/in/charlesmoulliard > > Apache Camel Group : > http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm > > > > On Wed, Nov 25, 2009 at 8:29 PM, Pete Mueller wrote: >> >> Hello Charles, >> >> I should have been more specific. Yes, I meant without Spring DM. What I >> am attempting is to create a system that has X number of services >> registered, but not all services are running at all times, if a service is >> down, the routes that direct messages to it must also be brought down to >> stop messages from being accepted and going nowhere. A simple example would >> be: >> >> HTTP POST --> Translator Service --> Database >> >> If the translator service is brought offline, the HTTP listener and database >> resources should be brought down as well. >> >> My first thought was to: >> 1. Creating a bundle with just an "empty" camel context. >> 2. Registering my service using iPOJO in a separate bundle >> 3. Creating a separate bundle that has a route written in Java DSL that uses >> the context from (1) and the service from (2) >> >> The idea is to have a central engine that routes can "register" themselves >> to. Since I'
Re: Clarification requested - Camel CXFRS - JAXRS
Willem, I have adapted the flow (between the HTTP requests) and camel route is called now. Unfortunately, the calling program receives a HTTP response 404 and error is raised in the log A. Spring Camel Config http://localhost:8181/cxf/proxy/";> http://camel.apache.org/schema/osgi";> B. API sends the following requests : http://localhost:8181/cxf/camel-rest-example/reportservice/incidents CamelHttpMethod=POST, CamelHttpCharacterEncoding=UTF-8, CamelCxfRsResponseClass=class javax.ws.rs.core.Response, CamelAcceptContentType=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, Content-Type=application/xml; charset=UTF-8, operationName=addIncident, CamelHttpPath=/camel-rest-example/reportservice/incidents, CamelHttpUri=/cxf/camel-rest-example/reportservice/incidents Charles Moulliard Senior Enterprise Architect Apache Camel Committer C. Error generated : 15:27:35,429 | WARN | 8980...@qtp1-145 | JAXRSInInterceptor | s.interceptor.JAXRSInInterceptor 122 | No root resource matching request path /camel-rest-example/reportservice/incidents has been found. 15:27:35,429 | WARN | 8980...@qtp1-145 | WebApplicationExceptionMapper| pl.WebApplicationExceptionMapper 52 | WebApplicationException has been caught : no cause is available 15:27:35,429 | WARN | 9787...@qtp1-142 | PhaseInterceptorChain | ache.cxf.common.logging.LogUtils 361 | Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:573) at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:552) at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:206) at org.apache.camel.component.cxf.jaxrs.CxfRsProducer.invokeHttpClient(CxfRsProducer.java:123) at org.apache.camel.component.cxf.jaxrs.CxfRsProducer.process(CxfRsProducer.java:65) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97) at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:94) at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146) at org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) at org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53) at org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:162) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:223) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:153) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:91) at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49) at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:206) at org.apache.camel.processor.Pipeline.process(Pipeline.java:74) at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54) at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67) at org.apache.camel.component.cxf.jaxrs.CxfRsInvoker.performInvocation(CxfRsInvoker.java:57) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:130) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at org.apache.cxf.workqueue.SynchronousE
Re: Clarification requested - Camel CXFRS - JAXRS
My request was send to : http://localhost:8181/cxf/camel-rest-example/ Based on your reply, I will adapt my spring camel config. Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Thu, Nov 26, 2009 at 2:15 PM, Willem Jiang wrote: > Charles Moulliard wrote: >> >> Hi, >> >> I would like to better understand how JAXRS works with Camel CXF >> endpoints for RestFull service. >> >> Here is an example : >> >> http://www.springframework.org/schema/beans"; >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> xmlns:context="http://www.springframework.org/schema/context"; >> xmlns:camel="http://camel.apache.org/schema/spring"; >> xmlns:cxf="http://camel.apache.org/schema/cxf"; >> xmlns:cxf-core="http://cxf.apache.org/core"; >> xmlns:jaxrs="http://cxf.apache.org/jaxrs"; >> 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/osgi >> http://camel.apache.org/schema/osgi/camel-osgi.xsd >> http://camel.apache.org/schema/spring >> http://camel.apache.org/schema/spring/camel-spring.xsd >> http://camel.apache.org/schema/cxf >> http://camel.apache.org/schema/cxf/camel-cxf.xsd >> http://cxf.apache.org/jaxrs >> http://cxf.apache.org/schemas/jaxrs.xsd >> http://cxf.apache.org/core >> http://cxf.apache.org/schemas/core.xsd";> >> >> >> >> >> > resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> >> > resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" /> >> >> > staticSubresourceResolution="true"> >> >> >> >> >> >> >> >> >> > >> class="org.apache.camel.example.reportincident.restful.ReportIncidentService"/> >> >> > address="/proxy/" >> >> >> serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" >> /> >> >> > address="http://localhost:8181/cxf/camel-rest-example/"; >> >> >> serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService"> >> >> >> > xmlns="http://camel.apache.org/schema/osgi";> >> >> >> >> >> >> >> >> >> >> >> Can we explain/describe the process like this ? >> >> API sending HTTP REST (get/post/put/delete) request --> jetty web >> server running OSGI CXF servlet receives the call --> which is >> propagated to jaxrs:server component --> request is parsed and send to >> the service ReportIncidentService (where REST services are defined >> using annotations) --> next an object is send to the Camel >> cxfrs:rsServer endpoint who will next propagate the payload into camel >> route --> camel route --> arrives at cxf:RsClient (which send back the >> result to JAXRS:server) --> reply to API calling ? > > I'm confused, can you tell me the address that API sending HTTP request? > > If you send the request to http://localhost:8181/cxf/camel-rest-example/, > the jaxrs:server component will be invoked, there is no further camel route > involved. > If you send the request to http://localhost:8181/cxf/proxy the cxf:rsServer > will parser the request (like the camel-cxf consumer will turn a SOAP > request to POJO method invocation) redirect the request to cxf:rsClient, the > cxf:rsClient will invoke the service of Jaxrs:server, then put the response > back to cxf:rsServer. > >> >> Questions : >> >> 1) Why do we have to declare serviceClass in cxfrs:rsServer endpoint >> as it will propagate body/payload to camel route ? > > For the cxf:rsClient, CXF RS support two types client API, one is Proxy API, > you need to specify the service class for it ; the other is HttpAPI, it just > like camel-http component. >> >> 2) Why both jaxrs:server and cxfrs:rsClient uses the same class reference >> ? > > You can specify different service class for them , but you need do operation > and parameter mapping yourself. >> >> 3) Can we have two different classes : one extracting the info >> received from HTTP request, putting them in a message propagated >> though queues / camel process to a service component who will answer >> and the response will be send back by cxf:rsClient to the API calling >> the web service ? How to de
Re: Clarification requested - Camel CXFRS - JAXRS
Charles Moulliard wrote: Hi, I would like to better understand how JAXRS works with Camel CXF endpoints for RestFull service. Here is an example : http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:context="http://www.springframework.org/schema/context"; xmlns:camel="http://camel.apache.org/schema/spring"; xmlns:cxf="http://camel.apache.org/schema/cxf"; xmlns:cxf-core="http://cxf.apache.org/core"; xmlns:jaxrs="http://cxf.apache.org/jaxrs"; 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/osgi http://camel.apache.org/schema/osgi/camel-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd";> http://localhost:8181/cxf/camel-rest-example/"; serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService"> http://camel.apache.org/schema/osgi";> Can we explain/describe the process like this ? API sending HTTP REST (get/post/put/delete) request --> jetty web server running OSGI CXF servlet receives the call --> which is propagated to jaxrs:server component --> request is parsed and send to the service ReportIncidentService (where REST services are defined using annotations) --> next an object is send to the Camel cxfrs:rsServer endpoint who will next propagate the payload into camel route --> camel route --> arrives at cxf:RsClient (which send back the result to JAXRS:server) --> reply to API calling ? I'm confused, can you tell me the address that API sending HTTP request? If you send the request to http://localhost:8181/cxf/camel-rest-example/, the jaxrs:server component will be invoked, there is no further camel route involved. If you send the request to http://localhost:8181/cxf/proxy the cxf:rsServer will parser the request (like the camel-cxf consumer will turn a SOAP request to POJO method invocation) redirect the request to cxf:rsClient, the cxf:rsClient will invoke the service of Jaxrs:server, then put the response back to cxf:rsServer. Questions : 1) Why do we have to declare serviceClass in cxfrs:rsServer endpoint as it will propagate body/payload to camel route ? For the cxf:rsClient, CXF RS support two types client API, one is Proxy API, you need to specify the service class for it ; the other is HttpAPI, it just like camel-http component. 2) Why both jaxrs:server and cxfrs:rsClient uses the same class reference ? You can specify different service class for them , but you need do operation and parameter mapping yourself. 3) Can we have two different classes : one extracting the info received from HTTP request, putting them in a message propagated though queues / camel process to a service component who will answer and the response will be send back by cxf:rsClient to the API calling the web service ? How to design this ? How about you use two jms queue for the keeping the request and response ? from("cxfrs:bean:rsServer").to("jms:queue:request"). to("cxfrs:bean:rsClient").to("jms:queue:response"). Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm Willem
Re: Using Camel with Felix (Karaf) without Spring
Hi Peter, Interesting design that you propose here. > - How do I create the camel content and export it to be picked up by the > routing bundle. Is this done automatically? The camel-spring-osgi component allow to automatically register the camelContext and made it available for other bunldes. The existing implementation of camel top of an OSGI server (Apache Felix Karaf, Apache ServiceMix 4) depends on Spring Dynamic Module (spring DM). Why : This project initiated some months ago by Spring offer the advantage to register objects dynamically in the OSGI service registry. In consequence, those objects (including the camelContext) are available by other bundles of the OSGI platform. This is why when you deploy camel on osgi platform, the following bundles must be deployed : mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 spring spring-dm // Spring Dynamic Module mvn:org.springframework/spring-tx/2.5.6.SEC01 camel-core mvn:org.apache.camel/camel-spring-osgi/2.1-SNAPSHOT This situation will change in the future. The last OSGI specification R4.2 includes a Blueprint Container Specification (based on Spring DM work) (see page 121 of OSGI R4.2 specification) and a blueprint implementation is already available (http://svn.apache.org/repos/asf/incubator/aries/trunk/blueprint). A camel-blueprint component is currently developed (https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint). In consequence, it will be possible in a near future to use blueprint as "Dynamic Service layer" for Camel > - Do I need Spring DM to use the elements? Yes > - Do I need Spring DM to use the .beanRef() camel routing? No > - If I have OSGi services defined with iPOJO, how do I access them from a > camel route? You don't need to use iPOJO. You can create your POJOs, package them in one or several bundles and use them in your camel route like this : In your Spring config file Remark : Don't forget to import the packages names of your POJOS in the manifest file of your camel bundle > If there is a better way to accomplish the goal, I'm open to suggestions. The question is : How a service which is down will inform the camel routes where it is used that the route must be stopped ? What is a down service (a bundle, a web application, a database, ...) ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Wed, Nov 25, 2009 at 8:29 PM, Pete Mueller wrote: > > Hello Charles, > > I should have been more specific. Yes, I meant without Spring DM. What I > am attempting is to create a system that has X number of services > registered, but not all services are running at all times, if a service is > down, the routes that direct messages to it must also be brought down to > stop messages from being accepted and going nowhere. A simple example would > be: > > HTTP POST --> Translator Service --> Database > > If the translator service is brought offline, the HTTP listener and database > resources should be brought down as well. > > My first thought was to: > 1. Creating a bundle with just an "empty" camel context. > 2. Registering my service using iPOJO in a separate bundle > 3. Creating a separate bundle that has a route written in Java DSL that uses > the context from (1) and the service from (2) > > The idea is to have a central engine that routes can "register" themselves > to. Since I'm working with embedded devices, if a particular sub-system > isn't needed, I'd like to shut it down, which means the routes that would > send messages to those services would need to be shut down as well. I guess > this could also be accomplished by creating an independent camel context for > every route, but this seems like it would incur extra overhead. > > My OSGi container is essentially a "clean" install of Karaf, so I do have > the Spring Deployer at my disposal, but not Spring DM. It is not clear to > me which features are used by which parts of a camel project > > Some questions: > - How do I create the camel content and export it to be picked up by the > routing bundle. Is this done automatically? > - Do I need Spring DM to use the elements? > - Do I need Spring DM to use the .beanRef() camel routing? > - If I have OSGi services defined with iPOJO, how do I access them from a > camel route? > > If there is a better way to accomplish the goal, I'm open to suggestions. > -p > > > cmoulliard wrote: >> >> Hi Peter, >> >> Can you precise what you understand by 'without spring' ? without >> spring configuration file, without Spring DM services, ... >> >> Camel routes can be defined using Java DSL language and deployed as a >> bundle top of Apache Felix Karaf. There is an example here : >> https://svn.a
Re: Using Camel with Felix (Karaf) without Spring
Hi Peter, Interesting design that you propose here. > - How do I create the camel content and export it to be picked up by the > routing bundle. Is this done automatically? The camel-spring-osgi component allow to automatically register the camelContext and made it available for other bunldes. The existing implementation of camel top of an OSGI server (Apache Felix Karaf, Apache ServiceMix 4) depends on Spring Dynamic Module (spring DM). Why : This project initiated some months ago by Spring offer the advantage to register objects dynamically in the OSGI service registry. In consequence, those objects (including the camelContext) are available by other bundles of the OSGI platform. This is why when you deploy camel on osgi platform, the following bundles must be deployed : mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 spring spring-dm // Spring Dynamic Module mvn:org.springframework/spring-tx/2.5.6.SEC01 camel-core mvn:org.apache.camel/camel-spring-osgi/2.1-SNAPSHOT This situation will change in the future. The last OSGI specification R4.2 includes a Blueprint Container Specification (based on Spring DM work) (see page 121 of OSGI R4.2 specification) and a blueprint implementation is already available (http://svn.apache.org/repos/asf/incubator/aries/trunk/blueprint). A camel-blueprint component is currently developed (https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint). In consequence, it will be possible in a near future to use blueprint as "Dynamic Service layer" for Camel > - Do I need Spring DM to use the elements? Yes > - Do I need Spring DM to use the .beanRef() camel routing? No > - If I have OSGi services defined with iPOJO, how do I access them from a > camel route? You don't need to use iPOJO. You can create your POJOs, package them in one or several bundles and use them in your camel route like this : Rema > If there is a better way to accomplish the goal, I'm open to suggestions. Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Wed, Nov 25, 2009 at 8:29 PM, Pete Mueller wrote: > > Hello Charles, > > I should have been more specific. Yes, I meant without Spring DM. What I > am attempting is to create a system that has X number of services > registered, but not all services are running at all times, if a service is > down, the routes that direct messages to it must also be brought down to > stop messages from being accepted and going nowhere. A simple example would > be: > > HTTP POST --> Translator Service --> Database > > If the translator service is brought offline, the HTTP listener and database > resources should be brought down as well. > > My first thought was to: > 1. Creating a bundle with just an "empty" camel context. > 2. Registering my service using iPOJO in a separate bundle > 3. Creating a separate bundle that has a route written in Java DSL that uses > the context from (1) and the service from (2) > > The idea is to have a central engine that routes can "register" themselves > to. Since I'm working with embedded devices, if a particular sub-system > isn't needed, I'd like to shut it down, which means the routes that would > send messages to those services would need to be shut down as well. I guess > this could also be accomplished by creating an independent camel context for > every route, but this seems like it would incur extra overhead. > > My OSGi container is essentially a "clean" install of Karaf, so I do have > the Spring Deployer at my disposal, but not Spring DM. It is not clear to > me which features are used by which parts of a camel project > > Some questions: > - How do I create the camel content and export it to be picked up by the > routing bundle. Is this done automatically? > - Do I need Spring DM to use the elements? > - Do I need Spring DM to use the .beanRef() camel routing? > - If I have OSGi services defined with iPOJO, how do I access them from a > camel route? > > If there is a better way to accomplish the goal, I'm open to suggestions. > -p > > > cmoulliard wrote: >> >> Hi Peter, >> >> Can you precise what you understand by 'without spring' ? without >> spring configuration file, without Spring DM services, ... >> >> Camel routes can be defined using Java DSL language and deployed as a >> bundle top of Apache Felix Karaf. There is an example here : >> https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-guice-jms >> >> A camel-blueprint component is under construction : >> https://svn.apache.org/repos/asf/camel/trunk/components/camel-blueprint >> >> remark : Blueprint = OSGI RI of Spring DM service >> >> Regards, >> >> Charles Moulliard >> Senior Enterprise Architect >> Apache C
Re: tutorial-osgi-camel-part2 -- reportincident.service test failed
Sorry for the mistake, the file where the property must be set is system.properties. I have correct the wiki page. Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Wed, Nov 25, 2009 at 6:54 PM, Kevin.Zhang wrote: > > Charles, > > The build is successful if I skip the test. I now have problem to launch > it. After I started karaf, I can see message > > > C:\temp\apache-felix-karaf-1.0.0\apache-felix-karaf-1.0.0\bin>.\karaf.bat > Bundle listed in startup.properties configuration not found: servicemix.base > __ __ > / //_/ __ _/ __/ > / ,< / __ `/ ___/ __ `/ /_ > / /| |/ /_/ / / / /_/ / __/ > /_/ |_|\__,_/_/ \__,_/_/ > > Apache Felix Karaf (1.0.0) > > Hit '' for a list of available commands > and '[cmd] --help' for help on a specific command. > > ka...@root> > > > > > My etc/startup.properties is as below. I added the last line. > > > C:\temp\apache-felix-karaf-1.0.0\apache-felix-karaf-1.0.0\bin>type > ..\etc\startup.properties > > # > # Licensed to the Apache Software Foundation (ASF) under one or more > # contributor license agreements. See the NOTICE file distributed with > # this work for additional information regarding copyright ownership. > # The ASF licenses this file to You under the Apache License, Version 2.0 > # (the "License"); you may not use this file except in compliance with > # the License. You may obtain a copy of the License at > # > # http://www.apache.org/licenses/LICENSE-2.0 > # > # Unless required by applicable law or agreed to in writing, software > # distributed under the License is distributed on an "AS IS" BASIS, > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. > # See the License for the specific language governing permissions and > # limitations under the License. > # > > > # This file allows you to control the start level of each bundle. > # > > # > # Startup core services like logging > # > org/ops4j/pax/url/pax-url-mvn/1.0.0/pax-url-mvn-1.0.0.jar=5 > org/ops4j/pax/url/pax-url-wrap/1.0.0/pax-url-wrap-1.0.0.jar=5 > org/ops4j/pax/logging/pax-logging-api/1.4/pax-logging-api-1.4.jar=8 > org/ops4j/pax/logging/pax-logging-service/1.4/pax-logging-service-1.4.jar=8 > org/apache/felix/org.apache.felix.configadmin/1.2.4/org.apache.felix.configadmin-1.2.4.jar=10 > org/apache/felix/org.apache.felix.prefs/1.0.2/org.apache.felix.prefs-1.0.2.jar=10 > org/apache/felix/org.apache.felix.fileinstall/2.0.0/org.apache.felix.fileinstall-2.0.0.jar=10 > > # > # The rest of the services.. > # > org/apache/geronimo/blueprint/geronimo-blueprint/1.0.0/geronimo-blueprint-1.0.0.jar=20 > > org/apache/felix/gogo/org.apache.felix.gogo.runtime/0.2.0/org.apache.felix.gogo.runtime-0.2.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.console/1.0.0/org.apache.felix.karaf.shell.console-1.0.0.jar=30 > org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.spring/1.0.0/org.apache.felix.karaf.deployer.spring-1.0.0.jar=30 > org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.blueprint/1.0.0/org.apache.felix.karaf.deployer.blueprint-1.0.0.jar=30 > org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.features/1.0.0/org.apache.felix.karaf.deployer.features-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.admin/1.0.0/org.apache.felix.karaf.shell.admin-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.osgi/1.0.0/org.apache.felix.karaf.shell.osgi-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.log/1.0.0/org.apache.felix.karaf.shell.log-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.config/1.0.0/org.apache.felix.karaf.shell.config-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.packages/1.0.0/org.apache.felix.karaf.shell.packages-1.0.0.jar=30 > org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.commands/1.0.0/org.apache.felix.karaf.shell.commands-1.0.0.jar=30 > org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.config/1.0.0/org.apache.felix.karaf.jaas.config-1.0.0.jar=30 > org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.modules/1.0.0/org.apache.felix.karaf.jaas.modules-1.0.0.jar=30 > > org/apache/felix/karaf/features/org.apache.felix.karaf.features.core/1.0.0/org.apache.felix.karaf.features.core-1.0.0.jar=30 > org/apache/felix/karaf/features/org.apache.felix.karaf.features.command/1.0.0/org.apache.felix.karaf.features.command-1.0.0.jar=30 > org/apache/felix/ka
Re: tutorial-osgi-camel-part2 -- reportincident.service test failed
Hi Kevin, Fix has been posted (I have removed the tests present in the project service as they can only run on OSGI platform). I plan to provide integration tests in the future using PAX Exam. So you can retest. Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm On Wed, Nov 25, 2009 at 5:55 PM, Kevin.Zhang wrote: > > ok. thx. i will wait for your fix. i guess that we just miss a pkg > dependency. -kevin > > > > cmoulliard wrote: >> >> Use the option -Dtest=false when executing the mvn clean install >> command. I forget to review the test case. This will be done tomorrow >> morning. >> >> Regards, >> >> Charles Moulliard >> Senior Enterprise Architect >> Apache Camel Committer >> >> * >> blog : http://cmoulliard.blogspot.com >> twitter : http://twitter.com/cmoulliard >> Linkedlin : http://www.linkedin.com/in/charlesmoulliard >> >> Apache Camel Group : >> http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm >> >> >> >> On Wed, Nov 25, 2009 at 5:44 PM, Kevin.Zhang >> wrote: >>> >>> Hi Charles, >>> >>> The tests failed when trying to build the reportincident.service. Here is >>> the log in the target\surefire-reports. Please help. >>> >>> Thanks a lot, >>> Kevin >>> >>> >>> org.apache.camel.example.reportincident.AddIncidentTest.txt >>> C:\temp\tutorial-osgi-camel-part2\reportincident.service\target\surefire-reports>type >>> org.apache.camel.example.reportincident.AddIncidentTest.txt >>> --- >>> Test set: org.apache.camel.example.reportincident.AddIncidentTest >>> --- >>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.391 sec >>> <<< FAILURE! >>> testSaveRecord(org.apache.camel.example.reportincident.AddIncidentTest) >>> Time elapsed: 0.375 sec <<< ERROR! >>> org.springframework.beans.factory.parsing.BeanDefinitionParsingException: >>> Configuration problem: Failed to import bean definitions from relative >>> location [META- >>> INF/spring/spring-service-beans-dao.xml] >>> Offending resource: class path resource >>> [test-reportincident-service.xml]; >>> nested exception is >>> org.springframework.beans.factory.parsing.BeanDefinitionParsingEx >>> ception: Configuration problem: Unexpected failure during bean definition >>> parsing >>> Offending resource: class path resource >>> [META-INF/spring/spring-service-beans-dao.xml] >>> Bean 'incidentServiceTarget'; nested exception is >>> org.springframework.beans.FatalBeanException: Invalid NamespaceHandler >>> class >>> [org.springframework.osgi.config. >>> OsgiNamespaceHandler] for namespace >>> [http://www.springframework.org/schema/osgi]: problem with handler class >>> file or dependent class; nested exception is java.l >>> ang.NoClassDefFoundError: Could not initialize class >>> org.springframework.osgi.config.OsgiNamespaceHandler$1 >>> at >>> org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) >>> at >>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) >>> at >>> org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) >>> at >>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:201) >>> at >>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147) >>> at >>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132) >>> at >>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) >>> at >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507) >>> at >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398) >>> at >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) >>> at >>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) >>> at >>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) >>> at >>> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(Ab
Re: mail component "no folder found" problem still around
Hi Please try to avoid double posting! Check your first post for answers and help. On Thu, Nov 26, 2009 at 11:40 AM, huntc wrote: > > I think that this problem may still be around with 2.1-SNAPSHOT: > > > http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 > > > I noticed that I had a pop3 server outage and then subsequently had a > similar problem i.e. IllegalStateException, folder not open. > > Here's when the outage started. > > > 2009-11-26 11:57:55,316 [: MailComponent] WARN > ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not > poll endpoint: pop3://... caused by: Connect failed > javax.mail.MessagingException: Connect failed; > nested exception is: > java.net.NoRouteToHostException: No route to host > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) > at javax.mail.Service.connect(Service.java:288) > at > org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.net.NoRouteToHostException: No route to host > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:519) > at java.net.Socket.connect(Socket.java:469) > at > com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) > at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) > at com.sun.mail.pop3.Protocol.(Protocol.java:94) > at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) > ... 13 more > > > This went on for about a minute or so and there was no more in the log file > until several hours later - in fact when an email appeared in the INBOX. I > know this because my personal email account was copied on the email and so I > have the timestamp. > > I then get the following message every time I poll the server and have to > re-start my application to get over it: > > > 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer > - Folder not open > java.lang.IllegalStateException: Folder not open > at javax.mail.Folder.getMessages(Folder.java:938) > at javax.mail.Folder.search(Folder.java:1226) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > > Looks as though there might be a bug in the Camel Mail component? > > Happy to create a JIRA if there is consensus. > > Kind regards, > Christopher > -- > View this message in context: > http://old.nabble.com/mail-component-%22no-folder-found%22-problem-still-around-tp26525359p26525359.html > Sent from the Camel - Users (
Re: Lifecycle of a Camel Component
Hi A lot of questions. Let me give a start and try answering a couple of those. On Thu, Nov 26, 2009 at 1:42 AM, Pete Mueller wrote: > > Does any one have any documentation on the lifecycle of a camel component and > it's associated entities (Endpoint, > Consumer, Producer). I am attempting to write a component for a > event-driving wireline protocol. I understand the basics of: > 0. Component is created. > 1. URI in DSL gets passed to to component. > 2. Component creates Endpoint for each unique URI (if using a singleton) > 3. Endpoint creates Consumers and Producers. > > But I'm looking for a little more detail as to what triggers the creation > and removal of say Consumers. Specifically, > - Is a single Consumer around for the life of the CamelContext? Consumers and Producers are in reality more dynamic as you can have create a consumer, use it once and then discard it. CamelContext does not hold a repository for all created consumers/producers etc. As you can create then without involvement from CamelContext. On the other hand when a consumer is used as a input to a route, then that consumer is around for the life of that route. > - Does an Endpoint get notified if a Consumer it created is stop()'d? No there is no such callback. Camel have a very liberal and light API for Endpoint, Consumer, Producer so its easy to work with an implement custom components etc. There is a event API added in Camel 2.1 which have notifications when routes are started/stopped etc. This can be used in case you need to do some custom stuff. > - What is Consumer.stop() used for? Only during shutdown of the > CamelContext? Or is it more like a "pause" than a stop? Both. You can stop a route at runtime. But when Camel shutdown it will go through all routes, components, endpoints, services etc. Basically all what it has and stop them one by one. > - Is there a way (say in the case of a loss of network connection) to stop() > an Endpoint and all associated Consumers and Producers? Then later restart > them after connection has been regained? Yeah you can for example use Camel error handling and stop a route in case of an ConnectionException or what you like. In Camel 2.1 you can use RoutePolicy to that as well. However you must implement some logic yourself that monitors that particular connection and can start/stop the route depending on its state. Camel does not do that for you. > - Is there a general example/recommendation on how to handle connections to > unreliable external entities? > No not 2 business are the same. Some wants to self heal and just try at next interval. Others want to try 5 times with X delays and then alert someone if still a problem. > I've been using the IRC component as somewhat of a model, but my glance > through the code doesn't really indicate how the component deals with > connection loss or net-splits and other networking pit-falls. > Again connectivity is not that easy to encompass into a single model for dealing with lost connections. Often you only got the wacky java Exceptions that may or may not indicate a io/connection problem. However when you have a Camel consumer = input to a route then you got a chicken egg problem as Camel does not take over before the consumer has successfully got a message and created an Exchange to be routed in Camel. At this point Camel take over and you can use Camel error handling. But before that all error handling etc. is component specify. We love contributions so dig into it and help out. http://camel.apache.org/contributing.html > Here's a short outline of the wire protocol I have to implement if it helps: > > 1. Open TWO TCP connections with Server > 2. Register Myself with Server, twice, once as a SENDER, once as a RECEIVER. > Both connections are bi-directional, but the functions I can do on each > connection is limited by how I register myself. > 3. At this point I will receive data packets (messages) for some length of > time over the Receiver connection. > 4. At some point in the future the Server will send me an "ALL DONE" > message. At which point I must un-register my sender and receiver, but the > TCP connections remail open. > 5. After the unregister I need to notify Consumers that there is no more > messages coming and stop Producers from attempting to send more messages. > 6. After waiting X seconds (X in most cases is 180) I will attempt to > re-register myself and if successful need to re-activate Consumers and > Producers. > 7. I also need to account for the fact that at any time, I may lose a > network connection to the Server, and will need to stop all Consumers and > Producers until connection is restored. > > Thanks for any help > -p > -- > View this message in context: > http://old.nabble.com/Lifecycle-of-a-Camel-Component-tp26522808p26522808.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.c
Re: Using Guice with Camel
What kind of Object you want to inject into the bean component? Did you add that bind in your module ? Please let me have a look at your module class. Willem mumbly wrote: I've been taking a look at using Camel with Guice for DI, but I'm having a little trouble understanding exactly what the integration provides. I've got the configuration aspect and that seems to work fine. But it is unclear to me if/how to work with Guice enhanced components. Specifically, if I am using a bean component which uses @Inject, it doesn't appear that the bean is being pulled from the Guice context (in other words, the other components aren't being injected). I'm new to both Camel and Guice, so I could be missing something obvious here or there may be another pattern for DI using Guice with Camel that I missed. So I guess my basic question is does the Camel/Guice integration provide the ability to inject components within the routing chain? with the bean component? I see in the Guice example included in the dist, but it only seems to deal with using Guice for configuration of the routes. --Tim
Clarification requested - Camel CXFRS - JAXRS
Hi, I would like to better understand how JAXRS works with Camel CXF endpoints for RestFull service. Here is an example : http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:context="http://www.springframework.org/schema/context"; xmlns:camel="http://camel.apache.org/schema/spring"; xmlns:cxf="http://camel.apache.org/schema/cxf"; xmlns:cxf-core="http://cxf.apache.org/core"; xmlns:jaxrs="http://cxf.apache.org/jaxrs"; 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/osgi http://camel.apache.org/schema/osgi/camel-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd";> http://localhost:8181/cxf/camel-rest-example/"; serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService"> http://camel.apache.org/schema/osgi";> Can we explain/describe the process like this ? API sending HTTP REST (get/post/put/delete) request --> jetty web server running OSGI CXF servlet receives the call --> which is propagated to jaxrs:server component --> request is parsed and send to the service ReportIncidentService (where REST services are defined using annotations) --> next an object is send to the Camel cxfrs:rsServer endpoint who will next propagate the payload into camel route --> camel route --> arrives at cxf:RsClient (which send back the result to JAXRS:server) --> reply to API calling ? Questions : 1) Why do we have to declare serviceClass in cxfrs:rsServer endpoint as it will propagate body/payload to camel route ? 2) Why both jaxrs:server and cxfrs:rsClient uses the same class reference ? 3) Can we have two different classes : one extracting the info received from HTTP request, putting them in a message propagated though queues / camel process to a service component who will answer and the response will be send back by cxf:rsClient to the API calling the web service ? How to design this ? Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com twitter : http://twitter.com/cmoulliard Linkedlin : http://www.linkedin.com/in/charlesmoulliard Apache Camel Group : http://www.linkedin.com/groups?home=&gid=2447439&trk=anet_ug_hm
mail component "no folder found" problem still around
I think that this problem may still be around with 2.1-SNAPSHOT: http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 I noticed that I had a pop3 server outage and then subsequently had a similar problem i.e. IllegalStateException, folder not open. Here's when the outage started. 2009-11-26 11:57:55,316 [: MailComponent] WARN ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not poll endpoint: pop3://... caused by: Connect failed javax.mail.MessagingException: Connect failed; nested exception is: java.net.NoRouteToHostException: No route to host at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) at javax.mail.Service.connect(Service.java:288) at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.pop3.Protocol.(Protocol.java:94) at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) ... 13 more This went on for about a minute or so and there was no more in the log file until several hours later - in fact when an email appeared in the INBOX. I know this because my personal email account was copied on the email and so I have the timestamp. I then get the following message every time I poll the server and have to re-start my application to get over it: 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer - Folder not open java.lang.IllegalStateException: Folder not open at javax.mail.Folder.getMessages(Folder.java:938) at javax.mail.Folder.search(Folder.java:1226) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Looks as though there might be a bug in the Camel Mail component? Happy to create a JIRA if there is consensus. Kind regards, Christopher -- View this message in context: http://old.nabble.com/mail-component-%22no-folder-found%22-problem-still-around-tp26525359p26525359.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
Re: IllegalStateException, folder not open on pop3 mail uri
Hi Please create the JIRA ticket then I can commit some code for you to try out with. On Thu, Nov 26, 2009 at 11:19 AM, huntc wrote: > > I think that this problem may still be around with 2.1-SNAPSHOT: > > > http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 > > > I noticed that I had a pop3 server outage and then subsequently had a > similar problem i.e. IllegalStateException, folder not open. > > Here's when the outage started. > > > 2009-11-26 11:57:55,316 [: MailComponent] WARN > ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not > poll endpoint: pop3://... caused by: Connect failed > javax.mail.MessagingException: Connect failed; > nested exception is: > java.net.NoRouteToHostException: No route to host > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) > at javax.mail.Service.connect(Service.java:288) > at > org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.net.NoRouteToHostException: No route to host > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:519) > at java.net.Socket.connect(Socket.java:469) > at > com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) > at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) > at com.sun.mail.pop3.Protocol.(Protocol.java:94) > at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) > ... 13 more > > > This went on for about a minute or so and there was no more in the log file > until several hours later - in fact when an email appeared in the INBOX. I > know this because my personal email account was copied on the email and so I > have the timestamp. > > I then get the following message every time I poll the server and have to > re-start my application to get over it: > > > 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer > - Folder not open > java.lang.IllegalStateException: Folder not open > at javax.mail.Folder.getMessages(Folder.java:938) > at javax.mail.Folder.search(Folder.java:1226) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > > Looks as though there might be a bug in the Camel Mail component? > > Happy to create a JIRA if there is consensus. > > Kind regards, > Christopher > -- > View this message in context: > http://old.nabble.com/IllegalStateException%2C-folder-not-open-on-pop3-mail-uri-tp26525343p26525343.html > Sent from the Camel - Use
Re: IllegalStateException, folder not open on pop3 mail uri
Hi Can you recreate the situation? Its a bit odd because this code checks whether the folder is open before it accesses it // ensure folder is open if (!folder.isOpen()) { folder.open(Folder.READ_WRITE); } I have added a recreate folder when connecting which I hope should be able to fix the issue. As it will be getting a fresh folder if the connection was lost. On Thu, Nov 26, 2009 at 11:22 AM, huntc wrote: > > I think that this problem may still be around with 2.1-SNAPSHOT: > > > http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 > > > I noticed that I had a pop3 server outage and then subsequently had a > similar problem i.e. IllegalStateException, folder not open. > > Here's when the outage started. > > > 2009-11-26 11:57:55,316 [: MailComponent] WARN > ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not > poll endpoint: pop3://... caused by: Connect failed > javax.mail.MessagingException: Connect failed; > nested exception is: > java.net.NoRouteToHostException: No route to host > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) > at javax.mail.Service.connect(Service.java:288) > at > org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.net.NoRouteToHostException: No route to host > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) > at > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) > at java.net.Socket.connect(Socket.java:519) > at java.net.Socket.connect(Socket.java:469) > at > com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) > at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) > at com.sun.mail.pop3.Protocol.(Protocol.java:94) > at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) > at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) > ... 13 more > > > This went on for about a minute or so and there was no more in the log file > until several hours later - in fact when an email appeared in the INBOX. I > know this because my personal email account was copied on the email and so I > have the timestamp. > > I then get the following message every time I poll the server and have to > re-start my application to get over it: > > > 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer > - Folder not open > java.lang.IllegalStateException: Folder not open > at javax.mail.Folder.getMessages(Folder.java:938) > at javax.mail.Folder.search(Folder.java:1226) > at > org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) > at > java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > > Loo
IllegalStateException, folder not open on pop3 mail uri
I think that this problem may still be around with 2.1-SNAPSHOT: http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 I noticed that I had a pop3 server outage and then subsequently had a similar problem i.e. IllegalStateException, folder not open. Here's when the outage started. 2009-11-26 11:57:55,316 [: MailComponent] WARN ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not poll endpoint: pop3://... caused by: Connect failed javax.mail.MessagingException: Connect failed; nested exception is: java.net.NoRouteToHostException: No route to host at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) at javax.mail.Service.connect(Service.java:288) at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.pop3.Protocol.(Protocol.java:94) at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) ... 13 more This went on for about a minute or so and there was no more in the log file until several hours later - in fact when an email appeared in the INBOX. I know this because my personal email account was copied on the email and so I have the timestamp. I then get the following message every time I poll the server and have to re-start my application to get over it: 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer - Folder not open java.lang.IllegalStateException: Folder not open at javax.mail.Folder.getMessages(Folder.java:938) at javax.mail.Folder.search(Folder.java:1226) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Looks as though there might be a bug in the Camel Mail component? Happy to create a JIRA if there is consensus. Kind regards, Christopher -- View this message in context: http://old.nabble.com/IllegalStateException%2C-folder-not-open-on-pop3-mail-uri-tp26525346p26525346.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
IllegalStateException, folder not open on pop3 mail uri
I think that this problem may still be around with 2.1-SNAPSHOT: http://fusesource.com/forums/thread.jspa?threadID=746&tstart=0 I noticed that I had a pop3 server outage and then subsequently had a similar problem i.e. IllegalStateException, folder not open. Here's when the outage started. 2009-11-26 11:57:55,316 [: MailComponent] WARN ultPollingConsumerPollStrategy - Consumer Consumer[pop3://...] could not poll endpoint: pop3://... caused by: Connect failed javax.mail.MessagingException: Connect failed; nested exception is: java.net.NoRouteToHostException: No route to host at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:161) at javax.mail.Service.connect(Service.java:288) at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:241) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:79) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189) at com.sun.mail.pop3.Protocol.(Protocol.java:94) at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:214) at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:157) ... 13 more This went on for about a minute or so and there was no more in the log file until several hours later - in fact when an email appeared in the INBOX. I know this because my personal email account was copied on the email and so I have the timestamp. I then get the following message every time I poll the server and have to re-start my application to get over it: 2009-11-26 19:19:57,293 [: MailComponent] ERROR MailConsumer - Folder not open java.lang.IllegalStateException: Folder not open at javax.mail.Folder.getMessages(Folder.java:938) at javax.mail.Folder.search(Folder.java:1226) at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:107) at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:108) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Looks as though there might be a bug in the Camel Mail component? Happy to create a JIRA if there is consensus. Kind regards, Christopher -- View this message in context: http://old.nabble.com/IllegalStateException%2C-folder-not-open-on-pop3-mail-uri-tp26525343p26525343.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
Re: Camel : schedule the move of messages
Thank you for your help Claus Ibsen-2 wrote: > > On Tue, Nov 24, 2009 at 6:17 PM, titexe wrote: >> >> Thank you for your reply >> >> my need is simple, I want to transfer messages from the queue A to queue >> B, >> each 1 hour. >> >> I think the examples that are present in this page is not used to me. >> >> de you have ideas that could help me ? >> > > Well Ashwin did in fact point you to a good place in the documentation > > The polling consumer >http://camel.apache.org/polling-consumer.html > > See the example - Timer based polling consumer > Which does exactly what you want, although it does it every 5th second. > >> thank you again >> >> titexe >> >> >> Ashwin Karpe wrote: >>> >>> Hi, >>> >>> You could do the following >>> >>> from("timer://foo?period=360"). >>> process (new Processor(Exchange exchange) { >>> exchange.getOut().setBody("My FooBar Message"); >>> }). >>> to(activemq:MyQueue); >>> >>> from(activemq:MyQueue).bean(doSomething); >>> >>> Alternatively, Check this link out >>> http://camel.apache.org/polling-consumer.html >>> >>> It demonstrates another way, a timer or quartz component can be used to >>> kick off a route that then allows for a JMS message to be picked up from >>> a >>> queue and delivered a a scheduled interval. >>> >>> Hope this helps. >>> >>> >>> Cheers, >>> >>> Ashwin... >>> >>> >>> titexe wrote: Hello, there's a possibility to schedule a move of messages from one queue to another, every 1 hour? If yes, how;)? Thank you for giving me an example:) Thank you in advance titexe >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/Camel-%3A-schedule-the-move-of-messages-tp26443376p26498569.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > > -- View this message in context: http://old.nabble.com/Camel-%3A-schedule-the-move-of-messages-tp26443376p26525294.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel : schedule the move of messages
Thank you for your help, Claus Ibsen-2 wrote: > > On Tue, Nov 24, 2009 at 6:17 PM, titexe wrote: >> >> Thank you for your reply >> >> my need is simple, I want to transfer messages from the queue A to queue >> B, >> each 1 hour. >> >> I think the examples that are present in this page is not used to me. >> >> de you have ideas that could help me ? >> > > Well Ashwin did in fact point you to a good place in the documentation > > The polling consumer >http://camel.apache.org/polling-consumer.html > > See the example - Timer based polling consumer > Which does exactly what you want, although it does it every 5th second. > >> thank you again >> >> titexe >> >> >> Ashwin Karpe wrote: >>> >>> Hi, >>> >>> You could do the following >>> >>> from("timer://foo?period=360"). >>> process (new Processor(Exchange exchange) { >>> exchange.getOut().setBody("My FooBar Message"); >>> }). >>> to(activemq:MyQueue); >>> >>> from(activemq:MyQueue).bean(doSomething); >>> >>> Alternatively, Check this link out >>> http://camel.apache.org/polling-consumer.html >>> >>> It demonstrates another way, a timer or quartz component can be used to >>> kick off a route that then allows for a JMS message to be picked up from >>> a >>> queue and delivered a a scheduled interval. >>> >>> Hope this helps. >>> >>> >>> Cheers, >>> >>> Ashwin... >>> >>> >>> titexe wrote: Hello, there's a possibility to schedule a move of messages from one queue to another, every 1 hour? If yes, how;)? Thank you for giving me an example:) Thank you in advance titexe >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/Camel-%3A-schedule-the-move-of-messages-tp26443376p26498569.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Author of Camel in Action: http://www.manning.com/ibsen/ > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > > -- View this message in context: http://old.nabble.com/Camel-%3A-schedule-the-move-of-messages-tp26443376p26525292.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using Guice with Camel
Hi I think James Strachan can shed lights on the camel-guice as he build it. I am sure there are some features missing in this component so we can use help to improve it. On Wed, Nov 25, 2009 at 6:50 PM, mumbly wrote: > > I've been taking a look at using Camel with Guice for DI, but I'm having a > little trouble understanding exactly what the integration provides. I've got > the configuration aspect and that seems to work fine. But it is unclear to > me if/how to work with Guice enhanced components. Specifically, if I am > using a bean component which uses @Inject, it doesn't appear that the bean > is being pulled from the Guice context (in other words, the other components > aren't being injected). > > I'm new to both Camel and Guice, so I could be missing something obvious > here or there may be another pattern for DI using Guice with Camel that I > missed. So I guess my basic question is does the Camel/Guice integration > provide the ability to inject components within the routing chain? with the > bean component? > > I see in the Guice example included in the dist, but it only seems to deal > with using Guice for configuration of the routes. > > --Tim > -- > View this message in context: > http://old.nabble.com/Using-Guice-with-Camel-tp26517323p26517323.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus