WS-Notification: How client applications interact at runtime
Applications interact with the notification broker through the web service message exchanges defined in the WS-Notification standards.
The relationship between the five WS-Notification roles, NotificationBroker, PublisherRegistrationManager, NotificationProducer, SubscriptionManager, and NotificationConsumer, are shown in the following diagram:
Figure 1. Relationships between roles
These roles equate to three web service port types against which the application can invoke operations:
- NotificationBroker (which is an extension of the NotificationProducer and NotificationConsumer roles)
- SubscriptionManager
- PublisherRegistrationManager
The first point of contact for an application will always be the NotificationBroker port type. Applications invoke operations against this endpoint to create subscriptions, insert notification events into the system or register themselves as publishers. The SubscriptionManager and PublisherRegistrationManager objects work with the NotificationBroker to provide the overall functions.
References to the SubscriptionManager and PublisherRegistrationManager are returned to the application as a result of calls to the NotificationBroker. In particular a reference to the SubscriptionManager is returned from the Subscribe operation of the NotificationBroker. This allows an application to influence the lifecycle of the Subscription resource once it has been created. Similarly a reference to the PublisherRegistrationManager is returned from the RegisterPublisher operation on the NotificationBroker and allows the application to influence the lifecycle of the publisher registration.
Because applications interact with the broker entirely through WS-Notification message exchanges, the applications are unaware that the NotificationBroker, SubscriptionManager and PublisherRegistrationManager services are provided by WebSphere Application Server. This means we can modify the application to use any NotificationBroker provider, for example one provided by a different vendor or on a different server, by modifying the endpoint address against which the application makes its web services invocations.
WS-Notification defines the following roles in which an application can interact with the NotificationBroker. These roles define the use cases for applications.
- Publisher
- A Publisher sends a notification message to a Broker or NotificationConsumer in order to insert event notifications into the system. A Publisher application does not expose a web service endpoint.
- Subscriber
- A Subscriber makes a subscription on behalf of a (possibly different) NotificationConsumer application. A Subscriber application exposes a web service endpoint.
- NotificationConsumer
- A NotificationConsumer receives notification messages:
- A "Push Consumer" application exposes a web services endpoint to which the notification message can be asynchronously sent by the Broker and NotificationProducer.
- A "Pull Consumer" application invokes an operation on the Broker and NotificationProducer in order to receive a Notification Message.
- NotificationProducer
- A NotificationProducer sends notification messages to registered NotificationBrokers and NotificationConsumers. A NotificationProducer application exposes a web service endpoint to support the Subscribe operation and provide access to NotificationProducer resource properties.
- Demand based publisher
- A demand based publisher is a Publisher application that also exposes a web service endpoint (as a NotificationProducer) so as to receive pause or resume requests.
We can use any appropriate tooling to generate WS-Notification applications for use with the NotificationBroker. You take the WSDL exposed by a WS-Notification service point and use a development tool such as IBM Rational Application Developer to generate stubs against which the application can be coded. For examples of this type of coding, see Develop applications that use WS-Notification.
Related concepts
WS-Notification
Related tasks
Use WS-Notification for publish and subscribe messaging for web services Secure WS-Notification Configure WS-Notification resources using the administrative console Interacting at run time with WS-Notification Accomplishing common WS-Notification tasks Develop applications that use WS-Notification
WS-Notification troubleshooting tips WSNotificationCommands (AdminTask) WS-Notification roles and goals Writing JAX-WS applications for WS-Notification Events and service-oriented architecture: The OASIS Web Services Notification specifications OASIS Web Services Notification (WSN) technical committee