camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Howto get an SMTP Endpoint to dynamically send to a Header Value
Date Mon, 04 Feb 2008 13:41:43 GMT
On 03/02/2008, Er1c <Eric@peters.org> wrote:
>
> I'm trying to figure out an easy way to use Spring XML (well anything really)
> to specify the delivery address of an SMTP endpoint from a header
>
> This is how I have the "generic" SMTP delivery:
>     <route>
>       <from uri="activemq:queue:OutgoingEmail" />
>       <to uri="smtp://localhost" />
>     </route>
>
> I have a header set called "deliver_to" that has the email address I'd want
> to email.
> Ideally, I would like to specify the from information (at least from an
> envelope standpoint) dyanmically as well - but I've already create standard
> evelope things like From:, Reply-To:, Subject: in the message being routed
> to the OutgoingEmail queue.

I think what you are asking for is that the output URI be dynamic made
up from some expression using the message headers / body right?

If so then this sounds like the dynamic recipient list pattern...

http://activemq.apache.org/camel/recipient-list.html

e.g. using EL something like

from("activemq:SomeQueue").recipientList().el("smtp://${in.header.to}@localhost");

i.e. using an EL expression to create the to URI

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message