Going back to a java version I think I got something working:

                from("activemq:queue:OutgoingEmail").
                        
recipientList(el("smtp://localhost#${in.headers.deliver_to}")); 

Tailing the mail.log it looks like the delivery is being sent to the correct
locations!

I'd love to figure out howto do this in Spring XML - but I think I figured
out the growing pains of compiling this with Maven/adding the
dependencies/getting JUEL/etc.

-Eric


Er1c wrote:
> 
> Route[ [From[activemq:queue:OutgoingEmail]] -> [RecipientList[ null]]]]
> 
> using:
>     <route>
>       <from uri="activemq:queue:OutgoingEmail" />
>         <recipientList>
>           <recipients>
>             <el>"smtp://localhost#${in.headers.deliver_to}"</el>
>           </recipients>
>         </recipientList>
>     </route>
> 
> If I comment out the inner <recipients> I get:
>  Route[ [From[activemq:queue:OutgoingEmail]] -> [RecipientList[
> elExpression["smtp://localhost#${in.headers.deliver_to}"]]]]]
> 
> 
>     <route>
>       <from uri="activemq:queue:OutgoingEmail" />
>         <recipientList>
> <!--          <recipients>-->
>             <el>"smtp://localhost#${in.headers.deliver_to}"</el>
> <!--          </recipients>-->
>         </recipientList>
>     </route>
> 
> 
> I'm not actually seeing any email delivered though (nothing in the
> /var/log/mail.log as even attempted)...and even when I have debug enabled
> I'm not able to see routing errors printed anywhere when messages get
> added to OutgoingEmail...
> 
> What's the best way to see what ActiveMQ is trying to route it to?
> 
> If I take out the quotes around
> <el>"smtp://localhost#${in.headers.deliver_to}"</el> it throws a "broken
> pipe" issue
> 
> 
> Thanks,
> 
> Eric
> 
> 
> 
> James.Strachan wrote:
>> 
>> Apologies, I made a typo...
>> 
>> On 05/02/2008, Er1c <[EMAIL PROTECTED]> wrote:
>>>
>>> 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>
>> 
>> 
>> ${in.headers.deliver_to}
>> 
>> i.e. its the plural headers which maps to the Message.getHeaders() method
>> 
>> -- 
>> 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-tp15254242s22882p15306716.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to