All Projects → angiolep → Akka Wamp

angiolep / Akka Wamp

Licence: other
WAMP - Web Application Messaging Protocol implementation written with Akka

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Akka Wamp

Akka Http
The Streaming-first HTTP server/module of Akka
Stars: ✭ 1,163 (+2484.44%)
Mutual labels:  akka, websocket
Safe Chat
IRC-style chat demo featuring full-stack F#, Akka.Streams, Akkling, Fable, Elmish, Websockets and .NET Core
Stars: ✭ 157 (+248.89%)
Mutual labels:  akka, websocket
Cookim
Distributed web chat application base websocket built on akka.
Stars: ✭ 198 (+340%)
Mutual labels:  akka, websocket
Springmvc Project
开箱即用的SpringMVC项目,包含常规业务所需的框架功能整合,更多功能请关注 https://github.com/MartinDai/SpringBoot-Project
Stars: ✭ 33 (-26.67%)
Mutual labels:  websocket
Discord4j
Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.
Stars: ✭ 973 (+2062.22%)
Mutual labels:  websocket
Heimdallr
Heimdallr, a Large-scale chat application server based on Redis Pubsub and Akka's actor model.
Stars: ✭ 38 (-15.56%)
Mutual labels:  akka
Branroom
webchat ,a site written in java with SSM framework,support blog post
Stars: ✭ 42 (-6.67%)
Mutual labels:  websocket
Constructr Consul
This library enables to use Consul as cluster coordinator in a ConstructR based node
Stars: ✭ 32 (-28.89%)
Mutual labels:  akka
Mean Angular4 Chat App
MEAN stack with Angular 4 Chat App
Stars: ✭ 41 (-8.89%)
Mutual labels:  websocket
Ette
EVM-based Blockchain Indexer, with historical data query & real-time notification support 😎
Stars: ✭ 37 (-17.78%)
Mutual labels:  websocket
Graphql Rust Demo
GraphQL Rust Demo
Stars: ✭ 37 (-17.78%)
Mutual labels:  websocket
Sockjs Client
WebSocket emulation - Javascript client
Stars: ✭ 7,808 (+17251.11%)
Mutual labels:  websocket
Workerman Chat
Websocket chat room written in PHP based on workerman.
Stars: ✭ 988 (+2095.56%)
Mutual labels:  websocket
Vuex Socketio Plugin
Vuex plugin to integrate socket.io client
Stars: ✭ 34 (-24.44%)
Mutual labels:  websocket
Embedio
A tiny, cross-platform, module based web server for .NET
Stars: ✭ 1,007 (+2137.78%)
Mutual labels:  websocket
Slipstream
A slick websocket client for Phoenix channels
Stars: ✭ 33 (-26.67%)
Mutual labels:  websocket
Websocket Connection Smuggler
websocket-connection-smuggler
Stars: ✭ 40 (-11.11%)
Mutual labels:  websocket
Toketi Iothubreact
Akka Stream library for Azure IoT Hub
Stars: ✭ 36 (-20%)
Mutual labels:  akka
Remotelogcatviewer
websocket实现的远程查看android logcat
Stars: ✭ 35 (-22.22%)
Mutual labels:  websocket
Babl
Low-latency WebSocket Server
Stars: ✭ 37 (-17.78%)
Mutual labels:  websocket

Akka Wamp

Build Status CodeCov Status Gitter

Akka Wamp is a WAMP - Web Application Messaging Protocol implementation written to let both Scala and Java developers build the next generation of reactive web services on top of Akka abstractions.

Akka Wamp provides you with:

  • Simple Client APIs designed to be used with Akka actors, futures and streams.
  • Object-oriented representations of all WAMP Messages,
  • Akka IO extenson driver for the WAMP Protocol.
  • Basic Router you can embed in your applications or launch as standalone process.

Usage

Easy to download as dependency from Maven central:

libraryDependencies ++= Seq(
  "com.github.angiolep" % "akka-wamp_2.12" % "0.15.1"
)

