Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 94964 invoked from network); 6 May 2009 15:40:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 May 2009 15:40:21 -0000 Received: (qmail 88877 invoked by uid 500); 6 May 2009 15:40:21 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 88827 invoked by uid 500); 6 May 2009 15:40:21 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 88813 invoked by uid 99); 6 May 2009 15:40:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 15:40:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 15:40:09 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1M1jDo-0006lc-Oo for users@camel.apache.org; Wed, 06 May 2009 08:39:48 -0700 Message-ID: <23409362.post@talk.nabble.com> Date: Wed, 6 May 2009 08:39:48 -0700 (PDT) From: ariekenb To: users@camel.apache.org Subject: Re: SEDA Component Exception: No producer, this processor has not been started! In-Reply-To: <5380c69c0905060814l68e8cb60xd37b1db79b5b72bb@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: aaron.j.riekenberg@lmco.com References: <23407604.post@talk.nabble.com> <5380c69c0905060814l68e8cb60xd37b1db79b5b72bb@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks Claus. I haven't done anything special to configure a DeadLetterChannel. I assume that means I get the default settings from here http://camel.apache.org/dead-letter-channel.html (try up to 5 times 1 secon= d apart)? Are messages guaranteed to stay in order if the first message goes into the DeadLetterChannel? I have observed the first message seems to always be delivered first even when the exception below happens. Is there an easy way to know if all components/processors in a CamelContext are started? I can easily get the CamelContext injected into the producer bean, but I'm not sure what components I would need to check isStarted on before sending a message. Claus Ibsen-2 wrote: >=20 > Hi >=20 > Yeah its a race condition. You can configure your timer fire bean to > wait eg some longer before it fires the first message. >=20 > As long as you use the DeadLetterChannel you should in fact not worry > as it does redeliveries so in the next attempt it will usually succeed > as the producer is started in the meantime. However if you disable > redelivery etc. then the first message will not be delivered and lost. >=20 > But it would be best to wait a little before sending the very first > message. >=20 > Otherwise you can use some Camel API to find the processor and test > whether it is started with: isStarted() >=20 >=20 > On Wed, May 6, 2009 at 4:36 PM, ariekenb > wrote: >> >> I two beans named producer and consumer. =C2=A0Producer starts a >> java.util.Timer >> in its init method to pop every 100 ms and send a message to a SEDA queu= e >> (using a ProducerTemplate it got from @EndpointInject). =C2=A0Consumer h= as a >> method to receive messages from the queue. =C2=A0Here's the camel route: >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0id=3D"test"> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0id=3D"sedaEndpoint" >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0uri=3D"seda:test" /> >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0uri=3D"sedaEndpoint" /> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0uri=3D"bean:consumer?methodName=3DprocessMessage" /> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> >> >> I find sometimes just after Producer sends its first message, I get this >> error logged. =C2=A0This happens before Consumer has received any messag= es: >> >> 09:22:35,087 | ERROR | da:test thread:1 | DeadLetterChannel =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 >> =C2=A0| >> rg.apache.camel.processor.Logger =C2=A0203 | Failed delivery for exchang= eId: >> ID-swim4/48409-1241619754977/0-0. On delivery attempt: 0 caught: >> java.lang.IllegalStateException: No producer, this processor has not bee= n >> started! >> java.lang.IllegalStateException: No producer, this processor has not bee= n >> started! >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:78) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.management.InstrumentationProcessor.process(Instrumenta= tionProcessor.java:68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.j= ava:185) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.j= ava:132) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.management.InstrumentationProcessor.process(Instrumenta= tionProcessor.java:68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcess= or.java:52) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:69) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.Thread.run(Thread.java:619) >> >> >> This doesn't seem to cause anything bad to happen. =C2=A0Even when this >> exception >> happens, Consumer still receives all messages from Producer in order. >> >> I'm just wondering why this happens. =C2=A0Is there a race condition dur= ing >> startup so that Producer can get its endpoint injected before camel is >> ready >> to route messages to Consumer? =C2=A0Should I be concerned about this? >> -- >> View this message in context: >> http://www.nabble.com/SEDA-Component-Exception%3A-No-producer%2C-this-pr= ocessor-has-not-been-started%21-tp23407604p23407604.html >> Sent from the Camel - Users (activemq) mailing list archive at >> Nabble.com. >> >> >=20 >=20 >=20 > --=20 > Claus Ibsen > Apache Camel Committer >=20 > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > Apache Camel Reference Card: > http://refcardz.dzone.com/refcardz/enterprise-integration > Interview with me: > http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=3D789= 3-progress >=20 >=20 --=20 View this message in context: http://www.nabble.com/SEDA-Component-Exceptio= n%3A-No-producer%2C-this-processor-has-not-been-started%21-tp23407604p23409= 362.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.