You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alfred Hiebl <a....@mic-cust.com> on 2011/01/25 18:33:34 UTC

Schedule file/mail endpoint

Hi,

I'd like to ask for a best practice for a situation which I hope to be a
common use-case. In our routes we consume data from polling endpoints like
mail or file which do not support concurrent consumers out-of-the-box. We
need CRON schedules; so plan to use camel-quartz together with pollEnrich.

We want to deploy Camel in a Tomcat server on two app server nodes. For
load-balancing and availability reasons the same routes should run on both
nodes.

How do I best avoid duplicate processing of messages? Do I need to implement
a mutex-type function myself or is there an easier way to guarantee this in
Camel?

Best regards,
Alfred

-- 
View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3356666.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Schedule file/mail endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Quartz suports running in a clustered environment where it can trigger
tasks to only run on one node.


On Tue, Jan 25, 2011 at 6:33 PM, Alfred Hiebl <a....@mic-cust.com> wrote:
>
> Hi,
>
> I'd like to ask for a best practice for a situation which I hope to be a
> common use-case. In our routes we consume data from polling endpoints like
> mail or file which do not support concurrent consumers out-of-the-box. We
> need CRON schedules; so plan to use camel-quartz together with pollEnrich.
>
> We want to deploy Camel in a Tomcat server on two app server nodes. For
> load-balancing and availability reasons the same routes should run on both
> nodes.
>
> How do I best avoid duplicate processing of messages? Do I need to implement
> a mutex-type function myself or is there an easier way to guarantee this in
> Camel?
>
> Best regards,
> Alfred
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3356666.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Schedule file/mail endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah the mail consumer should work with pollEnrich.
Seems like a NPE exception. Maybe you can dig in the source and see why?

Fell free to open a JIRA, so we can look into it and have it fixed.


On Thu, Jan 27, 2011 at 12:57 PM, Alfred Hiebl <a....@mic-cust.com> wrote:
>
> Hi,
>
> thanks a lot for your quick response and suggestions!!
>
> Now that I played a little more with my example, I ran into this issue.
> Should pollEnrich work with the mail component?
>
>  <route id="myTest">
>     <from uri="timer://foo?fixedRate=true&amp;period=10000"/>
>     <pollEnrich
> uri="imap://mail-server?username=xxx&amp;password=yyy&amp;folderName=Inbox&amp;delete=false"/>
>     <to uri="log:at.mic.edis?showAll=true&amp;multiline=true"/>
>  </route>
>
> I end up with this exception:
>
> 2011-01-27 12:46:32,111 [foo] ERROR DefaultErrorHandler - Failed delivery
> for exchangeId: ID-E6500-ahi-57782-1296128776395-0-5. Exhausted after
> delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException: Failed
> to extract body due to: null. Exchange: Exchange[MailMessage:
> com.sun.mail.imap.IMAPMessage@10b95f2]. Message:
> com.sun.mail.imap.IMAPMessage@10b95f2
> org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
> Exchange: Exchange[MailMessage: com.sun.mail.imap.IMAPMessage@10b95f2].
> Message: com.sun.mail.imap.IMAPMessage@10b95f2
>        at
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:265)[camel-mail-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:92)[camel-mail-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:136)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.impl.DefaultMessage.copyFrom(DefaultMessage.java:52)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.ExchangeHelper.copyResultsPreservePattern(ExchangeHelper.java:244)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.PollEnricher$CopyAggregationStrategy.aggregate(PollEnricher.java:202)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.PollEnricher.process(PollEnricher.java:151)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:143)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:78)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:104)[camel-core-2.5.0.jar:2.5.0]
>        at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:49)[camel-core-2.5.0.jar:2.5.0]
>        at java.util.TimerThread.mainLoop(Unknown Source)[:1.5.0_22]
>        at java.util.TimerThread.run(Unknown Source)[:1.5.0_22]
>
> Best Alfred
> --
> View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3359573.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Schedule file/mail endpoint

Posted by Dan Checkoway <dc...@gmail.com>.
Alfred,

Why not just use the mail component's consumer.delay instead of the
timer+pollEnrich?  i.e. something like this:

<route id="myTest">
  <from
uri="imap://mail-server?username=xxx&password=yyy&folderName=Inbox&delete=false&consumer.delay=10000"/>
  <to uri="log:at.mic.edis?showAll=true&multiline=true"/>
</route>

Hope this helps,
Dan

On Thu, Jan 27, 2011 at 6:57 AM, Alfred Hiebl <a....@mic-cust.com> wrote:

