Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the WSO2 Dashboard Server (DS), the gadget technology is based on the OpenSocial public specificationDS renders the gadgets and add other features (e.g., communication, security, UI layouts) using Apache Shindig, which is an OpenSocial container and solution that is used to start hosting OpenSocial apps quickly, by providing the code to render gadgets, proxy requests, and handle REST and RPC requests. Inter-gadget communication is the capability of one gadget being able to communicate with another gadget (such as, the capability of Gadget X to send some data to Gadget Y and Gadget Y's capability of getting updated with the data that it received. Apache Shindig uses the publisher-subscriber  communication paradigm for communication purposes, which is commonly known as the Pub/Sub model.  This paradigm is asynchronous, loosely coupled, autonomous and also a data-centric approach for communication. The following are the three main components that make-up this paradigm: Publisher , Subscriber and Notification System. WSO2 Dashboard Server (DS) supports inter-gadget communication with the help of publisher and subscriber gadgets, allowing gadgets to communicate with each other while running within a dashboard. The following image explains the publisher-subscriber  communication paradigm:Image Removed 

What is Pub/Sub?

Publisher/Subscriber (or pub/sub) is a messaging paradigm where a sender (or a Publisher) sends messages without specifically targeting one receiver. A receiver (or a Subscriber) declares interest in one or more messages published by a publisher or a set of publishers. The Message Broker keeps track of the publishers, subscribers and their subscriptions. In addition, the Message Broker will also take the responsibility of routing the messages, by utilizing a store-and-forward mechanism. In the context of the WSO2 DS these roles are as follows:

...

Gadgets convey their interest to either publish or subscribe to a channel via the gadgets.Hub.* API. Therefore, the pubsub-2 feature needs to be imported to load the necessary API fragments and this feature can be declared in the ModulePrefs section of the gadget. The following image explains the publisher-subscriber  communication paradigm:
Image Added 

Real world scenarios

The DS pub/sub model can be used for various requirements in the real world. The following is an example of a real world scenario where inter-gadget communication in DS comes in use.

...