Docs

  • User's guide, code fragments and dozens of examples are published here.
  • API doc is published here

Client APIs

Connect to a router, open a session, subscribe to a topic, consume events, register a remote procedure and call it in few lines of Scala or Java code.

  • Actors, Futures and Streams based APIs.
  • Lambda consumers and handlers support.
  • Lazy and pluggable deserializers.
  • Java 8 support.
  • ... and much more!

Please, read the docs for further details

Java client

Though written in Scala, Akka Wamp provides simple client APIs for Java developers as well. Compared to other WAMP implementations, Akka Wamp will let you write less code for much more functionalities!

import akka.actor.*;
import akka.wamp.client.japi.*;

import static java.util.Array.asList;
import static java.lang.System.out;

public class JavaClient {
  public static void main(String[] arr) {
    ActorSystem actorSystem = ActorSystem.create();
    Client client = Client.create(actorSystem);
    
    client.connect("endpoint").thenAccept(c -> {
      c.open("realm").thenAccept(s -> {
    
        s.publish("topic", asList("Ciao!"));
    
        s.subscribe("topic", (event) -> {
          out.println("got " + event.args().get(0));
        });
    
        s.register("procedure", (invoc) -> {
          Integer a = (Integer) invoc.args().get(0);
          Integer b = (Integer) invoc.args().get(1);
          return a + b;
        });
    
        s.call("procedure", asList(20, 55)).thenAccept(res -> {
          out.println("20 * 55 = " + res.args().get(0));  
        });
      });
    });
  }
}

Scala client

Akka Wamp provides Scala developer with great support to let them write "no boilerplate code" at all! Just few statements and here it is a fully capable reactive WAMP client ;-)

import akka.actor._
import akka.wamp.client._

object ScalaClient extends App {
  
  val system = ActorSystem()
  val client = Client(system)
  implicit val executionContext = system.dispatcher

  client.connect("endpoint").map { conn =>
    conn.open("realm").map { implicit session =>

      subscribe("topic", (arg: Int) => {
        println(s"got $arg")
      })

      publish("topic", List("Ciao!"))

      call("procedure", List(20, 55)).foreach { res =>
        println(s"20 * 55 = ${res.args(0)}")
      }
      
      register("procedure", (a: Int, b: Int) => {
        a + b
      })
    }
  }
}

Router

Download

Akka Wamp provides you with a basic router that can be either embedded into your application or launched as standalone server process.

Download the latest router version, extract, configure and run it as standalone application:

curl https://dl.bintray.com/angiolep/universal/akka-wamp-0.15.2.tgz
tar xvfz akka-wamp-0.15.2.tar.gz
cd akka-wamp-0.15.2
vim ./conf/application.conf
./bin/akka-wamp -Dakka.loglevel=DEBUG

Limitations

  • Java >= 1.8.0
  • Scala >= 2.12.0
  • Akka >= 2.5.0
  • WebSocket transport only (no raw TCP)
  • WAMP Basic Profile only (none of the Advanced Profile features yet)
  • JSON serialization only (no MsgPack yet)
  • Not yet ready for production

Changelog

Please, read CHANGELOG.md

Contributing

Please, read CONTRIBUTING.md

Licence

This software comes with Apache License 2.0

Disclaimer

This SOFTWARE PRODUCT is provided by THE PROVIDER "as is" and "with all faults." THE PROVIDER makes no representations or warranties of any kind concerning the safety, suitability, lack of viruses, inaccuracies, typographical errors, or other harmful components of this SOFTWARE PRODUCT. There are inherent dangers in the use of any software, and you are solely responsible for determining whether this SOFTWARE PRODUCT is compatible with your equipment and other software installed on your equipment. You are also solely responsible for the protection of your equipment and backup of your data, and THE PROVIDER will not be liable for any damages you may suffer in connection with using, modifying, or distributing this SOFTWARE PRODUCT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].