Name

Publish-Subscribe Pattern

Goal

Send a single copy of a message for delivery to multiple recipients who may or may not be individually known to the sender.

Participants

Sender

Originates a message of a particular type.

Messaging server

Accepts a message from a sender and delivers it to zero or more recipients.

Recipients

Register to receive (subscribe to) a particular type of message.

Interactions

Rather than identify a particular recipient, the sender identifies a message as being of a certain type. Recipients may then register with the messaging server as being interested in receiving all messages of a particular type. When a sender creates a new message, all recipients who have expressed interest in receiving messages of that type will receive a copy.

Notes

In a JMS environment, publish-subscribe is implemented via the Topic interface. In an SMTP/JavaMail environment, implementing publish-subscribe requires additional infrastructure, either within your application or within your mail server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.161.225