Internet of Things Architecture

(Elliott) #1
Figure 46 : Request/Response-pattern for clients.

Subscribe/Notify


The Subscribe/Notify-pattern (see Figure 47 and Figure 48 ) allows an
asynchronous way of communication between two parties without the client
waiting for the server response. The client just indicates the interest in a service
on the server by sending a subscribe-call to the server. The server stores the
subscription together with the address of the client wants to get notified on and
sends notifications to this address whenever they are ready to be sent.


Figure 47 : Subscribe/Notify-pattern for one client.

One advantage of the Subscribe/Notify-pattern over the Request/Response-
pattern is the non-blocking behaviour of the subscribe method. The clients can
continue with other task and need to process the notification only when it
arrives. Another big advantage on the server side is that notifications can be
multiplied and sent off to clients if the clients have subscribed to the same kind
of notifications. To implement the Subscribe/Notify-pattern a server is required
that is more powerful compared to the one required for the Request/Response-
pattern. The server has to keep records about its subscribers and the kind of
subscriptions if it allows several of them.

Free download pdf