<s>
WAMP	O
is	O
a	O
WebSocket	B-Protocol
subprotocol	O
registered	O
at	O
IANA	O
,	O
specified	O
to	O
offer	O
routed	O
RPC	B-Operating_System
and	O
PubSub	B-Operating_System
.	O
</s>
<s>
Its	O
design	O
goal	O
is	O
to	O
provide	O
an	O
open	O
standard	O
for	O
soft	O
real-time	O
message	O
exchange	O
between	O
application	O
components	O
and	O
ease	O
the	O
creation	O
of	O
loosely	B-Application
coupled	I-Application
architectures	O
based	O
on	O
microservices	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
it	O
is	O
a	O
suitable	O
enterprise	B-Application
service	I-Application
bus	I-Application
(	O
ESB	O
)	O
,	O
fit	O
for	O
developing	O
responsive	O
 [  [ Web ]  ] 	O
applications	O
or	O
to	O
coordinate	O
multiple	O
connected	O
devices	O
in	O
the	O
IoT	B-Operating_System
.	O
</s>
<s>
WAMP	O
requires	O
a	O
reliable	O
,	O
ordered	O
,	O
full-duplex	O
message	O
channel	O
as	O
a	O
transport	B-Architecture
layer	I-Architecture
,	O
and	O
by	O
default	O
uses	O
Websocket	B-Protocol
.	O
</s>
<s>
raw	O
sockets	O
,	O
Unix	B-Protocol
sockets	I-Protocol
or	O
HTTP	B-Protocol
long	O
poll	O
.	O
</s>
<s>
Message	O
serialization	B-Application
assumes	O
integers	O
,	O
strings	O
and	O
ordered	O
sequence	O
types	O
are	O
available	O
,	O
and	O
defaults	O
to	O
JSON	B-General_Concept
as	O
the	O
most	O
common	O
format	O
offering	O
these	O
.	O
</s>
<s>
Implementations	O
often	O
provide	O
MessagePack	B-Protocol
as	O
a	O
faster	O
alternative	O
to	O
JSON	B-General_Concept
,	O
but	O
at	O
the	O
cost	O
of	O
an	O
additional	O
dependency	O
.	O
</s>
<s>
To	O
identify	O
remote	O
procedures	O
and	O
PubSub	B-Operating_System
topics	O
without	O
conflicts	O
,	O
WAMP	O
also	O
needs	O
an	O
ID	O
space	O
allowing	O
global	O
assignment	O
and	O
resolution	O
.	O
</s>
<s>
Because	O
the	O
protocol	O
is	O
Web	O
native	O
-	O
WebSocket	B-Protocol
being	O
the	O
preferred	O
transport	O
-	O
URIs	B-Protocol
are	O
used	O
.	O
</s>
<s>
Clients	O
send	O
messages	O
to	O
the	O
router	O
which	O
dispatches	O
them	O
to	O
the	O
proper	O
targets	O
using	O
the	O
attached	O
URIs	B-Protocol
.	O
</s>
<s>
The	O
clients	O
send	O
these	O
messages	O
using	O
the	O
two	O
high-level	O
primitives	O
that	O
are	O
RPC	B-Operating_System
and	O
PUB/SUB	B-Operating_System
,	O
doing	O
four	O
core	O
interactions	O
:	O
</s>
<s>
However	O
,	O
implementation	O
details	O
are	O
hidden	O
to	O
the	O
end-user	O
who	O
only	O
programs	O
with	O
the	O
two	O
high-level	O
primitives	O
that	O
are	O
RPC	B-Operating_System
and	O
PubSub	B-Operating_System
.	O
</s>
<s>
As	O
WAMP	O
uses	O
Websocket	B-Protocol
,	O
connections	O
can	O
be	O
wrapped	O
in	O
TLS	B-Protocol
for	O
encryption	O
.	O
</s>
<s>
Once	O
joined	O
,	O
the	O
realm	O
will	O
act	O
as	O
a	O
namespace	O
,	O
preventing	O
clients	O
connected	O
to	O
a	O
realm	O
from	O
using	O
IDs	O
defined	O
in	O
another	O
for	O
RPC	B-Operating_System
and	O
PubSub	B-Operating_System
.	O
</s>
<s>
Realms	O
also	O
have	O
permissions	O
attached	O
and	O
can	O
limit	O
the	O
clients	O
to	O
one	O
subset	O
of	O
the	O
REGISTER/CALL/PubSub	O
actions	O
available	O
.	O
</s>
<s>
Some	O
realms	O
can	O
only	O
be	O
joined	O
by	O
authenticated	O
clients	O
,	O
using	O
various	O
authentication	O
methods	O
such	O
as	O
using	O
TLS	B-Protocol
certificate	O
,	O
cookies	B-Application
or	O
a	O
simple	O
ticket	O
.	O
</s>
<s>
This	O
avoids	O
the	O
traditional	O
distinction	O
between	O
clients	O
and	O
server	O
backends	O
,	O
and	O
allows	O
architectures	O
where	O
browser	B-Application
clients	O
call	O
procedures	O
on	O
other	O
browser	B-Application
clients	O
,	O
with	O
an	O
API	B-Application
that	O
feels	O
like	O
peer	O
to	O
peer	O
communication	O
.	O
</s>
<s>
As	O
WAMP	O
main	O
targets	O
are	O
Web	O
applications	O
and	O
the	B-Operating_System
Internet	I-Operating_System
of	I-Operating_System
Things	I-Operating_System
,	O
the	O
first	O
client	O
implementations	O
are	O
in	O
languages	O
well	O
established	O
in	O
these	O
industries	O
(	O
only	O
WAMP	O
v2	O
clients	O
listed	O
)	O
:	O
</s>
<s>
The	O
minimum	O
requirements	O
to	O
build	O
a	O
WAMP	O
client	O
are	O
the	O
abilities	O
to	O
use	O
sockets	O
and	O
to	O
serialise	O
to	O
JSON	B-General_Concept
.	O
</s>
<s>
Additional	O
features	O
which	O
would	O
add	O
dependencies	O
,	O
such	O
as	O
TLS	B-Protocol
encryptions	I-Protocol
or	O
MessagePack	B-Protocol
serialization	B-Application
,	O
are	O
optional	O
.	O
</s>
<s>
However	O
,	O
the	O
persistent	O
nature	O
of	O
WebSocket	B-Protocol
connections	O
requires	O
the	O
use	O
of	O
non-blocking	O
libraries	O
and	O
asynchronous	B-Architecture
APIs	B-Application
.	O
</s>
<s>
In	O
languages	O
with	O
one	O
official	O
mechanism	O
such	O
as	O
JavaScript	B-Language
,	O
Erlang	B-Operating_System
or	O
Go	B-Application
,	O
this	O
is	O
not	O
an	O
issue	O
.	O
</s>
<s>
But	O
for	O
languages	O
with	O
several	O
competing	O
solutions	O
for	O
asynchronous	B-Architecture
programming	O
,	O
such	O
as	O
Python	B-Language
or	O
PHP	B-Application
,	O
it	O
forces	O
the	O
client	O
author	O
to	O
commit	O
to	O
a	O
specific	O
part	O
of	O
the	O
ecosystem	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
most	O
popular	O
Web	O
Python	B-Language
frameworks	O
are	O
using	O
WSGI	B-Language
,	O
a	O
synchronous	O
API	B-Application
,	O
and	O
running	O
a	O
WAMP	O
client	O
inside	O
a	O
WSGI	B-Language
worker	O
needs	O
manual	O
adapters	O
such	O
as	O
.	O
</s>
<s>
Since	O
the	O
router	O
is	O
a	O
moving	O
part	O
,	O
it	O
is	O
best	O
used	O
as	O
a	O
swappable	O
black	O
box	O
just	O
like	O
one	O
would	O
consider	O
Apache	B-Application
or	O
Nginx	B-Operating_System
for	O
HTTP	B-Protocol
:	I-Protocol
</s>
<s>
As	O
they	O
are	O
promoting	O
micro-service-based	O
architectures	O
,	O
Crossbar.io	O
embeds	O
a	O
service	O
manager	O
for	O
hosting	O
and	O
monitoring	O
WAMP	O
app	O
components	O
,	O
a	O
static	O
file	O
Web	O
server	O
,	O
and	O
a	O
WSGI	B-Language
container	O
.	O
</s>
<s>
Being	O
written	O
with	O
the	O
Twisted	B-Language
library	O
,	O
it	O
is	O
one	O
of	O
the	O
implementations	O
that	O
can	O
be	O
set	O
up	O
in	O
production	O
without	O
a	O
proxy	O
,	O
aiming	O
to	O
replace	O
stacks	O
such	O
as	O
Nginx	B-Operating_System
associated	O
with	O
Supervisor	B-General_Concept
and	O
Gunicorn	B-Application
.	O
</s>
<s>
Being	O
a	O
WebSocket	B-Protocol
sub-protocol	O
,	O
WAMP	O
fits	O
naturally	O
anywhere	O
one	O
would	O
use	O
raw	O
web	B-Protocol
sockets	I-Protocol
,	O
as	O
a	O
way	O
to	O
synchronize	O
clients	O
such	O
as	O
Web	B-Application
browsers	I-Application
,	O
push	O
notifications	O
to	O
them	O
and	O
allow	O
soft	O
real-time	O
collaboration	O
between	O
users	O
.	O
</s>
<s>
It	O
has	O
also	O
the	O
same	O
limitations	O
,	O
requiring	O
client	O
support	O
,	O
which	O
is	O
missing	O
for	O
Internet	B-Application
Explorer	I-Application
versions	O
older	O
than	O
10	O
.	O
</s>
<s>
This	O
is	O
mitigated	O
by	O
the	O
existence	O
of	O
polyfills	B-Protocol
using	O
more	O
portable	O
technologies	O
such	O
as	O
Flash	B-Operating_System
or	O
the	O
use	O
of	O
HTTP	B-Protocol
Longpoll	O
as	O
a	O
fallback	O
.	O
</s>
<s>
In	O
that	O
sense	O
,	O
WAMP	O
is	O
a	O
competitor	O
to	O
Meteor	B-Language
's	O
DDP	B-Protocol
.	O
</s>
<s>
WAMP	O
also	O
targets	O
the	O
IoT	B-Operating_System
,	O
where	O
it	O
is	O
used	O
in	O
the	O
same	O
way	O
as	O
MQTT	B-Application
as	O
a	O
light	O
and	O
efficient	O
medium	O
to	O
orchestrate	O
clusters	O
of	O
connected	O
objects	O
.	O
</s>
<s>
The	O
implementations	O
in	O
various	O
languages	O
make	O
it	O
suitable	O
to	O
control	O
and	O
monitor	O
small	O
devices	O
such	O
as	O
the	O
Raspberry	B-Operating_System
Pi	I-Operating_System
(	O
in	O
Python	B-Language
)	O
or	O
the	O
Tessel	O
(	O
in	O
JavaScript	B-Language
)	O
.	O
</s>
<s>
And	O
last	O
but	O
not	O
least	O
,	O
WAMP	O
can	O
act	O
as	O
an	O
enterprise	B-Application
service	I-Application
bus	I-Application
,	O
serving	O
as	O
the	O
link	O
between	O
micro-services	O
like	O
one	O
would	O
do	O
with	O
CORBA	B-Architecture
,	O
ZeroMQ	B-Operating_System
,	O
Apache	B-Protocol
Thrift	I-Protocol
,	O
SOAP	B-Application
or	O
AMQP	B-Operating_System
.	O
</s>
<s>
WAMP	O
is	O
currently	O
in	O
version	O
2	O
which	O
introduced	O
routed	O
RPC	B-Operating_System
.	O
</s>
<s>
The	O
version	O
2	O
of	O
the	O
specification	O
is	O
divided	O
into	O
two	O
parts	O
:	O
the	O
basic	O
profile	O
,	O
including	O
the	O
router	O
RPC	B-Operating_System
and	O
Pub/Sub	B-Operating_System
,	O
and	O
the	O
advanced	O
profile	O
,	O
featuring	O
trust	O
levels	O
,	O
URI	B-Protocol
pattern	O
matching	O
,	O
and	O
client	O
listing	O
.	O
</s>
<s>
Native	O
PubSub	B-Operating_System
:	O
supports	O
Publish	B-Operating_System
&	I-Operating_System
Subscribe	I-Operating_System
out	O
of	O
the	O
box	O
(	O
no	O
extension	O
required	O
)	O
.	O
</s>
<s>
RPC	B-Operating_System
:	O
supports	O
Remote	B-Operating_System
Procedure	I-Operating_System
Calls	I-Operating_System
out	O
of	O
the	O
box	O
(	O
no	O
extension	O
required	O
)	O
.	O
</s>
<s>
Routed	O
RPC	B-Operating_System
:	O
supports	O
routed	O
(	O
not	O
only	O
point-to-point	O
)	O
Remote	B-Operating_System
Procedure	I-Operating_System
Calls	I-Operating_System
.	O
</s>
<s>
Full	O
object	O
passing	O
like	O
CORBA	B-Architecture
.	O
</s>
<s>
Data	O
synchronization	O
like	O
DDP	B-Protocol
.	O
</s>
<s>
Peer-to-peer	O
communication	O
like	O
ZeroMQ	B-Operating_System
.	O
</s>
<s>
Multi-media	O
streaming	O
like	O
WebRTC	B-Protocol
.	O
</s>
<s>
Large	O
file	O
transfer	O
like	O
HTTP	B-Protocol
.	I-Protocol
</s>
<s>
Although	O
,	O
it	O
is	O
important	O
to	O
note	O
that	O
while	O
DDP	B-Protocol
does	O
Pub/Sub	B-Operating_System
under	O
the	O
hood	O
to	O
synchronize	O
data	O
sets	O
,	O
it	O
does	O
not	O
expose	O
PubSub	B-Operating_System
primitives	O
.	O
</s>
