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

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

4

Hope you are not looking for a platform specific solution

If Yes, your requirement highlights a pub/sub pattern. I handled the same using RabbitMQ which has specific support for Pub/Sub scenario.

Without going in to granular details, to give you an idea on RabbitMQ’s pub/sub model

It has something called “exchange” in addition to “producer”,”queue”, & “consumer”

The core idea on this messaging model is that the producer never sends any messages directly to a queue. A quite often the producer doesn’t even know if a message will be delivered to any queue at all. The producer can only send messages to an exchange. An exchange receives messages from producers and the other side it pushes them to queues.

It supports different exchange types to satisfy your various needs – direct, topic, headers and fanout.

This means greater flexibility to de-couple core MQ functionality from the business logic, which you may want to impose on message formats/delivery/retry logic

I used “topic” exchange type which supports message routing/filtering just by looking at message name/title.

To give you a best use of this logic – I had a weird requirement (on pub/sub model) to maintain the list of active subscribers , which I managed to get it done by introducing a heartbeat (topic based) message on the same queue

For the said reasons, and high accuracy on message delivery, and good performance results of supported AMQP protocol, I felt quite happy about my choice

Disclaimer : I am not advocating here that RabbitMQ is the only choice, but sharing this as my nice experience with a smart solution. There are quite few pub/sub solutions out there in the market.

I also found WAMP interesting while exploring various options,but didn’t use it for any commercial implementation

0

I agree with Sarien in that XMPP can be used for the purpose. XEP-0060 – Publish / Subscribe does exactly what you are trying to do… It can send notifications to the subscribers, as well as the payload (on request, or as soon as it is generated). You will have to look deeper though to see if this fits your needs…

Hope it helps.

5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật