Reference Guide

Table Of Contents
Publish Subscribe service is provided by the Distributed Coordination Service which is in turn
provided by the Teaming service. Please refer to the Javadoc for a detailed explanation of
methods provided by publish-subscribe service.
Publish Subscribe service also provides mechanisms to enable global ordering for specific
message types. Global ordering is disabled by default. With global ordering enabled, all
receivers will receive all messages from all sources with the same order. If global order is disabled
two different receivers could receive messages from different sources in different orders. It is
important to note - since global ordering degrades performance - that messages from the same
source will still be ordered even with global ordering disabled.
Example:
Let A and B be message publishers (Sources).
Let R and W be message subscribers (Receivers).
Assume A sends messages a
1
a
2
a
3
in that order.
Assume B sends messages b
1
b
2
b
3
in that order.
With or without global ordering the following holds:
· a
1
arrives before a
2
· a
2
arrives before a
3
· b
1
arrives before b
2
· b
2
arrives before b
3
With global ordering
· Let a
1
b
1
a
2
a
3
b
2
b
3
be the sequence of messages received by R
· Then W receives messages in the same order
Without global ordering
· Let a
1
b
1
a
2
a
3
b
2
b
3
be the sequence of messages received by R
· Then W may (or may not) receives messages in the same order.
The global ordered sequence does not necessarily represent the sequence in which the events
were actually generated, but the sequence in which they were received by a node designated as a
reference automatically by the Distributed Coordination service. This reference node propagates
the events in the order received; this is how global ordering is commonly implemented. Thus,
global ordering is from the receiving point of view and not from the sending point of view (It is not
possible to determine the actual order events were generated - common problem in distributed
systems: It is not possible to get a global state of the system).
The example below presents a common implementation of publish subscribe service.
Publish-Subscribe Example:
PubSubExample.java
import com.hp.sdn.teaming.TeamingService;
69