Web Application Messaging Protocol: Difference between revisions

Content deleted Content added
m Comparison: XMPP supports RPC
Gian-Pa (talk | contribs)
fix links and small grammar issues
Line 1:
{{Advert|date=October 2016}}
 
'''WAMP''' is a [[WebSocket]] subprotocol registered at [[Internet Assigned Numbers Authority|IANA]],<ref>[https://www.iana.org/assignments/websocket/websocket.xml IANA protocols listing page]</ref> specified<ref>[https://github.com/tavendo/WAMP/blob/master/spec/basic.md WAMP basic profile specifications]</ref> to offer routed [[Remote procedure call|RPC]] and [[Publish–subscribe pattern|PubSub]]. Its design goal<ref>{{cite web|url=httphttps://wamp-proto.ws/whyorg/intro.html|title=Using WAMP you can build distributed systems out of application components which are loosely coupled and communicate in (soft) real-time.}}</ref> is to provide an open standard for soft real-time message exchange between application components and ease the creation of [[loosely coupled]] architectures based on [[microservices]]. Because of this, it is a suitable [[enterprise service bus]] (ESB),<ref>[http://www.slideshare.net/KSDaemon/wamp-en-exported A few words about WAMP]</ref> fit for developing responsive Web applications or to coordinate multiple connected devices in the [[Internet of Things|IoT]].<ref>{{cite web|url=https://books.google.co.th/books?id=JPKGBAAAQBAJ&pg=PA172&lpg=PA172&dq=wamp+iot&source=bl&ots=8_zF1iZI_k&sig=2CgkqF4tlry5byIUXLiZjZVG2N8&hl=en&sa=X&ei=m0yyVN2JMI6QuASV3oLYBA&redir_esc=y#v=onepage&q=wamp%20iot&f=false|title=In this chapter [...] you will learn about the Web Application Messaging Protocol [...] which provide tools and services for developing IoT solutions}}</ref>
 
==Characteristics==
Line 9:
WAMP requires<ref>[http://crossbar.io/docs/Router-Transports/ Crossbar.io router transport ]</ref> a reliable, ordered, [[full-duplex]] message channel as a [[transport layer]], and by default uses Websocket. However, implementations can use other transports matching these characteristics and communicate with WAMP over e.g. raw sockets,<ref>{{cite web|url=https://github.com/tavendo/WAMP/issues/63|title=WAMP can run over Raw transports instead of WebSocket. Each message is prefixed with a uint32 (big endian) that provides the (serialized) length of the following WAMP message.}}</ref> [[Unix ___domain socket|Unix sockets]] or [[Push technology#Long polling|HTTP long poll]].
 
Message [[serialization]] assumes<ref>[https://github.com/tavendo/WAMP/blob/master/spec/basic.md#serializations WAMP serialization]</ref> integers, strings and ordered sequence types are available, and defaults to [[JSON]] as the most common format offering these. Implementations often provide [[MessagePack]] as a faster alternative to JSON, but at the cost of an additional dependency.<ref>{{cite web|url=https://ksdaemon.github.io/wampy.js/#description|title=Wampy default serializer is JSON, but it also supports msgpack as a serializer, but you need to include msgpack.js as dependency}}</ref>
 
To identify remote procedures and PubSub topics without conflicts, WAMP also needs an ID space allowing global assignment and resolution. Because the protocol is Web native - WebSocket being the preferred transport - [[Uniform resource identifier|URI]]s are used.
Line 28:
* '''publish''': a client publishes information about this topic.
 
This can have subtle variations depending ofon the underlying transport.<ref>{{cite web|title=The Long-Poll Transport is able to transmit a WAMP session over plain old HTTP 1.0/1.1. This is realized by the Client issuing HTTP/POSTs requests, one for sending, and one for receiving|url=https://github.com/tavendo/WAMP/blob/master/spec/advanced.md#long-poll-transport}}</ref> However, implementation details are hidden to the end-user who only programs with the two high-level primitives that are RPC and PubSub.
 
===Security===
Line 34:
As WAMP uses Websocket, connections can be wrapped in [[Transport Layer Security|TLS]] for encryption. Even when full [[confidentiality]] is not established, several mechanisms are implemented to isolate components and avoid [[man-in-the-middle attack]]s. Default implementations ensure that trying to register an already registered procedure will fail.
 
Routers can define realms as administrative domains, and clients must specify which realm they want to join upon connection. Once joined, the realm will act as a [[namespace]], preventing clients connected to a realm from using IDs defined in another for RPC and PubSub. Realms also have permissions attached, and can limit the clients to one subset of the REGISTER/CALL/PubSub actions available.
 
Some realms can only be joined by authenticated clients, using various authentication methods such as using [[X.509|TLS certificate]], [[HTTP cookie|cookies]] or a simple ticket.
Line 162:
|}
 
[[Tavendo]], the company from which originated the protocol, is also the author of [[Crossbar.io]], which promotes itself as the de facto router implementation.<ref>{{cite web|title=Crossbar.io is the name of the most full -featured router|url=http://www.slideshare.net/sametmax/intro-wamp}}</ref> As they are promoting micro-service-based architectures, Crossbar.io embeds a service manager for hosting and monitoring WAMP app components, a static file Web server, and a WSGI container. Being written with the [[Twisted (software)|Twisted]] library, it is one of the implementations that can be set up in production without a proxy, aiming to replace stacks such as Nginx associated with [[Process supervision|Supervisor]] and [[Gunicorn]].
 
==Use cases==
Line 174:
==Evolution==
 
WAMP is currently in version 2<ref>[httphttps://wamp-proto.wsorg/spec/.html WAMP 2 specification menu]</ref> which introduced routed RPC. The versionVersion 1 is now deprecated.<ref>[http://wamp.ws/spec/wamp1/#overview WAMP 1 specification overview]</ref> As of now, all routers are compatible with version 2. Some clients remain unported: Wamp.io, AutobahnAndroid, and cljWAMP.
 
The version 2 of the specification is divided ininto two parts: the basic profile, including the router RPC and Pub/Sub, and the advanced profile, featuring trust levels, URI pattern matching, and client listing. The basic profile is considered stable and is what current libraries are implementing while the advanced profile is still in evolution.
 
==Comparison==
The WAMP website claims<ref>[httphttps://wamp-proto.ws/comparedorg/comparison.html WAMP compared]</ref> the following selling points for the technology:
* '''Native PubSub''': supports Publish & Subscribe out of the box (no extension required).
* '''RPC''': supports Remote Procedure Calls out of the box (no extension required).