
WAMP – Web Application Messaging Protocol - porsager
https://wamp-proto.org
======
niftich
WAMP is a sort of tech that did the same thing as Socket.io when the latter
was still really popular, while having nice AMQP-like semantics that gave you
full routing, and PubSub and RPC with the same stack. A few years ago, it was
promising but didn't seem to get a lot of uptake, and then HTTP/2's rise meant
that Websocket fell off the hype train into the dustbin of boring technologies
no one blogged about anymore.

This happened right as IDL codegens like Thrift also stopped being talked
about, and when people did again, it was all about gRPC, which runs over
HTTP/2\. This didn't help Websocket either.

Projects like this are especially interesting because they genuinely deliver
what they claim to do, but to most people they exist in an alternate universe
they've never heard about.

~~~
chrisco255
Why did HTTP/2 impact Websocket's usage? Websockets are still used for real-
time server-client communication in many application stacks.

~~~
derefr
If your use-case for Websockets was "make a bunch of concurrent RPC requests
without the browser queuing them" then you can achieve the same concurrency
semantics using regular AJAX REST calls, as long as they happen to transit
over HTTP/2\. For a lot of people, that was all they wanted.

As well, if you add a single SSE channel to that, riding in the same HTTP/2
socket, you now can do _everything_ Websockets can do.

And if you throw a web server like Caddy between your HTTP/2 clients and your
application server, now your app server can just be implemented in terms of
regular HTTP/1 request-handling, with no need to implement any connection-
oriented protocols at all.

~~~
Can_Not
Can you clarify what mainstream backend frameworks support any of those?

------
SmooL
Acronym aside, I think this is fantastic. These patterns (RPC, pubsub) have
been around for a while now, and are fairly well understood. Formalizing them
into a common, agnostic protocol that everyone can use is a huge win for all
parties.

~~~
sametmax
And the implementation is really clean too.

First, it's not just RPC, it's routed RPC. So you basically don't have to know
who is providing the procedure and where it is. This also allows transparent
fallbacks, hot swap and load balancing of the clients providing the procedure.

Another thing I like is the ease of use. If you used CORBA, XMLRPC or SOAP you
know what a pain it is to get it work.

The Python and JS clients just work for me. Transparently: they even get
errors back in their native form (ex: python get exception for an error
occurring remotely). There is zero mapping to do: you start you client, you
register your procedure, and you call it.

The fact is uses websocket is a cool thing too. First, it means you can use it
in the browser, and not just nodejs, Python, C#, Java or PHP (but they all
have interroperable clients!). But it also means it usually works on your
network without the need to setup anything or bother your local sysadmin. And
it can benefit from TLS.

It's really sweet.

My only beef is that the Python API is too verbose to my taste, and advance
setup for crossbar.io can get complicated if you want to make it super secure
(default settings are the equivalent of chmod 777).

~~~
detaro
Can you do nowadays easily do security for things that are not pure RPC? I
remember looking at crossbar.io for the pub-sub features quite a while ago,
and securing those was somewhere between a pain and impossible.

~~~
sametmax
crossbar.io now have full featured authentification system, end to end
encryption, and permissions isolated in realms. It's work, but yeah, you can
secure things.

Securing a website is a lot of work too if you have to do it manually. I just
don't do it much anymore, Django takes care of most of the issues for me, and
barring some very bad decisions, I have little to actually worry about.

But crossbar doesn't have a django like framework. It's more like flask,
express, sinatra...

I've been actually doodling the API of a high level framework on top of
crossbar.io for 2 years now. But barring winning the lottery or starting a
successful kickstarter, it's unlikely I will find the money to work on it for
a year without interruption. It's crazy the amount of work that needs to be
done to catch up with frameworks created a decades ago and improved by hundred
of dev while field testing it :)

~~~
detaro
great to hear!

------
lulf
You can also use AMQP 1.0, an ISO and OASIS standard protocol, over
websockets.

It supports RPC and pub/sub semantics and has client libraries in many
languages. It’s implemented by many messaging components as well as Azure
Service Bus.

