WS-Notification
IBm Systems Journal

Events and Service oriented Architecture: The OASIS Web Services Notifictaion Specification

1, WS-Notification
2. WSN specifications standardize syntax and semantics of the message exchanges that establish and
manage subscriptions and the message exchanges that distribute information to subscribers.

3. An information provider, known as notification provider, that conforms to WSN can be subscribed
to by any WSn-complaint subscriber.
If they both use common WS binding (for example SOAP over HTTP) and network connectivity
they inter operate irrespective of their design, implementations nd geographic location.

4. Terminology and concepts:
    Situation: is an occurrence that is noted by one party and is of interest to other parties.
   
    Notification: one way message that conveys information about a situation to other services.
    Type of message specifies the information item it contains and format of the sequence of bytes.
    --WSN message type is represented by XML Scheme global element definition.
    -- Situation to notification is not one-to-one: A situation may give rise to many different notification,
          Also many situations may invoke a same  type of notification message (ex: general purpose error).

   Publisher: An entity that creates notification message instances. It does not have the responsibility of sending
   it to a consumer.

   Notification producer: A service responsible for sending notification to the appropriate consumers.
   May also serve as a producer; when it does not it is also known as notification broker.
   Responsible for maintaining a list of interested consumers and arranging for notification messages to be sent
   to those receivers,

   Notification Consumer: An entity that receives the notifications distributed by notification producers.
   Both push and pull are possible.  Pull consumer may be behind a firewall where push may not work.

   Subscription: An entity that represents the relationship between a notification consumer and a notification producer.
   May contain filter expressions, policies and context information. Lifetime : long running ? Limited time?

   Subscriber: static and dynamic subscriptions in event driven systems ; The subscribe-request message
   identifies a notification consumer. Notice this role is different from notification consumer. May be combined.

   Subscription Manager: a service that manages requests to query, delete or renew subscriptions.
 
   See Figure 1.

5. WS-Base Notification:  See Figure 2 and Figure 3.
     
    For a  web service to be a notification producer:
       -- its WSDL spec must include a prototype definition operation that contains subscribe-request and response
             message defined by WS-Base notification.
             These are defined as global elements in WS Base Notification XML namespace; WSDL porttype is also
              is also provided for convenience. Cut and paste this into WSDL spec of the service.
       --a “control message” whose format is defined by the WS-Base Notification specification.
           The request message includes the address of the notification consumer, encoded as an endpoint reference
           as defined by WS-Addressing.
       -- In response to this message, the notification producer creates a subscription resource and sends a
           subscribe response which contains another endpoint reference. This endpoint reference refers to
           the subscription itself.
      Notification can be:
       -- application specific one-way format
       -- a WS base notification 's Notify
       -- "policy" specifies what format of the above two to use.

      Simplest form of subscribe-request contains an endpoint reference for a notification consumer.
      May result in inefficient use of all involved.
      Solution: Filtering:

6. Filtering: WS-BAse Notification provides for these type of filtering:
    Topic filter
     Message filter
     Producer state filter

7. Subscription Manager
8. Subscription lifetime
=============================================================================
2/9:
WS-Topics:

1. categorization of kinds of notification and associated message types

2. topic filter, producer notification kinds, access control

3. Topic namespace: every topic wll be assigned to a XML namespace
    URI is used to refer to the XML namespace, thus XML namespace URI + topic name makes the topic globally unique.

4.  topic namespace: http://example.org/topicSpace/example1
     tns:: is a prefix used for specifying this URI
   now you can refre to tns:t1, tns:t4 etc. tns:t4/t6
   topic tress have the usual advanteages of the tree structure:  better organization, grouping, scalability, support Xpath
    search capabilities.

5. See Figure 5 and 6.

6. Thepaper also discusses how  a topic expression can be formed.

7. WS-Brokered Notification
   See Figure 7.
   Is a WS that is between publisher and notification producer.
   (remember Subcription Manager is between Notification Consumer and Notofication Producer.)
    It decouples the publisher and notification producer. "decoupling" is an important pattern in WS.

8. NB is both a notifictaion consumer as well as notification producer.

9. Paper goes on disuss benefits of brokered notification:
    -- It can take the role of Subscription manager
   -- It can reduce number of inter-service connections and references
   -- can be finder service
   -- can provide anonymous notification
   -- additional transformation can be provided (value added functions)

10. See Figure 8.
     
11. Figure 9 is about demand based notifictaion. NP, NB, NC. NP registers with NB, sends notification,
NB takes care of secuirty details etc. and then send notifictaion to any subscribers.

12. Enterprise Service Bus (ESB) & Events     
     ESB mediates requests between paricipating services. both tradtional request-response and event-based

13. Aspects of ESB;
     - virtualizes services, services connect to "bus"
     - infrastrcuture can span WAn and many servers
     - provides mediation capabilities

14. Can handle: IBM's MQ, Java JMS, .., Notifications of WSN, IBM's common event inftastructure

15. Read about the nice example on stock market at the end.