You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ybrown <yb...@opentext.com> on 2009/06/30 18:50:23 UTC

deadLetterChannel and Camel 1.6.1

Here is my RouteBuilder
    RouteBuilder builder = new RouteBuilder() {
            public void configure() {
            	errorHandler(deadLetterChannel("mock:error").onRedelivery(new
RedeliverProcessor()).initialRedeliveryDelay(redeliveryDelay).maximumRedeliveries(maximumRedeliveries));
                Integer delay = config.getEmailPullDelay();
            	StringBuffer url = new StringBuffer(config.getEmailServerURL()
+ "?password=" + config.getEmailUserPassword() +
"&deleteProcessedMessages=true");
            	from(url.toString()).process(new MailProcessor(_secSession));
            }
        };

What I'd like to do instead, is the following:
Instead of using onRedelivery()
I'd like to have something that will handle a messages that got sent to
deadLetterChannel.
Specifically, I want all messages that failed, sent to another email
address.

Is it possible in Camel 1.6.1? and if yes, what is the best way of
implementing it?
I tired using "impas://" instead of "mock:error"
errorHandler(deadLetterChannel("imaps://name@imap.gmail.com...."))  and
although I didn't get any errors in the log, I didn't get any emails either.
Any suggestions?

Yuliya
-- 
View this message in context: http://www.nabble.com/deadLetterChannel-and-Camel-1.6.1-tp24275516p24275516.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: deadLetterChannel and Camel 1.6.1

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jun 30, 2009 at 6:50 PM, ybrown<yb...@opentext.com> wrote:
>
> Here is my RouteBuilder
>    RouteBuilder builder = new RouteBuilder() {
>            public void configure() {
>                errorHandler(deadLetterChannel("mock:error").onRedelivery(new
> RedeliverProcessor()).initialRedeliveryDelay(redeliveryDelay).maximumRedeliveries(maximumRedeliveries));
>                Integer delay = config.getEmailPullDelay();
>                StringBuffer url = new StringBuffer(config.getEmailServerURL()
> + "?password=" + config.getEmailUserPassword() +
> "&deleteProcessedMessages=true");
>                from(url.toString()).process(new MailProcessor(_secSession));
>            }
>        };
>
> What I'd like to do instead, is the following:
> Instead of using onRedelivery()
> I'd like to have something that will handle a messages that got sent to
> deadLetterChannel.
> Specifically, I want all messages that failed, sent to another email
> address.
>
> Is it possible in Camel 1.6.1? and if yes, what is the best way of
> implementing it?
> I tired using "impas://" instead of "mock:error"
> errorHandler(deadLetterChannel("imaps://name@imap.gmail.com...."))  and
> although I didn't get any errors in the log, I didn't get any emails either.
> Any suggestions?

Well that should be it. Just set the endpoint of choice in dead letter
channel and it will be used as destination when an message failed.
To make it a bit easier you can a direct endpoint to direct it to
another route where you can do a bit logging and emailing

errorHandler(deadLetterChannel("direct:failed"))...

from("direct:failed")
   .to("log:failed")
   .to("imaps://...");

Then you should set it logged and then its just the last part. Sending
the failed email that might be an issue.

Are you sending to the same mail server / account as you read? Maybe
that can be an issue as you already hold a mail session when reading.
Maybe try with another user account so its not the same that reads and
sends the failed mail.





>
> Yuliya
> --
> View this message in context: http://www.nabble.com/deadLetterChannel-and-Camel-1.6.1-tp24275516p24275516.html
> Sent from the Camel - Users 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