struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <ekb...@swbell.net>
Subject Re: User Notification
Date Tue, 24 Sep 2002 01:21:14 GMT
I was expounding on James' response - saying that you could actually 
persist the message somewhere on top of what he suggest for the session 
manager.  If you persist the messages, they will be there when the user 
arrives.  You would have to do an initial check for messages when they 
login, but could rely on the session manager from that point on (for 
notification).

When a user sends a message (this is an estimation - I do not know JMS) 
you would persist the message (using whatever method you like best) and 
the queue a message to be sent so the receiver would be notified if they 
were on.  If they're on, great - they get instant (as instant as a 
refresh that is) notification of the message.  If they aren't on, you 
just do the check when they login.

Disclaimer:  I know nothing about how JMS works, and don't want to 
pretend to be authoritative.  I was trying to make a logical following 
to James' response, but, not knowing JMS architechture myself, I could 
be way off-base.  My point is your could probably use JMS for 
notification and use a DB/XML/whatever for actual persistence.

Vernon Wu wrote:

>I don't follow you. Can you explain with more details?
>
>9/23/2002 3:55:04 PM, Eddie Bush <ekbush@swbell.net> wrote:
>
>>Yeah you could persist it to a DB though and show the message from the 
>>DB when they ask to do that... and just rely on your 
>>session-manager-thingie for notification.
>>
>>James Higginbotham wrote:
>>
>>>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
>>>

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


Mime
View raw message