Content deleted Content added
Add wampcc and wamplv to the list of clients/routers |
|||
(13 intermediate revisions by 12 users not shown) | |||
Line 2:
{{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=https://wamp-proto.org/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 [[Web standards|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
==Characteristics==
Line 8:
===Structure===
WAMP requires<ref>
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
===Workflow===
WAMP is architectured around client–client communications
* Clients connect to the router using a transport, establishing a session.
Line 29 ⟶ 27:
* '''publish''': a client publishes information about this topic.
This can have subtle variations depending on 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|website=[[GitHub]] |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 43 ⟶ 41:
Unlike with traditional RPCs, which are addressed directly from a caller to the entity offering the procedure (typically a server backend) and are strictly unidirectional (client-to-server), RPCs in WAMP are routed by a middleware and work bidirectionally.
Registration of RPCs is with the WAMP router, and calls to procedures are similarly issued to the WAMP router. This means first of all that a client can issue all RPCs via the single connection to the WAMP router, and does not need to have any knowledge what client is currently offering the procedure, where that client resides or how to address it. This can indeed change between calls, opening up the possibility for advanced features such as [[Load balancing (computing)|load-balancing]] or fail-over for procedure calls.
It additionally means that all WAMP clients are equal in that they can offer procedures for calling. This avoids the traditional distinction between clients and server backends, and allows architectures where browser clients call procedures on other browser clients, with an API that feels like peer to peer communication.
However, even with multi-tiers architectures, the router is still a single point of failure. For this reason, some router implementation roadmaps include clustering features.<ref>
==Implementations==
Line 60 ⟶ 58:
! Language
|-
|
| [[JavaScript]] for the [[AngularJS]] framework
|-
|
| [[C++]] 11
|-
| wamplv
| [[LabVIEW]] (G)
|-
|
| JavaScript ([[Web browser|browser]] and [[Node.js]])
|-
|
| [[Python (programming language)|Python]]
|-
| wampy
| [[Python (programming language)|Python]]
|-
|
| [[Perl]]
|-
|
| JavaScript for the [[Backbone.js]] library
|-
|
| C++ 11
|-
| Erwa
| [[Erlang (programming language)|Erlang]]
|-
| Jawampa
| [[Java (programming language)|Java]]
|-
| [|
| [[Lua (programming language)|Lua]]
|-
| MDWamp
| [[Objective-C]]
|-
| Minion
| [[PHP]]
|-
| rx.wamp
| JavaScript for the [[React (JavaScript library)|React]] library
|-
|
| PHP
|-
|
| C++
|-
| wampcc
| C++
|-
|
| [[C Sharp (programming language)|C#]]
|-
|
| JavaScript (browser only)
|-
| nexus
| [[Go (programming language)|Go]]
|}
Line 128 ⟶ 126:
However, the persistent nature of WebSocket connections requires the use of non-blocking libraries and [[Asynchronous I/O|asynchronous]] [[Application programming interface|API]]s. In languages with one official mechanism such as JavaScript, Erlang or Go, this is not an issue. But for languages with several competing solutions for asynchronous programming, such as Python or PHP, it forces the client author to commit to a specific part of the ecosystem.
For the same reason, integrating legacy projects can also require work. As an example, most popular Web Python frameworks are using [[Web Server Gateway Interface|WSGI]], a synchronous API, and running a WAMP client inside a WSGI worker needs manual adapters such as
===Routers===
While routers can technically be embedded directly into the application code and some client libraries also provide a router, this architecture is discouraged by the specification.<ref>{{cite web|title= Brokers and Dealers are responsible for generic call and event routing and do not run application code.|website=[[GitHub]] |url=https://github.com/tavendo/WAMP/blob/master/spec/basic.md#application-code}}</ref>
Since the router is a moving part, it is best used{{According to whom|date=November 2015}} as a swappable black box just like one would consider [[Apache HTTP Server|Apache]] or [[Nginx]] for [[Hypertext Transfer Protocol|HTTP]]:
Line 141 ⟶ 139:
! Language
|-
|
| [[Erlang (programming language)|Erlang]]
|-
|
| Python (CPython and [[PyPy]])
|-
| Erwa
| Erlang
|-
| wampcc
| C++
|-
| Jawampa
| Java
|-
|
| PHP
|-
| wamp.rt
| JavaScript (Node.js only)
|-
|
| C#
|-
| Wiola
| [[Lua (programming language)|Lua]]
|-
|
| JavaScript (Node.js only)
|-
| nexus
| [[Go (programming language)|Go]]
|}
[[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|date=26 December 2014 |url=http://www.slideshare.net/sametmax/intro-wamp}}</ref> As they are promoting
==Use cases==
Line 181 ⟶ 179:
Being a WebSocket sub-protocol, WAMP fits naturally anywhere one would use raw web sockets, as a way to synchronize clients such as Web browsers, push notifications to them and allow soft real-time collaboration between users.<ref>[https://github.com/voryx/angular-wamp WAMP and AngularJS]</ref> It has also the same limitations, requiring client support, which is missing for [[Internet Explorer]] versions older than 10.<ref>{{cite web|url=http://caniuse.com/#feat=websockets|title=Can is use websockets ?}}</ref> This is mitigated by the existence of [[Polyfill (programming)|polyfill]]s<ref>[https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills Web socket polyfills]</ref> using more portable technologies such as [[Adobe Flash|Flash]] or the use of HTTP Longpoll as a fallback. In that sense, WAMP is a competitor to [[Meteor (web framework)|Meteor]]'s [[Distributed Data Protocol|DDP]].
WAMP also targets the IoT, where it is used in the same way as [[MQTT]]<ref>{{cite web|url=https://into.aalto.fi/download/attachments/12324178/Huang_Fuguo_thesis_2.pdf|title=Moreover, we compared WAMP with other registered WebSocket subprotocols (MBWS, SOAP and STOMP) in terms of the related features; and with other potential protocols (CoAP and MQTT), in terms of the related practical deployments.|access-date=2015-01-12|archive-date=2016-05-13|archive-url=https://web.archive.org/web/20160513073741/https://into.aalto.fi/download/attachments/12324178/Huang_Fuguo_thesis_2.pdf|url-status=dead}}</ref> as a light and efficient medium to orchestrate clusters of connected objects. The implementations in various languages make it suitable to control and monitor small devices such as the [[Raspberry Pi]] (in Python) or the Tessel<ref>[https://www.youtube.com/watch?v=WY7KzrRm8XY Tessel alarm app with Crossbar.io]</ref> (in JavaScript).
And last but not least, WAMP can act as an enterprise service bus, serving as the link between
==Evolution==
Line 249 ⟶ 247:
|
|-
|
|
| {{ya}}
Line 353 ⟶ 351:
|
|-
|
|
|
|