Kernel level WSN support

The DSB supports WSN by implementing the OASIS specification at two levels as described in the Notification support section. While this support allows to notify and subscribe to kernel and business services from WSN payloads via Web services, there is also the possibility to use Java APIs in the DSB kernel to interact with the WSN engine directly from your Java code.

Publish notifications

You can directly publish notifications to the available kernel topics from Java clients by using the NotificationCenter defined in org.petalslink.dsb.kernel.pubsub.service.NotificationCenter (module deb-kernel-pubsubservice). Here is the NotificationSender interface definition:

To send the notification, just get the instance of the NotificationCenter and its notification sender, then call the notify operation:

As a result, the notification will eb published to the topic (if available) and then distributed to all subscribers. Up to the notification engine will send notifications using the right transport...

Receive notifications

You can also receive notifications directly in your Java code by subscribing to the notification engine. Hopefully, the DSB extensions mechanism ease this part, you do not have to subscribe yourself, the DSB will automatically subscribe to topics if your classes are well annotated. Simply use the org.petalslink.dsb.annotations.notification.Notify annotation. The parameters of this annotation allows to customize the way you subscribe and receive notifications:

  • topics: A list of topics you want to subscribe to. The topic format is defined like {topicns}topicprefix:topicname
  • mode: Do you want to receive just the business message? So just use the WSN value (default one). If you want to receive the complete WSN Notify payload, use the PAYLOAD value
    The annotated method must have just one parameter which is a DOM document, more support soon.


    The previous class will subscribe to the DSBTopic in the PAYLOAD mode, so each time someone publishes a notification in the DSBTopic, the interestedInNotificationButNotOnly method will be called with the complete WSN Notify payload as DOM document.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.