Results 1 to 2 of 2

Thread: Multiple Host Configuration

  1. #1

    Default 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 at 11:37 PM.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •