Chapter 1. Introduction to WS-Notification
1.1. WS-Notification Standard
Overview
WS-Notification is a standard that describes a publish/subscribe messaging model implemented over Web services. The functionality is quite similar to the JMS publish/subscribe model, but the interfaces and the protocols are defined in terms of Web services standards (based on Apache CXF, in the context of JBoss A-MQ).
The WS-Notification standard is defined by combining the following OASIS specifications:
- WS-Topics
- WS-BaseNotification
- WS-BrokeredNotification
WS-Topics
The WS-Topics standard describes how to organize and define the topics used in a notification broker. In particular, the following aspects of a topic are described:
- Topic hierarchy—a hierarchical naming scheme, which can be defined using an XML document associated with the notification broker.
- Topic set—a standardized XML schema, which can optionally be used to define the hierarchy of topic names.
- Topic dialect—a particular type of name expression that is used to specify one topic or to select multiple topics. The following dialects are defined by the WS-Topics specification:
- Simple
- Concrete
- Full
- XPath
Note
Topic hierarchies are not supported in JBoss A-MQ. Only Simple topic names can be defined.
WS-BaseNotification
The WS-BaseNotification standard describes a simple point-to-point model of message notification. The base standard can be useful, if you want to send notifications through a standardized interface, without deploying a fully-fledged broker to mediate the messages. The following WSDL interfaces are defined in this standard:
NotificationPublisher
- Must be implemented by the entity that wants to publish messages. This interfaces exposes the
subscribe
operation, which enables consumers to register their interest in receiving notifications from this publisher. NotificationConsumer
- Must be implemented by the entity that wants to receive messages. This interface exposes the
notify
operation, which enables the consumer to receive message notifications directly from the publisher.
In addition to the two preceding interfaces for point-to-point communication, WS-BaseNotification defines another pair of interfaces for supporting pull-style notification, as follows:
CreatePullPoint
- Exposes the
createPullPoint
operation, which creates aPullPoint
object that can be used to accumulates messages. PullPoint
- Exposes the
notify
operation, which enables the pull-point to accumulate notification messages, and thegetMessages
operation, which enables a pull-style consumer to retrieve the accumulated messages when it is ready.
WS-BrokeredNotification
The WS-BrokeredNotification standard describes a brokered model of message notification, where a central broker (or network of brokers) can be used to route messages between publishers and consumers. This architecture scales much better than point-to-point, because each consumer requires only a single connection to the broker in order to monitor notifications from all publishers. The following additional interfaces are defined in this specification:
NotificationBroker
- Combines the
NotificationPubisher
,NotificationConsumer
, andCreatePullPoint
interfaces, enabling you to provide the full range of notification services in a single application.TheNotificationBroker
interface defines one additional operation, theregisterPublisher
operation, which can optionally be used to register publishers with the broker. In particular, this operation can be useful when constructing a federation of brokers. RegisterPublisher
- The notification broker also implements the
RegisterPublisher
interface, which defines one additional operation,registerPublisher
. A publisher can optionally use theregisterPublisher
operation itsNotificationPublisher
object with the broker.NoteIt is also possible for publishers to send messages to the broker straightaway, by invokingnotify
, without needing to register in advance. PublisherRegistrationManager
- The return value of the
registerPublisher
operation is a reference to aPublisherRegistrationManager
object, which can be used to destroy a registration.
References
For more information about the WS-Notification standards, see the following references: