All Projects → rsocket → Rsocket Java

rsocket / Rsocket Java

Licence: apache-2.0
Java implementation of RSocket

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rsocket Java

rxjava2-http
Transmit RxJava2 Flowable over http with non-blocking backpressure
Stars: ✭ 19 (-99.09%)
Mutual labels:  reactive, stream, rxjava
Rxjava2 Extras
Utilities for use with RxJava 2
Stars: ✭ 167 (-92.04%)
Mutual labels:  rxjava, reactive, stream
Rxplaces
A Google Maps Webservice API made simple.
Stars: ✭ 56 (-97.33%)
Mutual labels:  rxjava, reactive
Android Okgraphql
Reactive GraphQl client for Android
Stars: ✭ 64 (-96.95%)
Mutual labels:  rxjava, reactive
Rxviz
Rx Visualizer - Animated playground for Rx Observables
Stars: ✭ 1,471 (-29.92%)
Mutual labels:  reactive, stream
Rxjava Android Samples
Learning RxJava for Android by example
Stars: ✭ 7,520 (+258.27%)
Mutual labels:  rxjava, reactive
Aws Sdk
Using vertx-client for AWS SDK v2
Stars: ✭ 38 (-98.19%)
Mutual labels:  reactive, netty
Rxbus
Android reactive event bus that simplifies communication between Presenters, Activities, Fragments, Threads, Services, etc.
Stars: ✭ 79 (-96.24%)
Mutual labels:  rxjava, reactive
Grpc By Example Java
A collection of useful/essential gRPC Java Examples
Stars: ✭ 709 (-66.22%)
Mutual labels:  rxjava, stream
Advanced Vertx Guide
A gentle guide for advanced Vert.x users
Stars: ✭ 118 (-94.38%)
Mutual labels:  reactive, netty
Vertx Mqtt
Vert.x MQTT
Stars: ✭ 117 (-94.43%)
Mutual labels:  rxjava, reactive
Knotx
Knot.x is a highly-efficient and scalable integration framework designed to build backend APIs
Stars: ✭ 119 (-94.33%)
Mutual labels:  rxjava, reactive
Rxjava2 Operators Magician
你用不惯 RxJava,只因缺了这把钥匙 🔑 You are not used to RxJava, just because of the lack of this key.
Stars: ✭ 868 (-58.65%)
Mutual labels:  rxjava, reactive
Rxreactor
A Kotlin framework for a reactive and unidirectional RxJava application architecture
Stars: ✭ 19 (-99.09%)
Mutual labels:  rxjava, reactive
Vert.x
Vert.x is a tool-kit for building reactive applications on the JVM
Stars: ✭ 12,544 (+497.62%)
Mutual labels:  reactive, netty
Rxjavafiberinterop
Library for interoperation between RxJava 3 and Project Loom's Fibers.
Stars: ✭ 19 (-99.09%)
Mutual labels:  rxjava, reactive
Rxjavajdk8interop
RxJava 2/3 interop library for supporting Java 8 features such as Optional, Stream and CompletableFuture [discontinued]
Stars: ✭ 70 (-96.67%)
Mutual labels:  rxjava, stream
Marble
Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
Stars: ✭ 1,947 (-7.24%)
Mutual labels:  reactive, stream
Servicetalk
A networking framework that evolves with your application
Stars: ✭ 656 (-68.75%)
Mutual labels:  reactive, netty
Vertx Sql Client
High performance reactive SQL Client written in Java
Stars: ✭ 690 (-67.13%)
Mutual labels:  reactive, netty

RSocket

Join the chat at https://gitter.im/RSocket/RSocket-Java

RSocket is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron.

It enables the following symmetric interaction models via async message passing over a single connection:

  • request/response (stream of 1)
  • request/stream (finite stream of many)
  • fire-and-forget (no response)
  • event subscription (infinite stream of many)

Learn more at http://rsocket.io

Build and Binaries

Build Status

⚠️ The master branch is now dedicated to development of the 1.1.x line.

Releases and milestones are available via Maven Central.

Example:

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/milestone' }  // Reactor milestones (if needed)
}
dependencies {
    implementation 'io.rsocket:rsocket-core:1.1.1'
    implementation 'io.rsocket:rsocket-transport-netty:1.1.1'
}

Snapshots are available via oss.jfrog.org (OJO).

Example:

repositories {
    maven { url 'https://maven.pkg.github.com/rsocket/rsocket-java' }
    maven { url 'https://repo.spring.io/snapshot' }  // Reactor snapshots (if needed)
}
dependencies {
    implementation 'io.rsocket:rsocket-core:1.1.2-SNAPSHOT'
    implementation 'io.rsocket:rsocket-transport-netty:1.1.2-SNAPSHOT'
}

Development

Install the google-java-format in Intellij, from Plugins preferences. Enable under Preferences -> Other Settings -> google-java-format Settings

Format automatically with

$./gradlew goJF

Debugging

Frames can be printed out to help debugging. Set the logger io.rsocket.FrameLogger to debug to print the frames.

Requirements

Trivial Client

package io.rsocket.transport.netty;

import io.rsocket.Payload;
import io.rsocket.RSocket;
import io.rsocket.core.RSocketConnector;
import io.rsocket.transport.netty.client.WebsocketClientTransport;
import io.rsocket.util.DefaultPayload;
import reactor.core.publisher.Flux;

import java.net.URI;

public class ExampleClient {
    public static void main(String[] args) {
        WebsocketClientTransport ws = WebsocketClientTransport.create(URI.create("ws://rsocket-demo.herokuapp.com/ws"));
        RSocket clientRSocket = RSocketConnector.connectWith(ws).block();

        try {
            Flux<Payload> s = clientRSocket.requestStream(DefaultPayload.create("peace"));

            s.take(10).doOnNext(p -> System.out.println(p.getDataUtf8())).blockLast();
        } finally {
            clientRSocket.dispose();
        }
    }
}

Zero Copy

By default to make RSocket easier to use it copies the incoming Payload. Copying the payload comes at cost to performance and latency. If you want to use zero copy you must disable this. To disable copying you must include a payloadDecoder argument in your RSocketFactory. This will let you manage the Payload without copying the data from the underlying transport. You must free the Payload when you are done with them or you will get a memory leak. Used correctly this will reduce latency and increase performance.

Example Server setup

RSocketServer.create(new PingHandler())
        // Enable Zero Copy
        .payloadDecoder(PayloadDecoder.ZERO_COPY)
        .bind(TcpServerTransport.create(7878))
        .block()
        .onClose()
        .block();

Example Client setup

RSocket clientRSocket =
        RSocketConnector.create()
            // Enable Zero Copy
            .payloadDecoder(PayloadDecoder.ZERO_COPY)
            .connect(TcpClientTransport.create(7878))
            .block();

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.

LICENSE

Copyright 2015-2020 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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].