>
> Hi,
>
> thanks a lot for your quick response and suggestions!!
>
> Now that I played a little more with my example, I ran into this issue.
> Should pollEnrich work with the mail component?
>
>  <route id="myTest">
>     <from uri="timer://foo?fixedRate=true&amp;period=10000"/>
>     <pollEnrich
>
> uri="imap://mail-server?username=xxx&amp;password=yyy&amp;folderName=Inbox&amp;delete=false"/>
>     <to uri="log:at.mic.edis?showAll=true&amp;multiline=true"/>
>  </route>
>
> I end up with this exception:
>
> 2011-01-27 12:46:32,111 [foo] ERROR DefaultErrorHandler - Failed delivery
> for exchangeId: ID-E6500-ahi-57782-1296128776395-0-5. Exhausted after
> delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException: Failed
> to extract body due to: null. Exchange: Exchange[MailMessage:
> com.sun.mail.imap.IMAPMessage@10b95f2]. Message:
> com.sun.mail.imap.IMAPMessage@10b95f2
> org.apache.camel.RuntimeCamelException: Failed to extract body due to:
> null.
> Exchange: Exchange[MailMessage: com.sun.mail.imap.IMAPMessage@10b95f2].
> Message: com.sun.mail.imap.IMAPMessage@10b95f2
>        at
>
> org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:265)[camel-mail-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:92)[camel-mail-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:136)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.impl.DefaultMessage.copyFrom(DefaultMessage.java:52)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.ExchangeHelper.copyResultsPreservePattern(ExchangeHelper.java:244)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.PollEnricher$CopyAggregationStrategy.aggregate(PollEnricher.java:202)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.PollEnricher.process(PollEnricher.java:151)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.Pipeline.process(Pipeline.java:143)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.Pipeline.process(Pipeline.java:78)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:104)[camel-core-2.5.0.jar:2.5.0]
>        at
>
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:49)[camel-core-2.5.0.jar:2.5.0]
>        at java.util.TimerThread.mainLoop(Unknown Source)[:1.5.0_22]
>        at java.util.TimerThread.run(Unknown Source)[:1.5.0_22]
>
> Best Alfred
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3359573.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Schedule file/mail endpoint

Posted by Alfred Hiebl <a....@mic-cust.com>.
Hi,

thanks a lot for your quick response and suggestions!!

Now that I played a little more with my example, I ran into this issue.
Should pollEnrich work with the mail component? 

 <route id="myTest">
     <from uri="timer://foo?fixedRate=true&amp;period=10000"/>
     <pollEnrich
uri="imap://mail-server?username=xxx&amp;password=yyy&amp;folderName=Inbox&amp;delete=false"/> 
     <to uri="log:at.mic.edis?showAll=true&amp;multiline=true"/>
  </route>

I end up with this exception:

2011-01-27 12:46:32,111 [foo] ERROR DefaultErrorHandler - Failed delivery
for exchangeId: ID-E6500-ahi-57782-1296128776395-0-5. Exhausted after
delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException: Failed
to extract body due to: null. Exchange: Exchange[MailMessage:
com.sun.mail.imap.IMAPMessage@10b95f2]. Message:
com.sun.mail.imap.IMAPMessage@10b95f2
org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
Exchange: Exchange[MailMessage: com.sun.mail.imap.IMAPMessage@10b95f2].
Message: com.sun.mail.imap.IMAPMessage@10b95f2
	at
org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:265)[camel-mail-2.5.0.jar:2.5.0]
	at
org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:92)[camel-mail-2.5.0.jar:2.5.0]
	at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:136)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.impl.DefaultMessage.copyFrom(DefaultMessage.java:52)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.ExchangeHelper.copyResultsPreservePattern(ExchangeHelper.java:244)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.PollEnricher$CopyAggregationStrategy.aggregate(PollEnricher.java:202)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.PollEnricher.process(PollEnricher.java:151)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:143)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.Pipeline.process(Pipeline.java:78)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:104)[camel-core-2.5.0.jar:2.5.0]
	at
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:49)[camel-core-2.5.0.jar:2.5.0]
	at java.util.TimerThread.mainLoop(Unknown Source)[:1.5.0_22]
	at java.util.TimerThread.run(Unknown Source)[:1.5.0_22]

Best Alfred
-- 
View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3359573.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Schedule file/mail endpoint

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Your file poller failover requirement can be addressed very simply.

You need to create a JMX event listener to listen to camel events (see link
below for example)

http://camel.apache.org/camel-jmx.html
http://camel.apache.org/camel-jmx.html 

When a camel context, connection or montored entity is not reachable, you
can start a fresh route in a different camel context to achieve the same
effect. The idea is to have a heartbeat going that is checked to ensure
things are up and when they are not apply the failover strategy.

Hope this helps.

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
-- 
View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3358022.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Schedule file/mail endpoint

Posted by Alfred Hiebl <a....@mic-cust.com>.
Hi Ashwin,

Agreed. As soon as the messages are in my JMS queue the problem is solved.

But then the question is, how do I failover my single poller in case the one
node goes down that runs it. 

And, preferrably, the single poller is also a Camel route. This implies that
I have differing route configurations on my nodes. From a practical/support
point of view I would much prefer to have identical configurations on all
nodes. 

Thanks,
Alfred
-- 
View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3357538.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Schedule file/mail endpoint

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Unless, I am missing something, can you not use a single poller to drop the
messages from files on to a JMS queue and then use concurrent consumers to
work these messages on different machines...?

JMS should give you guaranteed delivery, idempotent behavior, load
balancing, failover, rollbacks and all that good stuff... In fact you can
also run Camel within the ActiveMQ JMS Broker if you so choose...

Cheers,

Ashwin...
 

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
-- 
View this message in context: http://camel.465427.n5.nabble.com/Schedule-file-mail-endpoint-tp3356666p3357232.html
Sent from the Camel - Users mailing list archive at Nabble.com.