On Tue, Feb 26, 2008 at 2:04 PM, lhe77 <[EMAIL PROTECTED]> wrote: > > Hi, > > actually I am developing a JBI compliant binding component for polling and > sending emails. > I will start here a discussion to put together all ideas and requirements > for this BC. So any > suggestion is welcome. > > State: > - The BC uses the JavaMail API to poll and send emails. (2 endpoints for > now) > > ToDo: > - Sending mails via spring mail. (via another endpoint) > - integrate frameworks like Velocity for email template handling
I'd definitely look at the Spring Mail API for the task of sending email messages. For polling a server for email messages, unfortunately Spring doesn't offer anything. You might consider looking at the Spring DefaultMessageListenerContainer (DMLC) architecture as an example of connecting to a system and a polling for messages. Although the DMLC is a JMS client, the same style of architecture would work for connecting to a mail server and polling for messages. For testing, I highly suggest looking at using EasyMock (http://easymock.com/). EasyMock will allow you to mock any Java API and makes testing a breeze where external systems are involved. I have mocked JMS brokers, JDBC accessible data sources and much more using EasyMock. By using EasyMock to mock the functionality of a mail server, you won't need to develop unit level tests using an actual mail server. This will be a huge time saver. Bruce -- perl -e 'print unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*" );' Apache ActiveMQ - http://activemq.org/ Apache Camel - http://activemq.org/camel/ Apache ServiceMix - http://servicemix.org/ Apache Geronimo - http://geronimo.apache.org/ Blog: http://bruceblog.org/