~~~
sametmax
I tried to make a android remote control for a vidoe streaming website with
those. I never manage to find a way to make it work after a day. It tool me a
few hours with crossbar so i never tried again.

------
grosjona
I think that one of the main problems with WAMP is that it's just too complex.
The RFC is over 150 pages long... For that reason, implementing WAMP is not
straight forward.

I think that parts of the WAMP spec are useful to read and I've found it to be
a useful guideline for my project but I think that implementing fully WAMP-
compatible clients and servers is not realistic at this stage... It's better
to just roll your own protocol.

Most implementations of real-time frameworks/libraries use custom protocols
and many of them are more widely used than the WAMP protocol.

~~~
sametmax
I agree on the complexity. They traded internal complexity for a simple and
easy user experience. WAMP is kinda magic when you use it: languages with very
different forms talk to each others reliably with almost no setup, no schema
to define, to stuff to prealocate. And it's packed with features too (the
wildcards and meta events are insanely powerful).

The price of that is a really heavy spec.

But it's also how the team approach problems. E.G: their Python code really,
really looks like Java, with interface everywhere, and wrappers, and
factories... If they designed their spec the same way, then it's not
surprising.

The german stereotype about engineering is not just a joke.

------
sethhochberg
Boy, this seems like an exceptionally poor choice of project name - in the
same exact industry, web development, there is already years of use of "WAMP"
to mean "Windows Apache MySQL PHP". WAMP / LAMP / MAMP / etc are ubiquitous.

[https://en.wikipedia.org/wiki/WampServer](https://en.wikipedia.org/wiki/WampServer)

You know the difference, and I know the difference, but a whole lot of newbie
developers who are trying to learn about websockets and while playing around
on their Windows dev box could end up pretty confused.

~~~
sametmax
I kept telling Tobias (the head of Tavendo, the company behind WAMP) to change
the name years ago but he said he already invested too much in it
(registration at IANA, tutorial, the fact this is actually WAMP 2, so there
was a WAMP 1...).

Basically, yep, it's bad, but this ship has sailed.

~~~
ofrzeta
That didn't stop them from renaming the Company from Tavendo to Crossbar.io,
though, it seems. As they are advertising the protocol as "open Web
Application Messaging Protocol" they might as well abbreviate it OWAMP. Just
sayin'...

~~~
sametmax
I think the owamp is a good idea. I'll try to reach out and show them this
thread.

~~~
fouc
OWAMP would be good because it could benefit from the very similar acronym:
OWASP - Open Web Application Security Project.

------
marknadal
This looks like a great library, but a few years too late? Socket.io,
SocketCluster.io, gun.js.org (ours), even Meteor, and plenty of other things
make it easy to do RPC or get PubSub behavior. Why WAMP over others?

~~~
sametmax
It's in the details :

\- wamp is a language neutral spec and an open standard registered at iana.

\- implementations not only exist in many languages but they are all
interroperable transparently despite all feeling very native to their own
language. A failing rpc in js will see the error propagated as a python
exception on the other side.

\- it works in the browser, yes, but it's also very usable as a way to
implement micro services or iot clusters. You are not tied to a particular use
case or framework.

\- not not simple rpc but routed rpc, so the clients don't need to know each
others and you can implement fallback, hot reload or load balancing

\- security and authentigication are first class citizen

\- wamp comes with a lot of goodies like meta events for introspection or
wildcards

------
jMyles
If nothing else, we need this acronym to mean something - anything - other
than Windows/Apache/MySQL/PHP.

------
lprd
Desperately needs a new acronym! Otherwise, this looks pretty neat!

------
poulsbohemian
I inherited a project a while back that used this. It looked brilliant, but
the problem was that at least the way the project had been configured, it was
not what we needed. In that case, we just needed a simple http-based rest
layer over a database, possibly with some queueing off to another system. WAMP
appeared to be a very forward-thinking architecture, but I struggled to see
how it blended well with that kind of typical use case.

~~~
sametmax
If you just need rest over ajax, wamp is really overkill as you forgo all the
tools 10 years of frameworks doing that automatically for you.

Beside, crossbar really need a task queue architecture. It's basically half of
it, so i guess we could plug in celery in the mix and some glue code.

------
rad_gruchalski
I went to „why wamp” page, scrolled down, there is a section called „also on
wamp”, one of the entries is „wamp implementations”. When clicked, it does
some redirects and returns with:

NoSuchKeyThe specified key does not
exist.implementations/4F6424CF99BA8DC7mv7nfiMNvfiGfUbpMSrbbLzw2pg30iU+BIIxUi+y6ms1+NiTLie+4l1QJFk+6pguD9+FYz8MgH0=

Turns out thst’s for every page in that section.

------
dlhavema
i personally like the stats on the last page of the slide show, and the
tailing comment about being benchmarked on a Raspberry Pi. Not that anyone
would host a server like this on a PI, but knowing how small of a machine is
needed to run something like this is cool.

Of course you could probably do a pretty slick home automation system with
this and only a Pi...

~~~
sametmax
:) they have a crazy serious setup for perf testing and published those
numbers years ago. It's even better now. I created the slides for my french
blog but after receiving a lot of traffic, they contacted me to make an
english version that ended up here. It's funny when you think how ugly those
slides are, but I did smiled writting the raspi bit.

