views:

66

answers:

2

Hello,

I am building a community website using Grails and I want to implement user notifications exactly like stackoverflow.com. For instance, user will get notified for new events ('You have new comments', 'one of your favorite has changed'...) either by email or in his mailbox anytime he returns to the website.

I suppose that this is a common problem and I'd like to hear what easy solution do you advice for implementing the back-end in Grails realm. For instance, is Java Message Service a recommended solution for this?

Thank you.

+4  A: 

IMHO no. Java Message Service is basically to perform asynchronous or queued operations.

You just need a user messaging system and notification. I'm not aware of any plugin that could do it out of the box.

I suggest you to implement your own Message domain POGO bound to your user model with a markAsRead flag.

If you want to integrate this with email you can use JMS to decouple user navigation and email/sending. This is particularly useful if you have an high traffic website/webapp

Sammyrulez
I wouldn't say that JMS is absolutely not the way to go. If you're user base is going to be significant, having your app wait on emails to be sent for a lot of users isn't a good idea. It might be better to offload the notifications to a queue and let the queue feed a service that can handle it for you.But you can start simple, as Sammy suggested, and then implement JMS later, very easily. Especially if you start with pushing the work to a service tier.
Gregg
Agree. But I think fabien7474 was mislead by the world 'Message' in JMS assuming it was a user/email messaging management technology
Sammyrulez
A: 

I have used the http://grails.org/plugin/mail and the background-thread plugin. Not a "perfect" solution, but it leverages the grails eco-system and gets the job done.

Aaron Saunders