best way to send messages to all subscribers with multiple subscriptions and multiple providers

Posted by coding_idiot on Programmers See other posts from Programmers or by coding_idiot
Published on 2013-10-26T17:13:39Z Indexed on 2013/10/26 22:13 UTC
Read the original article Hit count: 246

Filed under:

I'm writing an application in which -

Many users can subsribe to posts made by another users.

So for a single publisher there can be many subscribers.

When a message is posted by an user X, all users who have subscribed to messages of User X will be sent an email.

How to achieve this ? I'm thinking of using publish-subscribe pattern.

And then I came through JMS. Which is the best JMS implementation to use according to your experience ?

Or else what else solution do you propose to the given problem ?

Shall I go for a straight-forward solution ?: User x posts a message, I find all users (from database) who subscribe to user x and then for every user, I call the sendEmail() method.

[EDIT] My intention here is not to send-emails. I'm really sorry if it wasn't clear. I also have to send kind of system-notifications apart from Email to all subscribers.

Right now, I've implemented the email-sending as a threadPool

© Programmers or respective owner

Related posts about design-patterns