------
gumby
We use this and have python, js, java and C++ modules talking to each other
with it. Doco and examples are so-so but the code is readable and, well, there
were implementations for all the languages we needed.

It's weird that an RPC involves http->web socket->wamp plus a bunch of
pickling etc but hey, it works and saved us a ton of time.

~~~
sametmax
Doc have improved a lot since the last time i used it in prod, but yeah this
is not vuejs doc quality level. I mostly use the demo and example codes to get
by.

------
rvdmei
We have been using WAMP 2 and crossbar in production for a while now. We have
js, PHP and python all talking to each other without any issues. We will
probably add Go in the next months (prototypes are already working). For
authorization and authentication you have to spend some effort to get
something working without hardcoded config. Biggest down side is that
clustering of the open source router crossbar is not really possible and we
haven’t seen any production ready alternatives. Until now this wasn’t really
an issue, but it looks like this might be the reason why we will leave WAMP /
crossbar this year. Best options to replace this with is probably some
solution based on GRPC or NATS.

------
jgalvez
This is amazing. The web badly needed a proper standard for this backed by big
industry players.

~~~
sametmax
Also, 3 years ago I would have said it was quite immature. But it matured a
lot since then, I had the chance to put it in production. It's not perfect,
but it's very cool and is production ready.

And the whole ecosystem is about open standard and open source. Really good
vibes.

------
cstrat
This looks really cool.

I currently use Meteor for webapp development, but when I really look into it
the main parts of meteor I use are pub/sub & method calls.

The rest is just react, react router, and the meteor build tools which can be
swapped out.

This looks like a promising light weight alternative... plus meteor doesn't
run on raspberry pis :(

~~~
sametmax
Be prepared to do some manual work to wire your site auth with crossbar
mechanism. The rest is quite plug and play.

------
dfischer
Interesting.

This reminds me of DDP. Meteor had a lot of good things right:
[https://github.com/meteor/meteor/blob/master/packages/ddp/DD...](https://github.com/meteor/meteor/blob/master/packages/ddp/DDP.md)

~~~
sametmax
It doesn't have the Sync primitives but does have some addionnal stuff. I'd
say wamp is lower level, requiere more work, is easier to use and more
flexible.

------
nine_k
One thing I did not understand is whether it supports peer-to-peer operation,
or requires (at least one) routing server.

~~~
sametmax
The router is required. The clients don't see each others.

------
bullen
This makes no sense.

Try [http://fuse.rupy.se](http://fuse.rupy.se) instead.

------
brian_herman
Reminds me of SOAP

~~~
specialist
Yup. As a contractor, I maintained a home grown pre-WAMP (spec)
implementation. Think [http://autobahn.ws](http://autobahn.ws).

I totally didn't get the point. We controlled both the clients and server, so
our pre-WAMP was just SOAP style overhead. Meaning useless and confusing.

But the gig paid well and I got some much desired NIO & Netty experience.

------
dopamean
what it do what it do

~~~
porsager
A protocol for RPC and pub/sub over eg. WebSockets

