struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter S. Hamlen" <pham...@mail.com>
Subject Re: User Notification
Date Tue, 24 Sep 2002 18:05:14 GMT
I've had to implement "mail like systems" like this in a variety of
places.  If I could just make some suggestions:

1)  Notification is usually accomplished as a side-effect of how you
store your messages.  For instance, if each message is stored with a
"read-flag", then it's a simple query to find all the messages that are
unread.
    Generally speaking, object models around messages look something
like:
    Mailbox
       Folder
          Message A
          Message B
          Message C
       Folder
          Message E
          Message F

    So you probably want to be able to ask the Mailbox if there are any
unread messages (which then asks the folders which check the messages.)

2)  A database is usually a bad place to store messages, unless they are
very simple and short.  Do you ever want to support attachments?  What
about quotas?  What about cleaning out unread messages?  How do you
intend to monitor the message system?

    I would suggest storing messages on the filesystem, and putting up a
simple server to access the data.

3)  If something is "sort of like email", strongly consider whether it
actually is email.  If you can actually treat it as "email", then you
can use all the standard techniques for mail, which include:
   a) "notification" of mail receipt 
   b) MIME attachments - plus the whole Javax.mail packages for reading
MIME-encoded messages
   c) standard protocols for fetching mail
   d) standard systems for filtering mail (a la procmail, etc.)
   e) standard monitoring techniques
   f) automatic queue-mechanisms in case part of the system is down.

  For example:
  We once implemented a "mail-like" system which started as simply as
you've described it.  Then we implemented sending an email when you
received a message  (the email contained a link to read the message). 
Then we implemented "non-web" access via POP3 protocol.  Then we
implemented attachments.
  In the end, we had a system that had grown into a mail system but was
all homegrown and awful.
  We ended up replacing it with Sendmail and a filesystem storage
mechanism (mbox format), and everything became much cleaner.  Plus our
system administrators could monitor the message system as if it were
just a mail system.
   
 Of course, your mileage may vary - all you might need is the simple
ability to send notes back and forth. But I'd recommend at exploring
whether the system will grow up to be a mail system and so should just
start as a mail system.

HTH
-Peter

On Mon, 2002-09-23 at 14:11, Vernon Wu wrote:
> I need to implement a message system, sort like email but inside the Java web application
only for its users. After one 
> user, A, sends a message to another, B, B shall be notified to retrieve the updated messages
if B is on line. I plan to 
> implement messages as stored in a DOM. My question is how the notification shall be implemented.
 I only use a web 
> container, and considering to add in a JMS server for IM.
> 
> Any suggestions?
> 
> Thanks,
> 
> Vernon
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message