On Wed, May 6, 2009 at 5:39 PM, ariekenb <[email protected]> wrote:
>
> 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 second
> apart)?
Yes in Camel 1.x the DLC is the default error handler.


>
> 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.
Yeah as the SEDA consumer only have 1 consumer. Unless you add
concurrentConsumer=5 to the SEDA queue.
Requires Camel 1.6.1+


>
> 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.
Yeah I guess you can check the camel context itself if its started.
There where some changes recently regarding this. Might work better in
1.6.1+.
There is a JIRA Ticket somewhere on this. Dont have time to find it.

Its dinner time. Take care and see you tomorrow.


>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Yeah its a race condition. You can configure your timer fire bean to
>> wait eg some longer before it fires the first message.
>>
>> 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.
>>
>> But it would be best to wait a little before sending the very first
>> message.
>>
>> Otherwise you can use some Camel API to find the processor and test
>> whether it is started with: isStarted()
>>
>>
>> On Wed, May 6, 2009 at 4:36 PM, ariekenb <[email protected]>
>> wrote:
>>>
>>> I two beans named producer and consumer.  Producer starts a
>>> java.util.Timer
>>> in its init method to pop every 100 ms and send a message to a SEDA queue
>>> (using a ProducerTemplate it got from @EndpointInject).  Consumer has a
>>> method to receive messages from the queue.  Here's the camel route:
>>>
>>>        <camel:camelContext
>>>                id="test">
>>>
>>>                <camel:endpoint
>>>                        id="sedaEndpoint"
>>>                        uri="seda:test" />
>>>
>>>                <camel:route>
>>>                        <camel:from
>>>                                uri="sedaEndpoint" />
>>>                        <camel:to
>>>
>>>  uri="bean:consumer?methodName=processMessage" />
>>>                </camel:route>
>>>
>>>        </camel:camelContext>
>>>
>>>
>>> I find sometimes just after Producer sends its first message, I get this
>>> error logged.  This happens before Consumer has received any messages:
>>>
>>> 09:22:35,087 | ERROR | da:test thread:1 | DeadLetterChannel
>>>  |
>>> rg.apache.camel.processor.Logger  203 | Failed delivery for exchangeId:
>>> ID-swim4/48409-1241619754977/0-0. On delivery attempt: 0 caught:
>>> java.lang.IllegalStateException: No producer, this processor has not been
>>> started!
>>> java.lang.IllegalStateException: No producer, this processor has not been
>>> started!
>>>        at
>>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:78)
>>>        at
>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>>        at
>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:185)
>>>        at
>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:132)
>>>        at
>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>>        at
>>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>>>        at
>>> org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:69)
>>>        at java.lang.Thread.run(Thread.java:619)
>>>
>>>
>>> This doesn't seem to cause anything bad to happen.  Even when this
>>> exception
>>> happens, Consumer still receives all messages from Producer in order.
>>>
>>> I'm just wondering why this happens.  Is there a race condition during
>>> startup so that Producer can get its endpoint injected before camel is
>>> ready
>>> to route messages to Consumer?  Should I be concerned about this?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/SEDA-Component-Exception%3A-No-producer%2C-this-processor-has-not-been-started%21-tp23407604p23407604.html
>>> Sent from the Camel - Users (activemq) mailing list archive at
>>> Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> 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=7893-progress
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/SEDA-Component-Exception%3A-No-producer%2C-this-processor-has-not-been-started%21-tp23407604p23409362.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

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=7893-progress

Reply via email to