Version 11

    It is assumed that you've been through the Basic File Listener Quick Starter.

     

    Unzip the attached solution - BasicFileListenerEmail.zip

     

    Modify build.xml:

    • point the jbossesbhome.dir to your installation of JBoss ESB

    • point the jbosshome.dir to your installation of JBoss Application Server 4.0.4.GA with EJB3 profile

     

    Modify

    BasicFileListenerEmailConfig.xml

    :

    • point the inputDirURI attribute to where you have unzipped the solution

     

    Take note of this section in the

    config file

    :

    <NotificationList type="OK">
      <target class="NotifyEmail"
              sendTo="jbossesb@esb.com" 
              from="burr.sutter@jboss.com"
              subject="We received a file">
       </target>
    </NotificationList>
    

     

    Email notification settings must be "visible" from the Application Server's perspective.  The AppServer needs to be configured so that it can identify the SMTP server for email sending.

    You need to verify the settings in the

    jbossEsb.properties

    file in the %JBOSS_HOME%

    \server\default\conf

    directory.  This file contains the following settings:

    org.jboss.soa.esb.mail.smtp.host=@org.jboss.soa.esb.mail.smtp.host@
    org.jboss.soa.esb.mail.smtp.port=@org.jboss.soa.esb.mail.smtp.port@
    org.jboss.soa.esb.mail.smtp.user=@org.jboss.soa.esb.mail.smtp.user@
    org.jboss.soa.esb.mail.smtp.password=@org.jboss.soa.esb.mail.smtp.password@
    

    These settings are configured when you are following the instructions in the TrailBlazer document.  You can remove the "user" and "password" settings entirely if your SMTP server doesn't require authentication.

     

    Execute this command "ant run" from a command window and in the same directory as build.xml

     

    Rename one of the files in the InputDirectory and then hit your email client to see the email.

     

     

    Note: At this time, I'm not sure why the file content shows up twice in the email body.

     

    In the src folder for this example project you will find TestEmail.java and TestESBEmail.java which can be executed via "ant runtest".  These are useful if you are trying to prove that your email settings are accurate.  Another test is to use "telnet smtpServerHost 25" from a command window.