Database Reference
In-Depth Information
The publish/subscribe pattern
One of the biggest benefits of using the ESB technology is the benefits of the publish/sub-
scribe message pattern; refer to http://en.wikipedia.org/wiki/Publish-subscribe_pattern .
The publish/subscribe pattern has a publisher that sends messages to a queue, say a MSMQ
MyPublisher queue. Subscribers, say Subscriber1 and Subscriber2 , will listen
for messages on the queue that the subscribers are defined to take from the queue. If
MyPublisher cannot process the messages, it will return them to the queue or to an error
queue, based on the reasons why it could not process the message. The queue that the sub-
scribers are looking for on the queue are called endpoint mappings. The publisher endpoint
mapping is usually based on the default of the project's name. This concept is the corner-
stone to understand NSB and ESBs. No messages will be removed, unless they are expli-
citly told to be removed by a service. Therefore, no messages will be lost, and all are ac-
counted for from the services. The configuration data is saved to the database. Also, the
subscribers can respond back to MyPublisher with messages indicating that everything
was alright or not using the queue.
So why is this important? It's because all the messages can then be accounted for, and feed-
back can be provided to all the services. A service is a Windows service that is created and
hosted by the NSB host program. It could also be a Windows command console program or
even an MVC program, but the service program is always up and running on the server,
continuously checking queues and messages that are sent to it from other endpoints.
These messages could be commands, such as instructions to go and look at the remote serv-
er to see whether it is still running, or data messages such as sending a particular payment
to the bank through a web service. For NSB, we formalize that events are used in publish/
subscribe, and commands are used in a request-response message exchange pattern.
Search WWH ::




Custom Search