Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mostroverkhov committed May 18, 2023
2 parents 4bc6ae6 + 0f48beb commit f79c364
Show file tree
Hide file tree
Showing 27 changed files with 446 additions and 111 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Very fast GRPC-like & GRPC-compatible services on JVM with rich streaming models

## Summary

>multiple APIs: CompletableFuture; traditional streaming with GRPC-API (StreamObserver), or flavor of reactive: smallrye-mutiny, rxjava, reactor;
>multiple APIs: CompletableFuture or virtual threads; traditional streaming with GRPC-API (StreamObserver), or flavor of reactive: smallrye-mutiny, rxjava, reactor;
>
>pluggable networking: TCP, unix sockets, GRPC, websockets, websockets-over-http2;
>
Expand All @@ -33,20 +33,20 @@ multiple transports using multiple APIs.
RSocket is low latency/high throughput L5 network protocol intended for high-performance services communication.
It is transport agnostic, and runs on top of any reliable byte stream transport.

### CompletableFuture; GRPC StreamObserver; smallrye-mutiny, rxjava, project-reactor
### CompletableFuture; virtual threads; GRPC StreamObserver; smallrye-mutiny, rxjava, project-reactor

**Multiple vendor libraries**. [Shared protocol core](https://jauntsdn.com/post/rsocket-jvm/) with minimal dependencies
(`netty-buffer` only) streamlined development process for each vendor library & reduced maintenance cost of multiple libraries to feasible level.

Project supports 3 kinds of APIs:
* request-response with RSocket-futures (JDK only CompletableFuture);
* request-response with RSocket-futures (JDK CompletableFuture) or virtual threads;
* traditional streaming with RSocket-GRPC (GRPC-stubs StreamObserver);
* flavors of reactive with RSocket-mutiny (smallrye-mutiny), RSocket-rxjava (rxjava3), and RSocket-reactor (project-reactor).

**GRPC compatible**. All implementations are directly compatible with GRPC via MessageStreams-RPC & GRPC transport.
GRPC clients can access such services without separate "gateway" binaries and IDL sharing schemes.

**Non-intrusive**. [MessageStreams](https://github.com/jauntsdn/rsocket-jvm/blob/1.3.1/rsocket-reactor/src/main/java/com/jauntsdn/rsocket/MessageStreams.java) API & [RSocket-JVM](https://github.com/jauntsdn/rsocket-jvm/blob/1.3.1/rsocket-reactor/src/main/java/com/jauntsdn/rsocket/RSocket.java) runtime are clearly split so from end-user perspective there is
**Non-intrusive**. [MessageStreams](https://github.com/jauntsdn/rsocket-jvm/blob/1.3.2/rsocket-reactor/src/main/java/com/jauntsdn/rsocket/MessageStreams.java) API & [RSocket-JVM](https://github.com/jauntsdn/rsocket-jvm/blob/1.3.2/rsocket-reactor/src/main/java/com/jauntsdn/rsocket/RSocket.java) runtime are clearly split so from end-user perspective there is
only set of streaming & non-streaming interactions on buffers/messages:

```groovy
Expand Down Expand Up @@ -116,10 +116,10 @@ repositories {
}
dependencies {
implementation "com.jauntsdn.rsocket:rsocket-messages:1.3.1"
implementation "com.jauntsdn.rsocket:rsocket-rpc-idl:1.3.1"
implementation "com.jauntsdn.rsocket:rsocket-<VENDOR>:1.3.1"
implementation "com.jauntsdn.rsocket:rsocket-rpc-<VENDOR>:1.3.1"
implementation "com.jauntsdn.rsocket:rsocket-messages:1.3.2"
implementation "com.jauntsdn.rsocket:rsocket-rpc-idl:1.3.2"
implementation "com.jauntsdn.rsocket:rsocket-<VENDOR>:1.3.2"
implementation "com.jauntsdn.rsocket:rsocket-rpc-<VENDOR>:1.3.2"
}
```

Expand All @@ -128,17 +128,19 @@ MessageStreams-RPC compiler binaries are linux, windows(x86) only
protobuf {
plugins {
rsocketRpc {
artifact = "com.jauntsdn.rsocket:rsocket-rpc-<VENDOR>-compiler:1.3.1"
artifact = "com.jauntsdn.rsocket:rsocket-rpc-<VENDOR>-compiler:1.3.2"
}
}
}
```

For `virtualthreads` APIs binaries are available for RPC only.

### Message streams. Design goals & scope

**Fast transparent networking with practically useful set of streams libraries, solely for JVM serverside applications**

Currently CompletableFuture, GRPC-stubs (StreamObserver), smallrye-mutiny, rxjava3, projectreactor.
Currently CompletableFutures (plus virtual threads), GRPC-stubs (StreamObserver), smallrye-mutiny, rxjava3, projectreactor.

Languages and platforms other than JVM lack framework ecosystem (and most lack single reactive streams compatible library),
so there are no substantial (except populist) reasons for commitment.
Expand Down
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,20 @@ subprojects {
mavenCentral()
}

def javaVersion = project.name.endsWith("helidon") ? 11 : 1.8
def javaVersion =
project.name.endsWith("virtualthreads") ? 20
: project.name.endsWith("helidon") ? 11
: 8

plugins.withType(JavaLibraryPlugin) {
if (useToolchains()) {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(javaVersion)
}
}
}

compileJava {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
Expand Down Expand Up @@ -114,4 +125,15 @@ def projectVersion(project) {
return project.version + versionSuffix
}

def useToolchains() {
if (properties.get("release") == "true") {
return true
}
if (!project.hasProperty("toolchains")) {
return false
}
def toolchains = project.property("toolchains")
return toolchains == null || toolchains.isEmpty() || toolchains == "true"
}

defaultTasks "goJF", "clean", "build"
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
group=com.jauntsdn.rsocket
version=1.3.2
version=1.4.0

dependencyManagementPluginVersion=1.1.0
protobufPluginVersion=0.9.2
googleJavaFormatPluginVersion=0.9
gitPluginVersion=0.13.0
versionsPluginVersion=0.45.0

nettyBomVersion=4.1.91.Final
nettyBomVersion=4.1.92.Final
grpcStubVersion=1.54.1
reactorBomVersion=Dysprosium-SR22
rxjavaVersion=3.1.6
Expand All @@ -22,5 +22,7 @@ jakartaAnnotationVersion=2.1.1
protobufVersion=3.22.3

release=false
virtualthreads=false
toolchains=false
org.gradle.parallel=true
org.gradle.configureondemand=true
80 changes: 25 additions & 55 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
subprojects {
def isRelease = isRelease(project)
def releasedModules = isRelease ? releaseModules(project) : []

plugins.withType(MavenPublishPlugin) {

Expand Down Expand Up @@ -56,45 +55,40 @@ subprojects {
}

if (isRelease) {
if (releasedModules.contains(project.name)) {
boolean hasRhOssCredentials = project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")
if (!hasRhOssCredentials) {
throw new GradleException("Release build lacks credentials properties: ossrhUsername, ossrhPassword")
}
task publishToSonatype {
finalizedBy "publishMavenPublicationToSonatypeRepository"
doLast {
println "\nPublishing ${project.name} artifacts to Sonatype"
println "Sonatype repository url: ${repositories.sonatype.url}\n"
publishing.publications.maven.publishableArtifacts
.collect { it.file.name }
.sort { it }
.each { println "[${project.name}] Uploading artifact..................${it}" }
}
boolean hasRhOssCredentials = project.hasProperty("ossrhUsername") && project.hasProperty("ossrhPassword")
if (!hasRhOssCredentials) {
throw new GradleException("Release build lacks credentials properties: ossrhUsername, ossrhPassword")
}
task publishToSonatype {
finalizedBy "publishMavenPublicationToSonatypeRepository"
doLast {
println "\nPublishing ${project.name} artifacts to Sonatype"
println "Sonatype repository url: ${repositories.sonatype.url}\n"
publishing.publications.maven.publishableArtifacts
.collect { it.file.name }
.sort { it }
.each { println "[${project.name}] Uploading artifact..................${it}" }
}
}

repositories {
maven {
name = "sonatype"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.property("ossrhUsername")
password = project.property("ossrhPassword")
}
repositories {
maven {
name = "sonatype"
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.property("ossrhUsername")
password = project.property("ossrhPassword")
}
}
} else {
project.tasks.all { task -> task.enabled = false }
}
}
}
plugins.withType(SigningPlugin) {
signing {
def isSigned = isRelease && releasedModules.contains(project.name)
println("Publication signed: ${isSigned}")
if (isSigned) {
println("Publication signed: ${isRelease}")
if (isRelease) {
sign publishing.publications.maven
}
}
Expand All @@ -104,28 +98,4 @@ subprojects {

def isRelease(Project project) {
return project.hasProperty("release") && project.property("release") == "true"
}

def releaseModules(Project project) {
if (!project.hasProperty("target")) {
throw new GradleException("Release build lacks target property: java8, java11")
}
def target = project.property("target")
def javaVersion = JavaVersion.current()
def releasedModules
if (target == "java8") {
if (!javaVersion.isJava8()) {
throw new GradleException("Invalid java version for java8 release: ${javaVersion}")
}
/*non-java8 modules are excluded in settings.gradle*/
releasedModules = project.parent.subprojects.collect { p -> p.name }
} else if (target == "java11") {
if (!javaVersion.isJava11()) {
throw new GradleException("Invalid java version for java11 release: ${javaVersion}")
}
releasedModules = ["rsocket-helidon", "rsocket-rpc-helidon", "rsocket-bom"]
} else {
throw new GradleException("Unsupported release target: ${target}")
}
return releasedModules
}
3 changes: 0 additions & 3 deletions release11.sh

This file was deleted.

3 changes: 0 additions & 3 deletions release8.sh

This file was deleted.

1 change: 1 addition & 0 deletions rsocket-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {

api "com.jauntsdn.rsocket:rsocket-rpc-grpc-compiler:${version}"
api "com.jauntsdn.rsocket:rsocket-rpc-futures-compiler:${version}"
api "com.jauntsdn.rsocket:rsocket-rpc-virtualthreads-compiler:${version}"
api "com.jauntsdn.rsocket:rsocket-rpc-mutiny-compiler:${version}"
api "com.jauntsdn.rsocket:rsocket-rpc-reactor-compiler:${version}"
api "com.jauntsdn.rsocket:rsocket-rpc-rxjava-compiler:${version}"
Expand Down
2 changes: 1 addition & 1 deletion rsocket-bom/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
io.netty:netty-bom:4.1.91.Final=classpath
io.netty:netty-bom:4.1.92.Final=classpath
io.projectreactor:reactor-bom:Dysprosium-SR22=classpath
empty=
4 changes: 2 additions & 2 deletions rsocket-futures/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
empty=annotationProcessor
4 changes: 2 additions & 2 deletions rsocket-grpc/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.grpc:grpc-stub:1.54.1=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
empty=annotationProcessor
4 changes: 2 additions & 2 deletions rsocket-helidon/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ io.helidon.common:helidon-common-mapper:2.5.6=compileClasspath,runtimeClasspath
io.helidon.common:helidon-common-reactive:2.5.6=compileClasspath,runtimeClasspath
io.helidon.common:helidon-common-service-loader:2.5.6=compileClasspath,runtimeClasspath
io.helidon.common:helidon-common:2.5.6=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
empty=annotationProcessor
4 changes: 2 additions & 2 deletions rsocket-messages/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
empty=annotationProcessor
4 changes: 2 additions & 2 deletions rsocket-mutiny/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
io.smallrye.common:smallrye-common-annotation:1.13.0=compileClasspath,runtimeClasspath
io.smallrye.reactive:mutiny:1.8.0=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
Expand Down
4 changes: 2 additions & 2 deletions rsocket-reactor/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
io.projectreactor:reactor-core:3.3.19.RELEASE=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
org.reactivestreams:reactive-streams:1.0.3=compileClasspath,runtimeClasspath
Expand Down
4 changes: 2 additions & 2 deletions rsocket-rpc-futures/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ com.google.errorprone:javac-shaded:9+181-r4173-1=googleJavaFormat1.6
com.google.googlejavaformat:google-java-format:1.6=googleJavaFormat1.6
com.google.guava:guava:22.0=googleJavaFormat1.6
com.google.j2objc:j2objc-annotations:1.1=googleJavaFormat1.6
io.netty:netty-buffer:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.91.Final=compileClasspath,runtimeClasspath
io.netty:netty-buffer:4.1.92.Final=compileClasspath,runtimeClasspath
io.netty:netty-common:4.1.92.Final=compileClasspath,runtimeClasspath
org.codehaus.mojo:animal-sniffer-annotations:1.14=googleJavaFormat1.6
empty=annotationProcessor
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public RpcHandler withLifecycle(Closeable requester) {
}
}

static <T> CompletableFuture<T> completedFuture(Throwable t) {
public static <T> CompletableFuture<T> completedFuture(Throwable t) {
CompletableFuture<T> future = new CompletableFuture<>();
future.completeExceptionally(t);
return future;
Expand Down
Loading

0 comments on commit f79c364

Please sign in to comment.