struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Higginbotham" <jhigginbot...@betweenmarkets.com>
Subject RE: User Notification
Date Mon, 23 Sep 2002 22:23:03 GMT
Ok, then you could use JMS to store a message in a topic and check for
it on each request to show the user an indicator if a message exists.
But, unless you turn off persistence for the topic, you will be using a
DB on the backend anyway. And a query against a DB on a field that is
indexed (such as the userid) would be very fast. 

The other option (assuming you are using only 1 server or have sticky
sessions in place) is to create a session manager that you store these
messages in a list, stored in a hash keyed by user id. It would probably
be a singleton within the app server's VM. You would then check this
manager on each request and show the indicator/message as appropriate.
Just attach a session listener so that when the user's session times out
or you kill it forcefully, your session manager will drop any existing
messages. Course, this isn't persistent so if the user isn't signed in,
they will never get the message (thus, see option 1 and previous posts
to this list). 

James

> -----Original Message-----
> From: Vernon Wu [mailto:vernonw@gatewaytech.com] 
> Sent: Monday, September 23, 2002 1:44 PM
> To: Struts Users Mailing List
> Subject: Re: User Notification
> 
> 
> 
> I want to have a better implementaiton over unnecessary DB 
> access. That is the reason I would like to use a 
> notification mechanism. 
> 
> 
> 9/23/2002 2:41:05 PM, Eddie Bush <ekbush@swbell.net> wrote:
> 
> >Sounds like a simple DB-lookup to me.  You aren't going to update the
> >client until they refresh at page at least.  You'd just have 
> to include 
> >something that polled for new messages in each page you 
> wanted them to 
> >receive notification.  I'm not familiar with what you mean 
> by "stored as 
> >a DOM" or the implications of that, so maybe this is a bad 
> suggestion ;-)
> >
> >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
> >>
> >
> >--
> >Eddie Bush
> >
> >
> >
> >
> >--
> >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>
> 
> 

--
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