Thanks for the response, I hadn't considered the RecipientList approach...
I tried something like:
<route>
<from uri="activemq:queue:OutgoingEmail" />
<recipientList>
<recipients>
<el>"smtp://localhost#${in.header.deliver_to}"</el>
</recipients>
</recipientList>
</route>
But when I look at the log file I'm still seeing OutgoingEmail =>
RecipientList [Null]
Even the example in the Design Pattern docs - will show me a null
RecipientList
<camelContext id="buildDynamicRecipientList"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="seda:a"/>
<recipientList>
<recipients>
<header name="foo"/>
</recipients>
</recipientList>
</route>
</camelContext>
I made sure to put camel-juel-1.2.0 into my lib directory - would there be
others I need to add too?
-Eric
James.Strachan wrote:
>
> On 03/02/2008, Er1c <[EMAIL PROTECTED]> 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://[EMAIL PROTECTED]");
>
> i.e. using an EL expression to create the to URI
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
--
View this message in context:
http://www.nabble.com/Howto-get-an-SMTP-Endpoint-to-dynamically-send-to-a-Header-Value-tp15254242s22882p15291023.html
Sent from the Camel - Users mailing list archive at Nabble.com.