1 Reply Latest reply on Nov 4, 2013 9:10 AM by dward

    How to make the Apache Camel SMTP mail:host value a variable

    gcollis

      I cannot find a way to make the  mail:host binding a variable in the switchyard.xml.

       

      I try something like the following.

      <mail:host>$%7Bsmtp.mail.host%7D</mail:host>

       

      and then I set smtp.mail.host in a properties file.

       

      I've also tried with double brackets, etc. Everytime I use a variable I get :-

      Caused by: java.lang.IllegalArgumentException: host must be specified and not empty

       

      the system property (smtp.mail.host) exists and I can log it to the logs but it never gets picked up in proceesing. Other variables like path properties in the file bindings work.

       

      If I use a fixed-value then the mail works. But this means I have to change it between deploying between test and production systems. This is not practical.

       

      thanks, Graeme

       

      The correct answer was ${smtp.mail.host}. That is using dollar with curly braces. I thought I had tried this and where I got confused is that in the file bindings $ with curly braces does not work. There you have to use the Hex representation of the braces. I don't know why but that is another question. Thanks for the answer David.