It is assumed that you've been through the Basic File Listener Quick Starter.
Unzip the attached solution - BasicFileListenerEmail.zip
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
point the inputDirURI attribute to where you have unzipped the solution
Take note of this section in the
<NotificationList type="OK"> <target class="NotifyEmail" sendTo="email@example.com" from="firstname.lastname@example.org" 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
file in the %JBOSS_HOME%
directory. This file contains the following settings:
email@example.com@ firstname.lastname@example.org@ email@example.com@ firstname.lastname@example.org@
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.