best way to send messages to all subscribers with multiple subscriptions and multiple providers
- by coding_idiot
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