Este conteúdo não está disponível no idioma selecionado.
1.4. Implementation of WS-Notification
Overview
Figure 1.3, “Notification Broker Architecture” shows an overview of how the WS-Notification standard is implemented in JBoss A-MQ, where the notification broker supports both the WS-BaseNotification standard and the WS-BrokeredNotification standard.
Figure 1.3. Notification Broker Architecture
Notification broker as wrapper around ActiveMQ broker
The JBoss A-MQ notification broker is implemented essentially as a wrapper around the Apache ActiveMQ broker. This is possible, because the topic-based messaging model at the heart of WS-Notification is essentially the same as the JMS publish/subscribe model. The notification broker wrapper layer provides the SOAP/HTTP protocol, implements the standard WSDL interfaces, and implements the integration layer; the ActiveMQ broker component provides persistence, message routing, and JMX support (amongst other things).
The notification broker wrapper and the ActiveMQ broker are connected together using a normal client-broker connection. In theory, you could use any ActiveMQ supported protocol for this connection, but it makes the most sense to embed both components in the same JVM and to use the VM protocol. This embedded coupling ensures optimum efficiency and performance.
OSGi container deployment
In theory, the notification broker can be deployed standalone or into various containers. The normal deployment model in JBoss A-MQ, however, is the OSGi container deployment. To simplify OSGi deployment, the notification broker can be installed as the Karaf feature,
cxf-wsn
.
Supported WS-Notification interfaces
The notification broker service supports the following two WS-Notification interfaces:
NotificationBroker
- The main notification broker interface enables you to create subscriptions (
subscribe
operation), send notification messages (notify
operation), and register Publisher services (registerPublisher
operation). CreatePullPoint
- The create pull-point interface enables you to create new pull-point endpoints on the notification broker, which are used to accumulate messages until a consumer client is ready to retrieve them.
Qualities of service
Most of the options to configure qualities of service are provided by the underlying ActiveMQ broker. All of the usual topic-oriented features and qualities of service can be configured on the underlying broker. In particular, you can turn on persistence in the broker, so that subscriptions and messages are persisted.
Topics
Notification messages are organized by topic, so that messages sent on a particular topic will be received by those consumers that are subscribed to that topic. In JBoss A-MQ, the notification topics are mapped to the underlying ActiveMQ topics, as follows:
- Only the SIMPLE dialect is supported (of the dialects described in the WS-Notification specification).
- In a WS-Notification client, you can specify a topic name as the
String
type or as theQName
type. - A notification topic name maps directly to an ActiveMQ topic name.
- Topic hierarchies are not supported in JBoss A-MQ, but something very similar is supported by the underlying ActiveMQ broker. In Apache ActiveMQ, you can define a topic to have a segmented structure, where each segment is delimited by the
.
character—for example,STOCKS.NYSE.REDHAT
. Within the ActiveMQ configuration, you can exploit this structure to match multiple topics—for example,STOCKS.NYSE.>
matches all topics starting withSTOCKS.NYSE.
. - Topics are ad-hoc—in other words, there is no need to pre-define any topic hierarchy in XML. Topics are created dynamically: if you use them, they are automatically created in the broker. This is the standard approach supported in the underlying ActiveMQ broker.
Configuration of the notification broker
The notification broker is configured mainly by the following OSGi Config Admin configuration files:
etc/org.apache.cxf.wsn.cfg
- Configures the wrapper component of the notification broker. For details about the properties you can set in this file, see the section called “org.apache.cxf.wsn.cfg settings”.
etc/io.fabric8.mq.fabric.server-default.cfg
- Customizes the OSGi deployment of the Apache ActiveMQ broker. A couple of important properties can be set in this file—for example, the broker name.
etc/activemq.xml
- Configures the Apache ActiveMQ broker. Most of the broker features and properties can be configured in this file. For example, you can configure message persistence and fine tune broker performance in this file.