Announcement Announcement Module
Collapse
No announcement yet.
Multiple Host Configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Host Configuration

    Hi Spring team,

    I am trying to create multiple host entries in the config file for org.springframework.mail.javamail.JavaMailSenderIm pl so I can build in redundancy into my application, my current settings are as follows:

    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">

    <property name="host">
    <value>mailhost2.server.com</value>
    </property>

    <property name="host">
    <value>mailhost.server.com</value>
    </property>

    </bean>

    Unfortunately when I try to send mails now they will only be forwarded from mailhost2. How can I configure the application to send them using both?
    Last edited by barryoreilly; Sep 14th, 2006, 11:37 PM.

  • #2
    Not sure if this is possible by default with only one JavaMail. What you can do is create a simple wrapper class which can accept multiple hosts and the cycle through all of them and sending message on each one.
    Make sure you ignore any error so the mail can be send to the next server.
    One alternative would be on the server side to make your initial mail host redundant - the advantage is that the client (java application) is unaware of this behavior (which can be later on tweaked) plus you are likely to have a better/faster/reliable solution working directly with the mail server.

    Comment

    Working...
    X