Skip to content

Messaging topics

Ignacio del Valle Alles edited this page Feb 1, 2016 · 13 revisions

Besides services, Brutusin-RPC allows the developer to create Topics, a programming model based on the Publish–subscribe pattern that lets the applications define client-side functionality that can be triggered on the certain sever events.

In this framework, Topics are implemented over Websockets.

##Server code Brutusin-RPC topics offer an additional message filtering capability to the standard publish–subscribe model. A filter parameter can be defined to discriminate among subscribers of a topic, that is, messages are delivered to subscribers that satisfy the filtering criteria. ###Topic implementation A Brutusin-RPC topic is an object instance of a class extending org.brutusin.rpc.websocket.Topic(https://github.com/brutusin/Brutusin-RPC/blob/master/rpc-api/src/main/java/org/brutusin/rpc/websocket/Topic.java).

  • public abstract Set<WritableSession> getSubscribers(F filter)
  • protected void onSubscribe(WritableSession session)
  • protected void onUnsubscribe(WritableSession session)

###Topic registration ###Publishing from actions ##Client subscription

##Testing